Respawn cars... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Respawn cars... (
/showthread.php?tid=249939)
Respawn cars... -
Vvolk - 21.04.2011
I have a problem, I want that then car is staying alone and nobody drive this car, car automaticaly respawns, but if I drive this car, car doesn't respawn but if I get out of the car she instantly respawn. How I can do that car respawns only then 10 minutes nobody drives this car but if somebody drive this car and then get out of the car, car respawns only after 10 minutes nobody drives this car
This my code:
Код:
AddStaticVehicleEx(413,-1766.41894531,-169.95703125,3.70468760,266.00000000,0,44,10);
I think there need to be SetTimer(...) and please correct my code or write here your own code.
I have one more problem, I want to do a work cars and only this work workers can drive this cars.How I can do that other peoples which not in this work can't drive this cars ant then they sit in the car them remove from car RemovePlayerFromCar(...)

Re: Respawn cars... -
Daddy Yankee - 21.04.2011
Код:
AddStaticVehicleEx(413,-1766.41894531,-169.95703125,3.70468760,266.00000000,0,44,10);
You made it to respawn in 10 seconds.. make that 600 for 10 minutes
Re: Respawn cars... -
Vvolk - 21.04.2011
Thank you for your support... Do you have another ideas for my second problem?
Re: Respawn cars... -
Stigg - 21.04.2011
Quote:
Originally Posted by Vvolk
Thank you for your support... Do you have another ideas for my second problem? 
|
Try something like:
pawn Код:
new WorkVehicle[10];//The number of work vehicles
WorkVehicle[0] = AddStaticVehicle(//whatever your wish);
WorkVehicle[1] = AddStaticVehicle(// whatever your wish);
WorkVehicle[2] = AddStaticVehicle(// whatever your wish);
//Ect...
//Use a loop here, then you can use:
if(vehicleid == WorkVehicle[i])
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is a work vehicle!");
}