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

Help SMA


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
n3Oh112
Junior Member
Join Date: Dec 2017
Old 12-31-2017 , 06:16   Help SMA
Reply With Quote #1

Hello.

I have this error in my cs 1.6 server (zombie xp mod)
Code:
L 12/31/2017 - 13:14:33: [AMXX] Displaying debug trace (plugin "zp_clase_oameni_zp.amxx", version "2.1")
L 12/31/2017 - 13:14:33: [AMXX] Run time error 10: native error (native "zp_get_user_zombie")
L 12/31/2017 - 13:14:33: [AMXX] [0] zp_clase_oameni_zp.sma::radar_scan (line 566)
L 12/31/2017 - 13:14:35: [ZP] Invalid Player (23)
L 12/31/2017 - 13:14:35: [AMXX] Displaying debug trace (plugin "zp_clase_oameni_zp.amxx", version "2.1")
L 12/31/2017 - 13:14:35: [AMXX] Run time error 10: native error (native "zp_get_user_zombie")
L 12/31/2017 - 13:14:35: [AMXX] [0] zp_clase_oameni_zp.sma::radar_scan (line 566)
The .sma is HERE
n3Oh112 is offline
RaZ_HU
Senior Member
Join Date: May 2015
Location: Hungary
Old 12-31-2017 , 06:46   Re: Help SMA
Reply With Quote #2

I think you are missing the check about is the user connected or not:

Try with this:
PHP Code:
public radar_scan()
{    
    new 
zombie_count 0;
    new 
zombie_list[32];
    new 
ZombieCoords[3];
    new 
idi;
    
    for (new 
id=1id<=32id++)
        if( 
is_user_connected(id) )    
            if (
zp_get_user_zombie(id) == true)
            {
                
zombie_count++;
                
zombie_list[zombie_count]=id;
            }
    
    for (
id=1id<=32id++)
    {
        if ( !
is_user_alive(id) || g_iPlayersClass[id] != CLASS_RADAR || zp_get_user_nemesis(id) || zp_get_user_survivor(id) || zp_get_user_zombie(id)) continue;
        
        for (
i=1;i<=zombie_count;i++)
        {
            
            
get_user_origin(zombie_list[i], ZombieCoords)
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageAdd, {0,0,0}, id)
            
write_byte(id)
            
write_byte(i)        
            
write_coord(ZombieCoords[0])
            
write_coord(ZombieCoords[1])
            
write_coord(ZombieCoords[2])
            
message_end()
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageDel, {0,0,0}, id)
            
write_byte(i)
            
message_end()
        }
    }

RaZ_HU is offline
n3Oh112
Junior Member
Join Date: Dec 2017
Old 12-31-2017 , 08:59   Re: Help SMA
Reply With Quote #3

Thank you verry much. Is working but i have another error...
Code:
L 12/31/2017 - 16:07:04: [ZP] Invalid Player (0)
L 12/31/2017 - 16:07:04: [AMXX] Displaying debug trace (plugin "16zombie.amxx", version "1.0.6")
L 12/31/2017 - 16:07:04: [AMXX] Run time error 10: native error (native "zp_get_user_zombie_class")
L 12/31/2017 - 16:07:04: [AMXX] [0] 16zombie.sma::zp_user_infected_post (line 63)
L 12/31/2017 - 16:07:04: [ZP] Invalid Player (0)
.sma
n3Oh112 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-31-2017 , 09:10   Re: Help SMA
Reply With Quote #4

Add the same check there too.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
n3Oh112
Junior Member
Join Date: Dec 2017
Old 12-31-2017 , 09:15   Re: Help SMA
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
Add the same check there too.
How?
n3Oh112 is offline
RaZ_HU
Senior Member
Join Date: May 2015
Location: Hungary
Old 12-31-2017 , 09:25   Re: Help SMA
Reply With Quote #6

It will log a message to the AMXX log files if you try to use the zp_user_infected_post(id) function on an invalid client.
Attached Files
File Type: sma Get Plugin or Get Source (zp_clase_oameni_zp.sma - 664 views - 35.7 KB)
RaZ_HU is offline
n3Oh112
Junior Member
Join Date: Dec 2017
Old 12-31-2017 , 14:09   Re: Help SMA
Reply With Quote #7

Quote:
Originally Posted by n3Oh112 View Post
Thank you verry much. Is working but i have another error...
Code:
L 12/31/2017 - 16:07:04: [ZP] Invalid Player (0)
L 12/31/2017 - 16:07:04: [AMXX] Displaying debug trace (plugin "16zombie.amxx", version "1.0.6")
L 12/31/2017 - 16:07:04: [AMXX] Run time error 10: native error (native "zp_get_user_zombie_class")
L 12/31/2017 - 16:07:04: [AMXX] [0] 16zombie.sma::zp_user_infected_post (line 63)
L 12/31/2017 - 16:07:04: [ZP] Invalid Player (0)
.sma
I need help for this... please guys.

Happy New Year
n3Oh112 is offline
Adomaz1
Senior Member
Join Date: Feb 2014
Old 01-01-2018 , 07:26   Re: Help SMA
Reply With Quote #8

Quote:
Originally Posted by n3Oh112 View Post
I need help for this... please guys.

Happy New Year
give the code or check if the user is connected with if(is_user_connected(id))
Adomaz1 is offline
n3Oh112
Junior Member
Join Date: Dec 2017
Old 01-01-2018 , 07:35   Re: Help SMA
Reply With Quote #9

Code:
public zp_user_infected_post(id, infector)
{
    if (zp_get_user_zombie_class(infector) == g_zclass_Predator)
    {
        set_pev(infector, pev_health, float(pev(infector, pev_health) + get_pcvar_num(cvar_infect_hp)))
        set_hudmessage(255, 0, 0, -1.0, 0.45, 0, 0.0, 3.0, 0.01, 0.01, -1)
        show_hudmessage(infector, "+%i HP!", get_pcvar_num(cvar_infect_hp))
    }
    
    if (zp_get_user_zombie_class(id) == g_zclass_Predator)
    {
        g_ability[id] = false
        set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 255)
        set_user_maxspeed(id, float(zclass_speed))
        set_user_gravity(id, zclass_gravity)
        
        if (!g_bind[id])
        {
            new menu[192]
            format(menu, 191, "Doresti Bind P Pentru A Folosi Abilitatea?^n^n1. Da^n2. Nu^n3. Sau Doriti Tasta +USE")
            show_menu(id, keys, menu)
        }
    }
}
n3Oh112 is offline
RaZ_HU
Senior Member
Join Date: May 2015
Location: Hungary
Old 01-01-2018 , 08:01   Re: Help SMA
Reply With Quote #10

Use a check like this...

PHP Code:
public zp_user_infected_post(idinfector)
{
    if(!
is_user_connected(id) || id == 0)
    {
        
log_amx"ERROR: %i is not a connected user."id);
        return
    }
... 

Last edited by RaZ_HU; 01-01-2018 at 08:01.
RaZ_HU 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 00:51.


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