AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Runtime Error (assistance needed) (https://forums.alliedmods.net/showthread.php?t=152652)

makiza 03-12-2011 12:15

Runtime Error (assistance needed)
 
hello there...

Well, while i'm running this plugin fails and comes out this:
Quote:

L 03/12/2011 - 10:24:13: [AMXX] Run time error 4 (plugin "zombie_plague40.amxx") - debug not enabled!
L 03/12/2011 - 10:24:13: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 03/12/2011 - 10:24:13: Unhandled dynamic native error
L 03/12/2011 - 10:24:13: [AMXX] Displaying debug trace (plugin "ZP_EMP.amxx")
L 03/12/2011 - 10:24:13: [AMXX] Run time error 10: native error (native "zp_get_user_zombie")
L 03/12/2011 - 10:24:13: [AMXX] [0] ZP_EMP.sma::emp_start (line 70)
this is the part of the code where the error is:
PHP Code:

public emp_start(id)
{       
    if(
zp_get_user_zombie(id))
        return 
PLUGIN_HANDLED;
    
    
server_cmd("mp_flashlight 0")
    
server_cmd("zp_triggered_lights 0")
    
server_cmd("zp_nvg_hum_color_R 0")
    
server_cmd("zp_nvg_hum_color_G 0")
    
server_cmd("zp_nvg_hum_color_B 0")
    
server_cmd("zp_flare_duration 0")
    
server_cmd("zp_flare_size 0")   
    
server_cmd("zp_lighting a")
    
client_cmd(0"hud_draw 0")
    
server_cmd("sv_voiceenable 0")
    
client_cmd(0"crosshair 0")
    
client_cmd(0"spk sound/weapons/c4_explode1.wav");
    
client_cmd(0"spk sound/fvox/hev_shutdown.wav");
    
set_task(30.0"emp_end"TASK_EMP);
    return 
PLUGIN_CONTINUE;


can you help me with this, and post a link where i can learn how to make conditionals (if, else ,else if) and how to return some data (PLUGIN_HANDLED/CONTINUE) properly?

thanks in advance

schmurgel1983 03-12-2011 12:43

Re: Runtime Error (assistance needed)
 
Run time error 10: It means the player is not more connected when the command is executed. You would need to check if user is connected.

Exolent[jNr] 03-12-2011 14:53

Re: Runtime Error (assistance needed)
 
Quote:

Originally Posted by schmurgel1983 (Post 1432116)
Run time error 10: It means the player is not more connected when the command is executed. You would need to check if user is connected.

The error says nothing about an invalid player.
The unhandled dynamic native error is something in the zp_get_user_zombie() code that is breaking it.

makiza 03-12-2011 15:05

Re: Runtime Error (assistance needed)
 
PHP Code:

if((zp_get_user_zombie(id) && is_user_connected(id)))
        return 
PLUGIN_HANDLED

The same result.

Quote:

Originally Posted by Exolent[jNr] (Post 1432186)
The error says nothing about an invalid player.
The unhandled dynamic native error is something in the zp_get_user_zombie() code that is breaking it.

how can be possible since that is the only function that uses zp_get_user_zombie() native?

Exolent[jNr] 03-12-2011 15:47

Re: Runtime Error (assistance needed)
 
Quote:

Originally Posted by makiza (Post 1432190)
how can be possible since that is the only function that uses zp_get_user_zombie() native?

It's not your code. There's something wrong in that functions code, not your call to it.

makiza 03-12-2011 17:08

Re: Runtime Error (assistance needed)
 
Okay, i tried this:
PHP Code:

public emp_start(id)
{           
    switch( 
get_user_team(id) )
    {
        case 
1:
        {
            
server_cmd("mp_flashlight 1")
            
server_cmd("zp_triggered_lights 1")
            
server_cmd("zp_nvg_hum_color_R 100")
            
server_cmd("zp_nvg_hum_color_G 100")
            
server_cmd("zp_nvg_hum_color_B 100")
            
server_cmd("zp_flare_duration 60")
            
server_cmd("zp_flare_size 25")
            
server_cmd("zp_lighting b")
            
client_cmd(0"hud_draw 1")
            
server_cmd("sv_voiceenable 1")
            
client_cmd(0"crosshair 1")
        }
        case 
2:
        {
            
server_cmd("mp_flashlight 0")
            
server_cmd("zp_triggered_lights 0")
            
server_cmd("zp_nvg_hum_color_R 0")
            
server_cmd("zp_nvg_hum_color_G 0")
            
server_cmd("zp_nvg_hum_color_B 0")
            
server_cmd("zp_flare_duration 0")
            
server_cmd("zp_flare_size 0")   
            
server_cmd("zp_lighting a")
            
client_cmd(0"hud_draw 0")
            
server_cmd("sv_voiceenable 0")
            
client_cmd(0"crosshair 0")
            
client_cmd(0"spk sound/weapons/c4_explode1.wav");
            
client_cmd(0"spk sound/fvox/hev_shutdown.wav");
            
//set_task(30.0, "emp_end", TASK_EMP);
        
}
    }  
    
set_task(30.0"emp_end"TASK_EMP); 

but only the task makes effect? what could be wrong with this?

schmurgel1983 03-13-2011 01:57

Re: Runtime Error (assistance needed)
 
what is TASK_EMP?


All times are GMT -4. The time now is 14:36.

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