Help with this command. - 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: Help with this command. (
/showthread.php?tid=403063)
Help with this command. -
Magic_Time - 28.12.2012
I made this command.
When I do /jetpack, it gives me a jetpack and it says: Administrator %s has given a jetpack to %s
When I do it again, It says: This player already has a jetpack.
When I do it again, It says: This player already has a jetpack.
But it repeats again. Administrator %s has given a jetpack to %s.
Code:
PHP код:
new Jetpack[MAX_PLAYERS];
CMD:jetpack(playerid, params[])
{
new targetid; new string[256]; new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name));
if(sscanf(params,"u",targetid)) return SendClientMessage(playerid, COLOR_GOLD, "Usage: /jetpack [ID]");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid player id");
if(Jetpack[targetid] == 0)
{
format(string, sizeof(string),"Administrator %s has given a jetpack to %s", Name, PlayerName(targetid));
SendClientMessageToAll(COLOR_GOLD, string);
GivePlayerJetpack(targetid);//Taken from a stock
}
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
{
Jetpack[targetid] = 1;
}
if(Jetpack[targetid] == 1) return SendClientMessage(playerid, COLOR_RED, "This player already has a Jetpack");
return 1;
}
Re: Help with this command. -
aslan890 - 28.12.2012
https://sampforum.blast.hk/showthread.php?pid=2291458#pid2291458