Need Help about auto car respawn - 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: Need Help about auto car respawn (
/showthread.php?tid=154894)
Need Help about auto car respawn -
xinix000 - 16.06.2010
How to make when before car respwan 5 second sendmessagetoall
"The car will respawn in 5 second" and 4 second sendmessagetoall
"The car will respawn in 4 second" until 1 and all car will respawn
I already have auto car respawn but I want it to send message so everybody
Will know when the car will respawn
Thks for all answer
Re: Need Help about auto car respawn -
abhinavdabral - 16.06.2010
Then why are you waiting? Just put the code of Sending message to all under
OnVehicleSpawn Callback
with w/e string you want (You can also chnage the Car's vehicleid to its name, this will be pretty good in that)
Regards,
Abhinav (ALIAS: CODE WAVE)
Re: Need Help about auto car respawn -
DJDhan - 16.06.2010
Put this at the top
Код:
new timer;
new seconds;
Under wherever you want to sart the car respawn coutdown
Код:
new veh=GetPlayerVehicleID(playerid);
seconds=5;
SetTimerEx("carrespawn",1000,1,"d",veh);
Then we define the function:
Код:
forward carrespawn(vehicleid);
public carrespawn(vehicleid)
{
if(seconds==5)
{
seconds--;
return SendClientMessageToAll(0xffffffaa,"Car Respawning in 5 Seconds");
}
if(seconds==4)
{
seconds--;
return SendClientMessageToAll(0xffffffaa,"Car Respawning in 4 Seconds");
}
if(seconds==3)
{
seconds--;
return SendClientMessageToAll(0xffffffaa,"Car Respawning in 3 Seconds");
}
if(seconds==2)
{
seconds--;
return SendClientMessageToAll(0xffffffaa,"Car Respawning in 2 Seconds");
}
if(seconds==1)
{
seconds--;
return SendClientMessageToAll(0xffffffaa,"Car Respawning in 1 Second");
}
if(seconds==0)
{
SetVehicleToRespawn(veh);
return SendClientMessageToAll(0xffffffaa,"Car Respawned");
}
return 1;
}
That's just the basic way of doing it.