Timer help - 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: Timer help (
/showthread.php?tid=519832)
Timer help -
Tuntun - 16.06.2014
My codes:
pawn Код:
#include <a_samp>
//#if defined FILTERSCRIPT
new ferryI;
new ferry;
new FerryObject[30];
#define grey 0xB4B4B4FF
#define yellow 0xF5FF00FF
forward LOLS(playerid);
forward LOLIS(playerid);
public OnFilterScriptInit()
{
SetTimer("FerryIS", 240000, true);
MY CODES
SendClientMessageToAll(0xFF000000, "{FF8000}The ferry is going to Island");
return 1;
}
public LOLIS(playerid)
{
if(LOLI == 1)
{
SendClientMessage(playerid, 0xFF000000, "** Ferry docked to island!");
return 1;
}
MY LINES
SendClientMessage(playerid, 0xFF000000,"{FF8000}The ferry is moving back to Los Santos.");
SetTimer("FerryLS", 120000, 0);
return 0;
}
public LOLIS(playerid)
{
MoveObject(ferry,MY COORDS);
PlayerPlaySound(playerid, 1153, 2650.21191, -2291.62915, -0.03891);
ferryI = 0;
return 1;
}
My problem is : I only get the "The ferry is moving back to los santos". but it should give the " the ferry is going to island" too.
I want something like : after staying 2 min in dock it will say: "The ferry is going to Island" and will go.
stay 2 min in per dock.
Re: Timer help -
Laure - 16.06.2014
Can i see the public of FerryLS? somethings to be done there.
Re: Timer help -
superrobot48 - 16.06.2014
The problem that it does not show SendClientMessageToAll(0xFF000000, "{FF8000}The ferry is going to Island"); is becuase "OnFilterScriptint" is called when the FS loads and the message is shown to players in the server while the FS loads
Re: Timer help -
iOxide - 16.06.2014
You need to send the message when it starts to move from island. And the function to move ferry from island is
So you should add the message inside this function and not in OnFilterScriptInit. About the ferry waiting timer "2 minutes" it depends on how far is your island from LS and you need to set the timer by measuring the distance between LS and island.