SA-MP Forums Archive
Odd Error. - 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)
+--- Thread: Odd Error. (/showthread.php?tid=575745)



Odd Error. - iSaint - 29.05.2015

I'm getting this weird error:
pawn Код:
error 029: invalid expression, assumed zero
This is the whole code around that line:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if((0 <= weaponid <= 46 || weaponid == 54)
    { //This is the line the error's on.
        if(BODY_PART_TORSO <= bodypart <= BODY_PART_HEAD) Damage[playerid][(bodypart - 3)][weaponid]++;
    }
    if (PlayerData[playerid][pFirstAid])
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "[WARNING]:{FFFFFF} Your first aid kit is no longer in effect as you took damage.");

        PlayerData[playerid][pFirstAid] = 0;
        KillTimer(PlayerData[playerid][pAidTimer]);
    }
    if(actmarker[issuerid] >= 1)
    {
        TextDrawShowForPlayer(issuerid, HitMarker);
        timarker = SetTimerEx("HTD", 250, true, "%d", issuerid);
        PlayerPlaySound(issuerid, 1057, 0, 0, 0);
    }
    return 1;
}
I honestly don't see what's wrong.


Re: Odd Error. - PT - 29.05.2015

Have to many (

look:

if((0 <= weaponid <= 46 || weaponid == 54)


Re: Odd Error. - iSaint - 29.05.2015

Quote:
Originally Posted by PT
Посмотреть сообщение
Have to many (

look:

if((0 <= weaponid <= 46 || weaponid == 54)
Oh wow! Thank you so much, such a silly error. xD +REP!