How can I put a timer on respawning a vehicle
#1

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

Reply to me please, this is important
Reply
#3

Help me please please.
Reply
#4

Please help me.
Reply
#5

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

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

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?

Reply
#8

https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
Reply
#9

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)