Raised This Month: $ Target: $400
 0% 

Player out of Range


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
InteX01
Senior Member
Join Date: Jan 2017
Old 07-01-2017 , 08:57   Player out of Range
Reply With Quote #1

PHP Code:
public vip_brzina(id)
{
    
set_user_maxspeed(idget_user_maxspeed(id) + 20)
}

public 
svip_brzina(id)
{
    
set_user_maxspeed(idget_user_maxspeed(id) + 35)

L 07/01/2017 - 126:40: [AMXX] Displaying debug trace (plugin "jb_mod.amxx&quot
L 07/01/2017 - 126:40: [AMXX] Run time error 10: native error (native "get_user_maxspeed&quot
L 07/01/2017 - 126:40: [AMXX] [0] jb_mod.sma::svip_brzina (line 4710)
L 07/01/2017 - 126:40: [FUN] Player out of range (0)

L 07/01/2017 - 126:40: [AMXX] Displaying debug trace (plugin "jb_mod.amxx&quot
L 07/01/2017 - 126:40: [AMXX] Run time error 10: native error (native "get_user_maxspeed&quot
L 07/01/2017 - 126:40: [AMXX] [0] jb_mod.sma::svip_brzina (line 4710)
L 07/01/2017 - 126:40: [FUN] Player out of range (0)


Why this happens ?
Sorry about this "&quot" things at the end.. Copied from teamspeak.

Last edited by InteX01; 07-01-2017 at 08:58.
InteX01 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-01-2017 , 09:03   Re: Player out of Range
Reply With Quote #2

is_user_alive
__________________
HamletEagle is offline
InteX01
Senior Member
Join Date: Jan 2017
Old 07-01-2017 , 09:14   Re: Player out of Range
Reply With Quote #3

Didnt know it can make errors like this
InteX01 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-01-2017 , 11:32   Re: Player out of Range
Reply With Quote #4

Quote:
Originally Posted by InteX01 View Post
Didnt know it can make errors like this
It's not obvious based on the name of the native, but is_user_alive() has a check for a valid player id range.
Code:
static cell AMX_NATIVE_CALL is_user_alive(AMX *amx, cell *params) /* 1 param */
{
	int index = params[1];
	
	if (index < 1 || index > gpGlobals->maxClients)
	{
		return 0;
	}
	...
You should have checking in place before calling vip_brzina(id) and svip_brzina(id)
__________________

Last edited by Bugsy; 07-01-2017 at 11:33.
Bugsy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-01-2017 , 09:24   Re: Player out of Range
Reply With Quote #5

Lack of it can cause the errors.
__________________
HamletEagle 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 23:04.


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