Adding Armour/Health Points
#1

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.
Reply
#2

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);
            }
Reply
#3

Works.... If I can do anything to thank you, let me know!

Sorry I cannot rep you

But thanks again!
Reply
#4

It's ok, if it didn't work then tell me and i'll try again. but it should.

+ rep ^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)