A problem with SetTimerEx (again :|) - 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: A problem with SetTimerEx (again :|) (
/showthread.php?tid=162771)
A problem with SetTimerEx (again :|) -
Ash. - 24.07.2010
Hi, again.
Im having a few problems with SetTimerEx (i think), It fails to run the timer even though it is set on repeat and is for "playerid"
Here is the problematic script:
http://pawn.pastebin.com/Xj8MSSL5
*Note: In another script i have delared everything to do with the checkpoint.
Could somebody take a look?
Thanks
Ash
Re: A problem with SetTimerEx (again :|) -
Ash. - 24.07.2010
Has anyone taken a look? Sorry but its bugging me now
*Ive just tried with OnPlayerSpawn, and that didnt work either.
Re: A problem with SetTimerEx (again :|) -
Grim_ - 24.07.2010
What's the problem, is that function now being called? If that's the case debug the script by using print() after each line and see where the code stops.
Also, with this:
pawn Код:
if (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 591)
Make sure all of that information is correct when the function is called.
Re: A problem with SetTimerEx (again :|) -
Vince - 24.07.2010
Try adding a print
before your if-statement and
in your if-statement to see if it is actually being called.
Re: A problem with SetTimerEx (again :|) -
DJDhan - 24.07.2010
It's probably because you are not returning 1 at the end of the function "HiddenTrailerMissions".
EDIT: I am guessing you want to detect if the vehicle the player is in is one of the hidden trailers.
Instead of running a timer, you can use OnPlayerEnterVehicle callback like so:
Код:
public OnPlayerEnterVehicle(playerid,vehicleid)
{
if(GetVehicleModel(GetVehicleTrailer(vehicleid)) == 591)
{
SetPlayerCheckpoint(playerid, -1073.4313, -1306.4890, 129.2188, 15);
SendClientMessage(playerid, HIDDEN, "You have found a hidden trailer!");
SendClientMessage(playerid, HIDDEN, "Deliver it to 'The Den'");
}
return 1;
}
Re: A problem with SetTimerEx (again :|) -
Ash. - 25.07.2010
Quote:
Originally Posted by DJDhan
It's probably because you are not returning 1 at the end of the function "HiddenTrailerMissions".
EDIT: I am guessing you want to detect if the vehicle the player is in is one of the hidden trailers.
Instead of running a timer, you can use OnPlayerEnterVehicle callback like so:
Код:
public OnPlayerEnterVehicle(playerid,vehicleid)
{
if(GetVehicleModel(GetVehicleTrailer(vehicleid)) == 591)
{
SetPlayerCheckpoint(playerid, -1073.4313, -1306.4890, 129.2188, 15);
SendClientMessage(playerid, HIDDEN, "You have found a hidden trailer!");
SendClientMessage(playerid, HIDDEN, "Deliver it to 'The Den'");
}
return 1;
}
|
Hmm thanks? But, there are 25 "hidden" trailers scattered round my map, and a truck would be driven to find them, so i need the timer to check (every 5 seconds) whether the trailer has connected, but when the timer has found the trailer connected, it needs to stop running.
Thanks
Ash