Need help with a /rac command
#1

Hi.I have a /rac command:
pawn Код:
COMMAND:rac(playerid, params[])
{
    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/rac", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
        // Check if the player's admin-level is at least 1
    if(APlayerData[playerid][PlayerLevel] >= 4)
    {
        for (new i = 1; i < MAX_VEHICLES; i++)
        {
            if(IsVehicleOccupied(i) == 0)   SetVehicleToRespawn(i);
        }
    }
    return 1;
}
This command working,but respawn my used trailers.How to add to stop respawn used trailers?Thanks for help
Reply
#2

pawn Код:
COMMAND:rac(playerid, params[])
{
    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/rac", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
        // Check if the player's admin-level is at least 1
    if(APlayerData[playerid][PlayerLevel] >= 4)
    {
        for (new i = 1; i < MAX_VEHICLES; i++)
        {
            if(IsVehicleOccupied(i) == 0 && GetVehcileModel(i) != insert model id of trailer here)   SetVehicleToRespawn(i);
        }
    }
    return 1;
}

??
Reply
#3

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
pawn Код:
COMMAND:rac(playerid, params[])
{
    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/rac", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
        // Check if the player's admin-level is at least 1
    if(APlayerData[playerid][PlayerLevel] >= 4)
    {
        for (new i = 1; i < MAX_VEHICLES; i++)
        {
            if(IsVehicleOccupied(i) == 0 && GetVehcileModel(i) != insert model id of trailer here)   SetVehicleToRespawn(i);
        }
    }
    return 1;
}

??
This doesn't working,i have a error and this command respawn my occupied cars.
Reply
#4

try this

pawn Код:
CMD:rac(playerid, params[], help)
{
    if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,red,error);
    new
        string[128];
    for(new car = 0; car<MAX_CARS;car++) {
    VehicleHaveDriver(car);
    SetVehicleToRespawn(car); }
    format(string,sizeof(string),""COL_ORANGE"Admin "COL_WHITE"%s "COL_RED"has respawn all cars.",GetPName(playerid));
    SendClientMessageToAll(-1,string);
    return 1;
}
stock VehicleHaveDriver(car)
{
        foreach(Player, i)
        {
        if(IsPlayerInVehicle(i, car)) return 1;
        }
        return 1;
}
this is from my gamemode
Reply
#5

Quote:
Originally Posted by ArchLord
Посмотреть сообщение
This doesn't working,i have a error and this command respawn my occupied cars.
What error?
Reply
#6

Did you compile with this in the command? If you did, you have to edit it...
pawn Код:
insert model id of trailer here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)