Raised This Month: $51 Target: $400
 12% 

Invalid player? O_o


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 06-17-2009 , 04:31   Invalid player? O_o
Reply With Quote #1

Code:
public plugin_init()     RegisterHam(Ham_Spawn, "player", "fnSpawn", 1) public fnSpawn(id) {     if (get_user_maxspeed(id) > 320.0)     {         set_user_maxspeed(id, 320.0)         client_cmd(id, "cl_forwardspeed 320; cl_sidespeed 320; cl_backspeed 320")     }     return HAM_HANDLED }

Quote:
L 06/17/2009 - 04:26:58: [FUN] Invalid player 1
L 06/17/2009 - 04:26:58: [AMXX] Displaying debug trace (plugin "Wtf.amxx")
L 06/17/2009 - 04:26:58: [AMXX] Run time error 10: native error (native "get_user_maxspeed")
L 06/17/2009 - 04:26:58: [AMXX] [0] Wtf.sma::fnSpawn (line 123)
I can't think of any reason this would happen. :/
Spunky is offline
Send a message via AIM to Spunky
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-17-2009 , 04:37   Re: Invalid player? O_o
Reply With Quote #2

Just check if player is alive after spawning.
__________________
hleV is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 06-17-2009 , 04:54   Re: Invalid player? O_o
Reply With Quote #3

The error still happens with set_user_maxspeed() though. I think the id is really invalid for some reason, I just can't figure out why... is_user_alive() returns negative.
Spunky is offline
Send a message via AIM to Spunky
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-17-2009 , 05:53   Re: Invalid player? O_o
Reply With Quote #4

is_user_alive should work o.O
__________________
xPaw is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-17-2009 , 06:39   Re: Invalid player? O_o
Reply With Quote #5

Code:
public plugin_init()     RegisterHam(Ham_Spawn, "player", "fnSpawn", 1)   public fnSpawn(id) {     if (is_user_alive(id) && get_user_maxspeed(id) > 320.0)     {         set_user_maxspeed(id, 320.0)         client_cmd(id, "cl_forwardspeed 320; cl_sidespeed 320; cl_backspeed 320")     }       return HAM_HANDLED }
It's near impossible for the id to be invalid with this code. I doubt that HAM_HANLDED return would cause this.
__________________
hleV 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 15:55.


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