SA-MP Forums Archive
Problem with code - 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: Problem with code (/showthread.php?tid=499226)



Problem with code - howtodo - 07.03.2014

The error:

PHP код:
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\filterscripts\Death_System.pwn(19 -- 20) : error 029invalid expressionassumed zero
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Error

The code:

PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define col_grey 0xADADADFF
#define COLOR_RED 0xAA3333AA
new bool:isplayerwell[MAX_PLAYERS];
public 
OnPlayerUpdate(playerid)
{
    new 
Float:health;
    
GetPlayerHealth(playeridhealth);
    if(
isplayerwell[playerid] == true && health <= 20)
    {
        
ApplyAnimation(playerid"CRACK""crckdeth2"4.010000);
        
isplayerwell[playerid] = false;
    }
    else(
isplayerwell[playerid] == false && health >= 30)
    {
        
ClearAnimations(playerid);
        
isplayerwell[playerid] = true;
    }
    return 
1;




Re: Problem with code - howtodo - 07.03.2014

?


Re: Problem with code - Dignity - 07.03.2014

What line is 19-20? Besides, it's only been 14 minutes. No need to bump that soon because the forum traffic has barely been increased.

EDIT: Could've just posted here instead of making a new topic. >.>


Re: Problem with code - r3ct - 07.03.2014

You need to just remove this chunk

else(isplayerwell[playerid] == false && health >= 30)
{
ClearAnimations(playerid);
isplayerwell[playerid] = true;
}

clearanimations in onplayerupdate wouldn't work well


Re: Problem with code - Konstantinos - 07.03.2014

Actually else goes without any expression. You should use else if instead.

pawn Код:
else if(isplayerwell[playerid] == false && health >= 30)
{
    ClearAnimations(playerid);
    isplayerwell[playerid] = true;
}



Re: Problem with code - dice7 - 07.03.2014

else if (isplayerwell[playerid] == false && health >= 30)
{
ClearAnimations(playerid);
isplayerwell[playerid] = true;
}


Re: Problem with code - iggy1 - 07.03.2014

EDIT: 2 min 2 slow.


Re: Problem with code - BoBiTzaa - 07.03.2014

Try this if(isplayerwell[playerid] == true && health < 21)