SA-MP Forums Archive
Function returning string crash pawncc - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Function returning string crash pawncc (/showthread.php?tid=181189)



Function returning string crash pawncc - ZecKo - 04.10.2010

Hi, I've this function :
Код:
_GetWeaponName(weaponid)
{
    if(weaponid > 54)
    {
        return "(unused)";//gWeaponName[52]
    }
    return gWeaponName[weaponid];
}
return "(unused)"; crash pawncc during compilation (pawncc don't say anything, I got an empty box), I must return a var. Why ?


Re: Function returning string crash pawncc - Rachael - 04.10.2010

Just add "unused" as weaponid 55 in your array, then if (weaponid > 54) weaponid = 55;


Re: Function returning string crash pawncc - ZecKo - 04.10.2010

I already do something like that, I'm asking why it crash pawncc.