Raised This Month: $ Target: $400
 0% 

storing authID of players in global array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-26-2009 , 15:30   Re: storing authID of players in global array
Reply With Quote #4

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] = // 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.
__________________

Last edited by fysiks; 04-01-2009 at 16:14.
fysiks is offline
 



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