Raised This Month: $ Target: $400
 0% 

storing authID of players in global array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
mihaiveress
Member
Join Date: Jan 2009
Location: Tirgu-Mures , Romania
Old 02-26-2009 , 13:13   Re: storing authID of players in global array
Reply With Quote #3

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(!actiong_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) > )
        {
        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 
2server_cmd("amx_slay2 #%d 1",id
        case 
3banPlayer(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(idprint_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==0client_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) 
		
}
mihaiveress is offline
Send a message via Yahoo to mihaiveress Send a message via Skype™ to mihaiveress
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode