[Command Bugged] Each time i use /respawnallcars it says Unknown Command
#4

Quote:
Originally Posted by Fedee!
[pawn]
pawn Code:
if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(PlayerInfo[playerid][pAdmin] < 3)
            {
              SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");
              return 1;
            }
            else
            new bool:unwanted[CAR_AMOUNT];
            for(new player=0; player<MAX_PLAYERS; player++)
        {
        if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
        }
            for(new car = 1; car <= 268; car++)
            {
                if(!unwanted[car]) SetVehicleToRespawn(car);
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "SERVER: All unused cars respawned by %s.", sendername);
            BroadCast(COLOR_WHITE,string);
        }
        return 1;
    }
Try that
I tried that, and..
pawn Code:
C:\Users\*\Desktop\Universal RP\Universal RP\gamemodes\*.pwn(12866) : error 003: declaration of a local variable must appear in a compound block
C:\Users\*\Desktop\Universal RP\Universal RP\gamemodes\*.pwn(12866) : warning 221: label name "bool" shadows tag name
C:\Users\*\Desktop\Universal RP\Universal RP\gamemodes\*.pwn(12866) : error 017: undefined symbol "unwanted"
C:\Users\*\Desktop\Universal RP\Universal RP\gamemodes\*.pwn(12866) : warning 215: expression has no effect
C:\Users\*\Desktop\Universal RP\Universal RP\gamemodes\*.pwn(12866) : error 001: expected token: ";", but found "]"
C:\Users\*\Desktop\Universal RP\Universal RP\gamemodes\*.pwn(12866) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
NOTE: I didn't look at the errors to fix them.


Quote:
Originally Posted by wafffllesss
Can't find the error but, why are you checking if the player is online? can he make a command offline?
In the gamemode it's based as if he is logged in or not.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)