Will this work?
#1

Код:
CMD:respawncars(playerid, params[]) {
	if(playerVariables[playerid][pAdminLevel] >= 4) {
       	if(!IsPlayerInAnyVehicle(playerid)) return 0;
       	else
 		{
		SetAllVehiclesToRespawn();
		SendClientMessage(playerid, COLOR_WHITE, "All vehicles have been respawned.");
		}
	}
	return 1;
}
Reply
#2

Why would you ask if it works, wait for a response from someone who is going to look at it and make an assumption on whether or not it works by guessing what you want it to do etc.

Why not just go test it yourself and get a result in seconds?
Reply
#3

Just to point out, the command is set to check if the player using the command is in a car, totally excluding the other players on the server.
Reply
#4

Ok well i want the command to respawn all unocupied vehicles and leave the ones what have players in.
Reply
#5

Код:
CMD:respawnallcars(playerid, params[])
{
    new sendername[30];
	if(playerVariables[playerid][pAdminLevel] >= 4)
	{
    for(new car = 0; car <= 268; car++)
    if((IsVehicleEmpty(car) && !IsTrailerAttachedToVehicle(car) && GetVehicleModel(car) !=435 && GetVehicleModel(car) !=450 && GetVehicleModel(car) !=584 && GetVehicleModel(car) !=591) || (IsVehicleEmpty(car) && IsTrailerAttachedToVehicle(car) !=GetVehicleTrailer(car)))
    {
        SetVehicleToRespawn(car);
    }
    GetPlayerName(playerid,sendername,sizeof(sendername));
    SendClientMessage(playerid, COLOR_WHITE, "All vehicles have been respawned.");
	}
	else SendClientMessage(playerid, COLOR_RED, "Command not found! Type /cmds to see a list of available commands.");
 	return 1;
}
Reply
#6

error 017: undefined symbol "IsVehicleEmpty"
Reply
#7

Quote:
Originally Posted by a!DaN)_)-)
Посмотреть сообщение
error 017: undefined symbol "IsVehicleEmpty"
Код:
stock IsVehicleEmpty(vehicleid)
{
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if(IsPlayerInVehicle(i, vehicleid)) return 0;
        }
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)