Help with public OnPlayerCommandText(playerid, cmdtext[]) - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with public OnPlayerCommandText(playerid, cmdtext[]) (
/showthread.php?tid=241382)
Help with public OnPlayerCommandText(playerid, cmdtext[]) -
abrantley - 17.03.2011
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;
Re: Help with public OnPlayerCommandText(playerid, cmdtext[]) -
grand.Theft.Otto - 17.03.2011
You need to set a timer for the desired time for when you want the armour to go up.
Re: Help with public OnPlayerCommandText(playerid, cmdtext[]) -
abrantley - 17.03.2011
i want it to go up everytime someone does the command /usecrack, how do i do this?
Re: Help with public OnPlayerCommandText(playerid, cmdtext[]) -
admantis - 17.03.2011
pawn Код:
new Float:arm; GetPlayerArmour(playerid, arm);
SetPlayerArmour(playerid, arm + 20.0);
Re: Help with public OnPlayerCommandText(playerid, cmdtext[]) -
abrantley - 17.03.2011
Quote:
Originally Posted by admantis
pawn Код:
new Float:arm; GetPlayerArmour(playerid, arm); SetPlayerArmour(playerid, arm + 20.0);
|
Thank you so much, this worked!