Respawn Cars is partly not working - 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 Cars is partly not working (
/showthread.php?tid=409000)
Respawn Cars is partly not working -
Neil. - 20.01.2013
pawn Код:
COMMAND:rc(playerid, params[])
{
for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
{
for (new CarSlot; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
SetVehicleToRespawn(AHouseData[HouseID][VehicleIDs][CarSlot]);
SendClientMessage(playerid, 0xFFFFFFFF, "Vehicles has been respawned");
return 1;
}
}
return 1;
}
Lemme explain:
1. Players own 2 houses (1 vehicle slots each)
2. Players buys a vehicle in the 1st house
3. Player buys a vehicle in the 2nd house
4. Player /parks the vehicle
5. Player uses /rc or respawncars
6. It only respawns the vehicles on the 1st house not the 2nd one
Re: Respawn Cars is partly not working -
Niko_boy - 20.01.2013
remove
return 1 line as it will stop the loop on first occurance and add
sendclientmessage out side the loop
Re: Respawn Cars is partly not working -
Neil. - 20.01.2013
Works like a charm

Thanks!