Timer help
#1

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

Can i see the public of FerryLS? somethings to be done there.
Reply
#3

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

You need to send the message when it starts to move from island. And the function to move ferry from island is
pawn Код:
public LOLIS(playerid)
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)