/fixallvehicles or /repairallcars
#1

I want a command to repair all cars on the server . Sorry for my english. Thank's.
Reply
#2

you'd have to loop trough all vehicles

pawn Код:
YCMD:repairall(playerid,params[],help)
{
    if(help) return SendClientMessage(playerid,-1,"/repairall is used to repair every single vehicle on the server.");
    //maybe do some admin-condition here
    for(new i=0; i<MAX_VEHICLES; i++)
        RepairVehicle(i);
       
    SendClientMessageToAll(-1,"All vehicles have been repaired by an admin!");
}
instead of MAX_VEHICLES
you could also use

pawn Код:
stock GetMaxVehicles()
{
    new iCount;
    for(new i = 1; i < MAX_VEHICLES; ++i)
        if(GetVehicleModel(i)) iCount++;

    return iCount;
}
Reply
#3

Can make this command with if(strcmp ..) ??
Reply
#4

PHP код:
    if (strcmp("/repairall"cmdtexttrue9) == 0)
    {
        for(new 
i=0i<MAX_VEHICLESi++)
            
RepairVehicle(i);

        
SendClientMessageToAll(-1,"All vehicles have been repaired by an admin!");
        return 
1;
    } 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)