Help with this command.
#1

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(playeridparams[])
{
    new 
targetid;    new string[256]; new Name[MAX_PLAYER_NAME]; GetPlayerName(playeridNamesizeof(Name));
    if(
sscanf(params,"u",targetid)) return SendClientMessage(playeridCOLOR_GOLD"Usage: /jetpack [ID]");
    if(
targetid == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_RED"ERROR: Invalid player id");
    if(
Jetpack[targetid] == 0)
     {
        
format(stringsizeof(string),"Administrator %s has given a jetpack to %s"NamePlayerName(targetid));
        
SendClientMessageToAll(COLOR_GOLDstring);
        
GivePlayerJetpack(targetid);//Taken from a stock
        
}
       if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
        {
        
Jetpack[targetid] = 1;
         }
         if(
Jetpack[targetid] == 1) return SendClientMessage(playeridCOLOR_RED"This player already has a Jetpack");
    return 
1;

Reply
#2

https://sampforum.blast.hk/showthread.php?pid=2291458#pid2291458
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)