SetTimer OnVehicleSpawn... - 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)
+--- Thread: SetTimer OnVehicleSpawn... (
/showthread.php?tid=396865)
SetTimer OnVehicleSpawn... -
NeroX98 - 02.12.2012
Hi Scripterzzzz
i've made spoiler save system (just to try)
I have everything (saving, dialogs etc...) but the problem is that spoiler shows after i enter vehicle (i want to show it when gamemode starts)
Here is the code:
Код:
public OnGameModeInit()
{
SetTimer("TuneTimer", 1000, false); // <- TIMER
}
Код:
public TuneTimer(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehID], MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehSpoiler]);
}
}
Timer only works when i enter vehicle... So when I enter spoiler will show, but i want spoiler to show when gamemode starts
(I tried under OnVehicleSpawn but then the spoiler isn't showing...)
THE PROBLEM: I want cars to spawn tuned when gamemode starts (with this code spoiler is added when player enter in that vehicle)
HELP !!!!!!!!!!
Re: SetTimer OnVehicleSpawn... -
[HK]Ryder[AN] - 02.12.2012
add it in onvehiclespawn and on gamemode init respawn all cars..
onvehiclespawn is called when the cars RESPAWN not when they spawn the first time.
Re: SetTimer OnVehicleSpawn... -
NeroX98 - 02.12.2012
OH MY GOD MAAAAAAAN!
If you were next to me i would KISS YOU

You are lifesaver.
THANKS.
REP +