Adding Armour/Health Points - 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: Adding Armour/Health Points (
/showthread.php?tid=320760)
Adding Armour/Health Points -
ryan39 - 24.02.2012
So I have a general store in my gamemode where I want people to be able to purchase a life vest or condoms for example and it gives you +5 armour or +3 armour. I was trying some things last night but I ended up giving me +5 the first time, and them it stayed at 5 armour even if I purchased it again, which is not exactly what I want.. Here is my script.
PHP код:
case 0:
{
{
SendClientMessage(playerid,0xFF9900AA,"You have bought condoms for $59!");
GivePlayerMoney(playerid,-59);
SetPlayerArmour(playerid,+5);
}
}
This is my first case in my selection, but it sets my armour to 5, then doesn't add any more after I buy it again...
If you could help, I would appreciate. By the way this is under OnDialogResponse.
Re: Adding Armour/Health Points -
Shadow_ - 24.02.2012
pawn Код:
case 0:
{
new Float:pArmour;
GetPlayerArmour(playerid, Float:pArmour);
SendClientMessage(playerid,0xFF9900AA,"You have bought condoms for $59!");
GivePlayerMoney(playerid, -59);
SetPlayerArmour(playerid, pArmour+5);
}
Re: Adding Armour/Health Points -
ryan39 - 24.02.2012
Works.... If I can do anything to thank you, let me know!
Sorry I cannot rep you
But thanks again!
Re: Adding Armour/Health Points -
Shadow_ - 24.02.2012
It's ok, if it didn't work then tell me and i'll try again. but it should.
+ rep ^