AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run time error 3: stack error (https://forums.alliedmods.net/showthread.php?t=246360)

Kaju 08-16-2014 08:57

Run time error 3: stack error
 
Code:

L 08/15/2014 - 16:13:32: [AMXX] Displaying debug trace (plugin "QTM_CodMod.amxx")
L 08/15/2014 - 16:13:32: [AMXX] Run time error 3: stack error
L 08/15/2014 - 16:13:32: [AMXX]    [0] QTM_CodMod.sma::Item_Deploy_Post (line 1349)

Code:

public Item_Deploy_Post(ent)
{
        static id; id = get_pdata_cbase(ent, 41, 4);
        if(!is_user_alive(id))
                return;
       
        static team; team = get_user_team(id);
        if(team > 2)
                return;
       
        cs_get_weaponbox_type(ent);
       
        static bron; bron = cs_get_weapon_id(ent);
        if(!((1<<bron) & (bronie_klasy[klasa_gracza[id]] | bonusowe_bronie_gracza[id] | bronie_druzyny[team] | bronie_dozwolone)))
        {
                new weaponname[24];      //<========= line 1349
                get_weaponname(bron, weaponname, 23);
                engclient_cmd(id, "drop", weaponname);
        }
        if(cs_get_user_shield(id) && !gracz_ma_tarcze[id])
                engclient_cmd(id, "drop", "weapon_shield");
}


Black Rose 08-16-2014 09:46

Re: Run time error 3: stack error
 
Make it static/global instead of new and you're fine.


All times are GMT -4. The time now is 13:15.

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