Respawn vehicles (tuning problem)
#1

I made private cars for my server from this tutorial https://sampforum.blast.hk/showthread.php?tid=283929
When I respawn all cars (/respawnallcars) , the tuning disappears. Can someone help me with this problem?

pawn Код:
if(strcmp(cmd, "/respawnallcars", true) == 0) {
if(pInfo[playerid][Adminlevel] > 0)
{
    new bool:vehicleused[MAX_VEHICLES];
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            vehicleused[GetPlayerVehicleID(i)] = true;
        }
    }
    for(new i=1; i < MAX_VEHICLES; i++)
    {
        if(!vehicleused[i])
        {
            SetVehicleToRespawn(i);
        }
    }
    SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Respawned!");
    SendClientMessageToAll(COLOR_LIGHT_GREEN, "All vehicles respawned!");
}
return 1;
}
Reply
#2

You need to retune them in OnVehicleSpawn()
Reply
#3

Thank you! It works! +1 Rep!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)