A problem with SetTimerEx (again :|)
#1

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

Has anyone taken a look? Sorry but its bugging me now

*Ive just tried with OnPlayerSpawn, and that didnt work either.
Reply
#3

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

Try adding a print before your if-statement and in your if-statement to see if it is actually being called.
Reply
#5

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)