Respawn vehicles (tuning problem) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Respawn vehicles (tuning problem) (
/showthread.php?tid=458339)
Respawn vehicles (tuning problem) -
martoivanov - 16.08.2013
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;
}
Re: Respawn vehicles (tuning problem) -
Pottus - 16.08.2013
You need to retune them in OnVehicleSpawn()
Re: Respawn vehicles (tuning problem) -
martoivanov - 16.08.2013
Thank you! It works! +1 Rep!!!