Simple Command
#1

How To make This Command ??

/respawnallcars - Respawn All Cars
Reply
#2

pawn Код:
CMD:respawnallcars(playerid,params[])
{
    for(new v = 0; v < MAX_VEHICLES; v++) //Start looping through vehicles
    {
        SetVehicleToRespawn(v); //Respawn each vehicle found.
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by ~Mapper™~
Посмотреть сообщение
pawn Код:
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 vehi = 0; vehi < MAX_VEHICLES; vehi++)
            {
                    if(!unwanted[vehi]) SetVehicleToRespawn(vehi);
                    if(CarInfo[vehi][tOwned] == 1 && CarInfo[vehi][tLicensePlate] != 0)
                    {
                        new plate[9];
                        strmid(plate, CarInfo[vehi][tLicensePlate], 0, strlen(CarInfo[vehi][tLicensePlate]), 255);
                        SetVehicleNumberPlate(vehi, plate);
                    }
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "Info: All unused cars respawned by %s.", sendername);
            SendClientMessageToAll(COLOR_LIGHTRED, string);
        }
        return 1;
    }
You're using some variables which isn't even created.
windrush just asked for the respawnallcars cmd.
The below code is what he want.

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
CMD:respawnallcars(playerid,params[])
{
    for(new v = 0; v < MAX_VEHICLES; v++) //Start looping through vehicles
    {
        SetVehicleToRespawn(v); //Respawn each vehicle found.
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)