AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Debug Error in HLDS Console (https://forums.alliedmods.net/showthread.php?t=105619)

lordshiva 10-06-2009 13:20

Debug Error in HLDS Console
 
L 10/06/2009 - 22:49:06: Invalid player id 0
L 10/06/2009 - 22:49:06: [AMXX] Run time error 10 (plugin "match.amxx") (native "get_user_weapon") - debug not enabled!
L 10/06/2009 - 22:49:06: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

PHP Code:

public event_new_round() {
    if(
g_KnifeRound && !get_pcvar_num(kr_teamvote)) {
        
g_KnifeRound false
    
}
}

public 
cur_weapon() {
    if(
g_KnifeRound) {
        
engclient_cmd(0,"weapon_knife")
    }
}

public 
CmdRestartRound(idlevelcid) {
    if (!
cmd_access(idlevelcid1)) return PLUGIN_CONTINUE
    g_KnifeRound 
false
    server_cmd
("sv_restartround 1")
    return 
PLUGIN_CONTINUE
}

public 
CmdKnifeRound(id,level,cid) {    
    if(!
cmd_access(id,level,cid,1)) return PLUGIN_CONTINUE
    server_cmd
("sv_restartround 1")    
    
set_task(2.0"KnifeRoundStart"id)
    
ColorChat(0RED"[KR] Kniferound is started!")
    
ColorChat(0RED"[KR] Kniferound is started!"
   
    return 
PLUGIN_CONTINUE
}

public 
CmdSwapTeams(id,level,cid) {
    if(
cmd_access(id,level,cid,1)) {
        
g_KnifeRound false
        SwapTeams
()
    }
}

public 
KnifeRoundStart(id) {
    
g_KnifeRound true;
    for(new 
033i++)
    {
        new 
weapon get_user_weapon(id)
        if (
weapon != CSW_KNIFE && is_user_alive(i)) 
            
engclient_cmd(i"weapon_knife")
    }
public 
fwd_CmdStart_pre(iduc_handle) {
    if(
g_KnifeRound && get_pcvar_num(kr_noslash) == 1) {
    static 
button;
    
button get_uc(uc_handleUC_Buttons);
    if(
button IN_ATTACK)
    {
        
button &= ~IN_ATTACK;
        
button |= IN_ATTACK2;    
    }
    
set_uc(uc_handleUC_Buttonsbutton);
    return 
FMRES_SUPERCEDE;
    }
    return 
FMRES_IGNORED;


THERE IS DEBUGGING ERRORS IN CONSOLE OF HLDS CAN SOME1 CORRECT IT

SnoW 10-06-2009 13:23

Re: Debug Error in HLDS Console
 
You are calling native get_user_weapon with an index of 0 which isn't a player entity that the native would require. Also you haven't enabled the debug mode, which I believe would be pretty smart.

lordshiva 10-06-2009 13:24

Re: Debug Error in HLDS Console
 
Than can u plz correct my code

SnoW 10-06-2009 13:26

Re: Debug Error in HLDS Console
 
No. You have to enable the debug mode and read the line which you get. What is funny is that the line is the line in your code where the error is. Don't know how that's possible but...

lordshiva 10-06-2009 13:28

Re: Debug Error in HLDS Console
 
SNOW man how to enable Debugging and also plz CORRECT MY CODE if u know.........

lordshiva 10-06-2009 13:30

Re: Debug Error in HLDS Console
 
This is plugin which goes like this

whn amx_match is typed than players only get knife and r not allowed to buy any other weapons.........KNIFING ROUND

SnoW 10-06-2009 13:30

Re: Debug Error in HLDS Console
 
It's in here:
PHP Code:

KnifeRoundStart(id

You can debug by adding " debug" after the plugin name in plugins.ini.
Code:

match.amxx debug

lordshiva 10-06-2009 13:38

Re: Debug Error in HLDS Console
 
What i ve to edit to Run plugin without Debugging

SnoW 10-06-2009 13:46

Re: Debug Error in HLDS Console
 
Quote:

Originally Posted by lordshiva (Post 954141)
What i ve to edit to Run plugin without Debugging

Remove the "debug"?

lordshiva 10-07-2009 00:50

Re: Debug Error in HLDS Console
 
EXOLENT[NJR] Can u correct my above codeee


All times are GMT -4. The time now is 22:42.

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