SA-MP Forums Archive
How to give player -400 blood? - 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: How to give player -400 blood? (/showthread.php?tid=550889)



How to give player -400 blood? - Kruno88 - 15.12.2014

Like when player gets shot he looses blood.
Код:
	pInfo[playerid][pBlood];
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(amount >= 25)
    {
    //How do I give player - 400 blood?
    } else return 0;
    return 1;
}



Re: How to give player -400 blood? - Abagail - 15.12.2014

pInfo[playerid][pBlood] = pInfo[playerid][pBlood]-400 or pInfo[playerid][pBlood] =-400;


Re: How to give player -400 blood? - Kruno88 - 15.12.2014

Quote:
Originally Posted by Abagail
Посмотреть сообщение
pInfo[playerid][pBlood] = pInfo[playerid][pBlood]-400 or pInfo[playerid][pBlood] =-400;
Thanx!I thought of it but....


Re: How to give player -400 blood? - Kruno88 - 15.12.2014

Actualy it doesn't work it sets it to -400.Not give it -400.


Re: How to give player -400 blood? - Schneider - 15.12.2014

pawn Код:
pInfo[playerid][pBlood] -= 400;
These are usefull operators:


value = 100; Sets value to 100
value--; subracts 1 from value
value++; adds 1 to value
value -= 100; subtracts 100 from value
value += 100; adds 100 to value


Re: How to give player -400 blood? - Kruno88 - 15.12.2014

Quote:
Originally Posted by Schneider
Посмотреть сообщение
pawn Код:
pInfo[playerid][pBlood] -= 400;
Abagail inverted the - and =
Thank you dude.