SA-MP Forums Archive
How can I put a timer on respawning a vehicle - 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: How can I put a timer on respawning a vehicle (/showthread.php?tid=154777)



How can I put a timer on respawning a vehicle - ||123|| - 15.06.2010

I want to put a timer on respawning a vehicle, like I input a command in a vehicle and then the vehicle gets vanished right at the moment I input the command and after the setted time, it gets respawned.


Re: How can I put a timer on respawning a vehicle - ||123|| - 15.06.2010

Reply to me please, this is important


Re: How can I put a timer on respawning a vehicle - ||123|| - 15.06.2010

Help me please please.


Re: How can I put a timer on respawning a vehicle - ||123|| - 15.06.2010

Please help me.


Re: How can I put a timer on respawning a vehicle - Kayaque - 15.06.2010

3 bumps in a day. Read the rules. You should be banned already. Geez.


Re: How can I put a timer on respawning a vehicle - Flashy - 15.06.2010

Stop to post without someone other post -.-
Use the search button or just wait.
No onw will answer you if you keep doppel-, tripplepost.


Re: How can I put a timer on respawning a vehicle - Ihsan_Cingisiz - 15.06.2010

Quote:
Originally Posted by ||123||
Please help me.
Uh.. Maybe you can load the cars in a filterscript and then make a command
that the server unloads it...
Example :

At the top of your script.
Quote:

forward ReloadCars();

Quote:

In OnGameModeInit()
SetTimer("ReloadCars", 60000, 1);

somewhere in you .pwn file
Quote:

public ReloadCars();
{
SendRconCommand("unloadfs");
SendRconCommand("loadfs");
}

Something like this?




Re: How can I put a timer on respawning a vehicle - Jonny_lockhart - 15.06.2010

https://sampwiki.blast.hk/wiki/AddStaticVehicleEx


Re: How can I put a timer on respawning a vehicle - ||123|| - 15.06.2010

Quote:
Originally Posted by Ihsan_Cingisiz
Quote:
Originally Posted by ||123||
Please help me.
Uh.. Maybe you can load the cars in a filterscript and then make a command
that the server unloads it...
Example :

At the top of your script.
Quote:

forward ReloadCars();

Quote:

In OnGameModeInit()
SetTimer("ReloadCars", 60000, 1);

somewhere in you .pwn file
Quote:

public ReloadCars();
{
SendRconCommand("unloadfs");
SendRconCommand("loadfs");
}

Something like this?

No that, after the given time, the cars get respawned. Like when i use the command, it destroys my car, and then respawns it after 5 minutes.


Re: How can I put a timer on respawning a vehicle - DJDhan - 15.06.2010

Put this at the top somewhere.
Код:
new cardestroytimer;
Then under OnPlayeCommandText(playerid,cmdtext[])
Код:
if(!strcmp(cmdtext,"/destroyvehicle",true,15)
{
  if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xffffffaa,"This command can only be used in a vehicle");
  new veh=GetPlayerVehicleID(playerid);
  cardestroyertimer=SetTimerEx("destroycar", 300000,0,"d",veh);
  return 1;
}
Then anywhere in the script

Код:
forward destroycar(vehicleid);
public destroycar(vehicleid)
{
  SetVehicleToRespawn(veh);
  return 1;
}