Need Help about auto car respawn
#1

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
Reply
#2

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)
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)