Help with public OnPlayerCommandText(playerid, cmdtext[])
#1

Hi, i scripted a command for when people do /usecrack and have 2 crack they do an animation and smoke crack, but when they smoke crack its suppose to give them 20.0 armour everytime, but the armour only stays at 20%.

This is my Script:
if (strcmp("/usecrack", cmdtext, true, 10) == 0)
{
if(Crack[playerid] >= 2) { // if he has 2 grams of drug...

SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
Crack[playerid] -=2;
SmokingCrack[playerid] = 1;
SendClientMessage(playerid, -1, "You smoked 2 grams of crack! you lost 2 grams of crack");
SetPlayerArmour(playerid, 20.0);
}
else return SendClientMessage(playerid, COLOR_RED,"You Do Not Have Enough Crack!");
return 1;
Reply
#2

You need to set a timer for the desired time for when you want the armour to go up.
Reply
#3

i want it to go up everytime someone does the command /usecrack, how do i do this?
Reply
#4

pawn Код:
new Float:arm; GetPlayerArmour(playerid, arm);
SetPlayerArmour(playerid, arm + 20.0);
Reply
#5

Quote:
Originally Posted by admantis
Посмотреть сообщение
pawn Код:
new Float:arm; GetPlayerArmour(playerid, arm);
SetPlayerArmour(playerid, arm + 20.0);
Thank you so much, this worked!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)