Help Please: Server Unknown Commands
#1

For a while it gives me error Server Unknown command, without knowing why this error gives me the commands I went in front on / respawnallcars, go and have to give restart the server, but after a while and I this error occurs. Maybe I could help, Thanks
Reply
#2

i dont really understand you..

you should make a command before using it o.O
Reply
#3

When I / respawnallcars gives me this error "SERVER: Unknown command", but i have command in GM (/respawnallcars), to recover should give restart, but after a while and gives me this error!
Reply
#4

Are you using dcmd? If yes, the problem is wrong characters command number (happened if number is wrong).
Reply
#5

That command

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;
            }
            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 <= 207; 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;
    }
Reply
#6

Try using that:
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;
		}
		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 <= 207; 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;
}
Reply
#7

You can also get that error, if array is out of bounds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)