Raised This Month: $ Target: $400
 0% 

Invalid player id


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
taheri6
Member
Join Date: Mar 2006
Old 01-05-2008 , 16:53   Invalid player id
Reply With Quote #1

Hello,

Forgive this noob question, but I get errors such as this:

Invalid player id 32
Run time error 10: native error (native "get_user_aiming")

Invalid player id 121
Run time error 10: native error (native "client_print")

Does that just meant the player is no longer connected, or does the playerID always need to be below the max amount of players?
taheri6 is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 01-05-2008 , 17:40   Re: Invalid player id
Reply With Quote #2

Quote:
Does that just meant the player is no longer connected,
Player with given id isnt be on server

Quote:
or does the playerID always need to be below the max amount of players?
probably yes

remember, playerID is always from 1 to 32.
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
zwfgdlc
Senior Member
Join Date: May 2006
Old 01-06-2008 , 02:39   Re: Invalid player id
Reply With Quote #3

Code:
if(is_user_connected(id))
get_user_aiming()
or
client_print()
zwfgdlc is offline
taheri6
Member
Join Date: Mar 2006
Old 01-06-2008 , 04:12   Re: Invalid player id
Reply With Quote #4

I edited the plugin and now before any client_print and hud message, or sound emit I always do
PHP Code:
if( is_user_connected(id) && !is_user_bot(id))
{
    
action;

I was also considering changing to
PHP Code:

#define MAX_PLAYERS 33;

if( ( 0id MAX_PLAYERS) && is_user_connected(id) && !is_user_bot(id))
{
    
action;

But am not sure if that would be an overkill or extra overhead if this has to be done quite a bit.
__________________
http://www.yaur.com -=[Yaur]=- Clan Website
taheri6 is offline
Reply



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 11:12.


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