PHP Code:
punishPlayer(id) {
new action = 1
action = get_cvar_num("amx_antirusher_action")
if ((get_cvar_num("amx_antirusher_immunity") == 1)&&(get_user_flags(id)&ADMIN_IMMUNITY)) {
action = 0
}
new i,ok=0
for(i=0;i<g_num&&(!ok);i++)
{
if(g_punish[i][0]==id)
{
ok=1
if(!action) g_punish[i][1]+=1
}
}
}
server_cmd("amx_say g_num=%d i=%d ok=%d p=%d id=%d",g_num,i,ok,g_punish[i][1],g_punish[i][0])
new timp=get_timeleft()
if((g_punish[i][2]-timp) > 5 )
{
switch(g_punish[i][0])
{
case 0:
{
new name[32]
get_user_name(id,name,31)
server_cmd("amx_chat %L",LANG_SERVER,"AR_SRV_INFO", name)
server_cmd("amx_slap #%d %d",name,5)
}
case 1:
{
server_cmd("amx_slap #%d %d",id,40)
}
case 2: server_cmd("amx_slay2 #%d 1",id)
case 3: banPlayer(id)
default:{
new name[32]
get_user_name(id,name,31)
server_cmd("amx_chat %L:p",LANG_SERVER,"AR_SRV_INFO", name)
server_cmd("amx_chat g_punish[%d]=%d timp=%d",i,g_punish[i][0],timp)
}
}
}
g_punish[i][2]=timp
if (warn_control >(25/floatround(10.0*TEST_TIME))){ // jak dlugo siedzisz w granicy to ci pisze w czacie :p
client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_WARN")
warn_control=0;}
warn_control+=1
if(get_cvar_num("amx_antirusher_sound")){
if(sounded[id]==0){
new sound_mode = get_cvar_num("amx_antirusher_sound_mode")
if(sound_mode==0) client_cmd(id,"spk %s",actions[action])
else client_cmd(0,"spk %s",actions[action])
sounded[id]=1
}
}
}
it all comes down to this
i need to keep in the array g_punish[i][] the authID of the players
i thought something like this
Code:
public client_putinserver(id){
new arg[1]
arg[0]=id
g_punish[g_num][0]=id
g_punish[g_num][1]=0
g_punish[g_num][2]=get_timeleft()
g_num+=1
if (map_cors_pre && get_cvar_num("amx_antirusher"))
set_task(45.0,"informclient",TASK_INFO+id,arg,1)
}