First off, you have an odd number of braces. You end your function half way through the posted code.
g_num will blow up (i.e. go to infinity)
I think you should use something like this:
PHP Code:
new g_punish[33][2]
public client_putinserver(id)
{
g_punish[id][0] = 0 // Number of Punishes?
g_punish[id][1] = get_timeleft() // Timeleft at last punish
}
And if your playerpunish function is supposed to be for a single player (which seems to be because of punishPlayer(id)) you should use g_punish[id][#] when getting or setting the info.
Also, no where in your code do you use "authID". authID will be something like: STEAM_0:1:132334.
Also,
PHP Code:
server_cmd("amx_slap #%d %d",name,5)
server_cmd("amx_slap #%d %d",id,40)
are used incorrectly.
Use one of:
PHP Code:
server_cmd("amx_slap %s %d",name,5)
server_cmd("amx_slap #%d %d",userid,40)
where userid = get_user_userid(id)
EDIT:
Ok, I came up with something. You can check it out in the attached file. Basically with my code: if a player is punished 4 times within 5 minutes they get banned. If they don't get banned in that 5 minutes punishes and the time is reset.
__________________