Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[forums.alliedmods.net] addtime


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7 490
  • Lokalizacja:AMXX.PL
Offline

Napisano 23.12.2011 13:06

Code: /*
*Add [addtime.amxx] in addons/amxmodx/configs/plugins.ini list
*Restart your server/Change map

Add [amx_addtime_max "num"] in addons/amxmodx/configs/amxx.cfg
Add [amx_addtime_enabled "num"] in addons/amxmodx/configs/amxx.cfg
//0=on other=off

*Add [mp_timelimit "num"] in addons/amxmodx/configs/amxx.cfg

*if (get_user_flags(id) & ADMIN_LEVEL_H) //users.ini T

Please enter the minutes you want to add in chat.
//e.p.:/addtime10 /addtime5

*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
//#include <colorchat>

#define PLUGIN "AddTime"
#define VERSION "1.2"
#define AUTHOR "VanSi"

new b
new bool:IsGetTime

//new saytext

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd("say","say_cheese");

register_event("ResetHUD","resethud","be");

register_cvar("amx_addtime_enabled","0"); //default open
register_cvar("amx_addtime_max","20"); //default 20mins
// Add your code here...
}

public say_cheese(id)
{
if(get_cvar_num("amx_addtime_enabled") != 0) //0=on
{
client_print(id, print_chat, "Addtime.amxx don't open! Plz set amxx.cfg!")
return PLUGIN_CONTINUE
}

new said[191],testsaid[10],testnum[10]
read_args(said,190)
remove_quotes(said)
copy(testsaid,8,said)

if(equali(testsaid,"/addtime")) // & (get_user_flags(id) & ADMIN_LEVEL_H)
{
copy(testnum,10,said)
if(str_to_num(testnum[8])==0)
{
client_print(id, print_chat, "Please enter the number after the seventh.")
return PLUGIN_HANDLED
}
replace(said,190,"/addtime","")
if (str_to_num(said) > get_cvar_num("amx_addtime_max") ) //检测是否超过每次最大增加时间。
{
client_print(id, print_chat, "Beyond the limits!") //超过限制。
return PLUGIN_HANDLED
}

if(equali(said,""))
{
client_print(id, print_chat, "Please enter the minutes you want to add in chat.")
//e.p.: /addtime10
return PLUGIN_HANDLED
}
addtime(id,str_to_num(said))
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

public addtime(id,minute)
{
if(!IsGetTime)
{
client_print(id, print_chat, "Please wait 5-10 seconds.")
return PLUGIN_HANDLED
}

if (b!=0)
{
if (get_user_flags(id) & ADMIN_LEVEL_H) //users.ini T。
{
b=(b+minute)
server_cmd("mp_timelimit %d",:)
if (get_cvar_float("mp_timelimit"))
{
new username[33]
get_user_name(id, username, 32)
new a = get_timeleft()
client_print(0, print_chat, "Admin: [%s], changed the timeleft to %d:%02d",username,((a / 60) + minute), (a % 60))
}
}
else
{
client_print(id, print_chat, "You don't have permission to execute this command.")
//你没有执行这个命令的权限。
}
}
else
client_print(id, print_chat, "The current server is not the timelimit, can't be changed.")

return PLUGIN_CONTINUE
}

public resethud(id)
{
if(!IsGetTime) //get mp_timelimit
{
b=get_timeleft() + 10
b=(b/60)
IsGetTime = true
}
}
/*welcome to visit www.kzcn.cc www.ftw-team.org www.vansi.org www.27015.com(97Club)*/

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych