Raised This Month: $ Target: $400
 0% 

What means that error?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 01-05-2011 , 02:04   What means that error?
Reply With Quote #1

Topic^
Quote:
L 01/04/2011 - 23:29:13: [FUN] Player out of range (0)
L 01/04/2011 - 23:29:13: [AMXX] Displaying debug trace (plugin "zombies_strike.amxx")
L 01/04/2011 - 23:29:13: [AMXX] Run time error 10: native error (native "set_user_health")
L 01/04/2011 - 23:29:13: [AMXX] [0] zombies_strike.sma::First_Infected (line 452)
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 01-05-2011 , 02:13   Re: What means that error?
Reply With Quote #2

post your code or at least the First_Infected function.
You're setting health on an invalid player id.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 01-05-2011 , 02:52   Re: What means that error?
Reply With Quote #3

PHP Code:
public First_Infected(id)
{
       
g_zombie[id] = true
       FirstInfected
[id] = true

    
static Name[32]
    
get_user_name(idNamecharsmax(Name))
            
    
set_hudmessage(17900, -1.00.2820.021.00.010.110)
        
show_hudmessage(0"Beware! %s is First Infected!"Name)

    
set_user_health(idget_pcvar_num(first_zombie_health))
    
set_user_gravity(idget_pcvar_float(first_zombie_gravity) / 800)

    if (!
cs_get_user_nvg(id))
        
cs_set_user_nvg(id)
        
    if (
get_pcvar_num(zm_autonvg))
        
set_task(0.2"Task_NVG"TASKID_NVG id)

    
set_task(0.1"ShowHealth"id""0"b")

    
cs_set_user_model(idZombie_Models[random(sizeof Zombie_Models)])

~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 01-05-2011 , 03:28   Re: What means that error?
Reply With Quote #4

Check the code that calls this function, and see if id == 0
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 01-05-2011 , 03:47   Re: What means that error?
Reply With Quote #5

this is a call function
PHP Code:
set_task(10.0"First_Infected"
if i do that
PHP Code:
set_task(10.0"First_Infected"id
it's true?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 01-05-2011 , 04:34   Re: What means that error?
Reply With Quote #6

Quote:
Originally Posted by ~Ice*shOt View Post
this is a call function
PHP Code:
set_task(10.0"First_Infected"
if i do that
PHP Code:
set_task(10.0"First_Infected"id
it's true?
Yes. The first one is calling the function "First_Infected" without a given index, and without an index, I'm gonna take a shot in the dark and say it choses 0 as the index, and 0 isn't a valid player index. The second one though, provides an index.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 01-05-2011 , 05:04   Re: What means that error?
Reply With Quote #7

Quote:
Originally Posted by GXLZPGX View Post
Yes. The first one is calling the function "First_Infected" without a given index, and without an index, I'm gonna take a shot in the dark and say it choses 0 as the index, and 0 isn't a valid player index. The second one though, provides an index.
I'd like to add that id can be 0 too, that depends on how you use it.

PHP Code:
new id;
set_task(1.0"First_Infected"id); 
This will call your function, but id passed in the params will be 0.

PHP Code:
public client_putinserver(id)
    
set_task(1.0"First_Infected"id); 
This will call the function with id being the id of the player that entered the server.

To check if a variable contains a player id, you can use this:
PHP Code:
// Global
#define IsPlayer(%1)    (1 <= %1 <= g_iMaxPlayers)
new g_iMaxPlayers;

public 
plugin_init()
    
g_iMaxPlayers get_maxplayers();

SomeFunc(id)
{
    if(
IsPlayer(id))
        
// It is a  player id, you might wanna check if he's alive and stuff depending on what you are doing here.

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 01-05-2011 at 07:26.
drekes is offline
Send a message via MSN to drekes
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 01-05-2011 , 05:20   Re: What means that error?
Reply With Quote #8

OK. Thanks
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
MyDooMJr
Member
Join Date: Jun 2009
Location: Portugal
Old 01-05-2011 , 09:42   Re: What means that error?
Reply With Quote #9

Just one thing are u using #include <fun> ??
MyDooMJr is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 01-05-2011 , 10:09   Re: What means that error?
Reply With Quote #10

Quote:
Originally Posted by MyDooMJr View Post
Just one thing are u using #include <fun> ??
He must or the plugin won't compile
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 01:58.


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