PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Speed"
#define VERSION "1.0"
#define AUTHOR "akcaliberk"
new g_Durum,g_Hiz;
new bool:is_user_speedy[32];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_speed","cmdSpeed",ADMIN_BAN,"<nick> <1/0>")
g_Durum = register_cvar("amx_speed_enabled","1")
g_Hiz = register_cvar("amx_speed_value","400.0")
register_logevent("EventRoundStart",2,"1=Round_Start")
register_event("CurWeapon", "HookCurWeapon", "be", "1=1" )
}
public EventRoundStart() {
for(new i=1;i<33;i++) {
is_user_speedy[i] = false;
}
}
public cmdSpeed(id,level,cid) {
if(get_pcvar_num(g_Durum) == 0) return PLUGIN_CONTINUE
if(!cmd_access(id,level,cid,3)) return PLUGIN_HANDLED
new AdminName[65],HedefName[65],Hedefid,Hedef[65],Durum[11];
read_argv(1,Hedef,64)
read_argv(2,Durum,10)
Hedefid = find_player("bhl",Hedef)
if(Hedefid == 0) {
console_print(id,"Belirtilen Isimde Oyuncu Bulunamadi !")
return PLUGIN_HANDLED
}
if(!(get_user_flags(id) & ADMIN_RCON) && (get_user_flags(Hedefid) & ADMIN_IMMUNITY)) {
console_print(id,"Dokunulmaz Oyunculara Bu Komutu Uygulayabilmek Icin Yetkili Degilsin !")
return PLUGIN_HANDLED
}
if(!is_user_alive(Hedefid)) {
console_print(id,"Bu Komutu Olu Bir Oyuncunun Uzerinde Kullanamazsin !")
return PLUGIN_HANDLED
}
get_user_name(id,AdminName,64)
get_user_name(Hedefid,HedefName,64)
if(equali(Durum,"1")) {
is_user_speedy[Hedefid] = true;
set_user_maxspeed(Hedefid,get_pcvar_float(g_Hiz))
client_print(0,print_chat,"[AMXX] ADMIN %s: %s Adli Oyuncuya Hiz Verdi !",AdminName,HedefName)
log_amx("ADMIN %s: %s Adli Oyuncuya Hiz Verdi !",AdminName,HedefName)
}
else {
is_user_speedy[Hedefid] = false;
set_user_maxspeed(Hedefid,250.0)
client_print(0,print_chat,"[AMXX] ADMIN %s: %s Adli Oyuncunun Hizini Normale Cevirdi !",AdminName,HedefName)
log_amx("ADMIN %s: %s Adli Oyuncunun Hizini Normale Cevirdi !",AdminName,HedefName)
}
return PLUGIN_HANDLED
}
public HookCurWeapon(id) {
if(is_user_speedy[id]) {
set_user_maxspeed(id,get_pcvar_float(g_Hiz))
}
else {
set_user_maxspeed(id,250.0)
}
}
amx_cvar amx_speed_value "400.0" // Hiz Ayari