I need help with timers!
#1

I am very new to pawn and i made this auto message script. It displays the first message over and over, when i want it to go message by message. Plz help!

pawn Код:
#define COLOR_BLUE                  0x1229FAFF
#define FILTERSCRIPT

#include <a_samp>

new Timer0;
new Timer1;
new Timer2;
new Timer3;
new Timer4;
new Timer5;
new Timer6;
new Timer7;
new Timer8;

forward a0(playerid);
forward a1(playerid);
forward a2(playerid);
forward a3(playerid);
forward a4(playerid);
forward a5(playerid);
forward a6(playerid);
forward a7(playerid);
forward a8(playerid);

public OnFilterScriptInit()
{
        print("\n-----------------------------------");
        print("ROKZLIVE AUTOMATIC MESSAGES                   ");
        print("-----------------------------------  ");
        print("by Rokzlive aka Whatcha        ");
        print("-----------------------------------\n");
        return 1;
}

public OnFilterScriptExit()
{
        return 1;
}

public a0(playerid)
{
    Timer0 = SetTimer("a0",150000,false);
    SendClientMessage(playerid, COLOR_BLUE, "Visit our website at www.Rokzlive.com!");
    return 1;
}
public a1(playerid)
{
    KillTimer(Timer0);
    Timer1 = SetTimer("a1",150000,false);
    SendClientMessage(playerid, COLOR_BLUE, "Visit our forum at Forum.Rokzlive.com!");
    return 1;
}
public a2(playerid)
{
    KillTimer(Timer1);
    Timer2 = SetTimer("a2",150000,false);
    SendClientMessage(playerid, COLOR_BLUE, "See a cheater or rule breaker? /report them to an administrator!");
    return 1;
}
public a3(playerid)
{
    KillTimer(Timer2);
    Timer0 = SetTimer("a3",150000,false);
    SendClientMessage(playerid, COLOR_BLUE, "Obey ALL speed limits!");
    return 1;
}
public a4(playerid)
{
    KillTimer(Timer3);
    Timer1 = SetTimer("a4",150000,false);
    SendClientMessage(playerid, COLOR_BLUE, "Dont DM! If you DM you will be warned or banned!");
    return 1;
}
public a5(playerid)
{
    KillTimer(Timer4);
    Timer2 = SetTimer("a5",150000,false);
    SendClientMessage(playerid, COLOR_BLUE, "Follow all rules to assure the best experience for all!");
    return 1;
}
public a6(playerid)
{
    KillTimer(Timer5);
    Timer0 = SetTimer("a6",150000,false);
    SendClientMessage(playerid, COLOR_BLUE, "Drive on the right side of the road!");
    return 1;
}
public a7(playerid)
{
    KillTimer(Timer6);
    Timer1 = SetTimer("a7",150000,false);
    SendClientMessage(playerid, COLOR_BLUE, "Drive and act as you would in real life!!");
    return 1;
}
public a8(playerid)
{
    KillTimer(Timer7);
    Timer2 = SetTimer("a8",150000,false);
    SendClientMessage(playerid, COLOR_BLUE, "Dont ask to be staff! It will make us less willing to hire you!");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp(cmdtext, "/auto", true) == 0 && IsPlayerAdmin(playerid))
    {
             Timer0 = SetTimer("a0",150000,false);
             KillTimer(Timer1);
             KillTimer(Timer2);
             KillTimer(Timer3);
             KillTimer(Timer4);
             KillTimer(Timer5);
             KillTimer(Timer6);
             KillTimer(Timer7);
             KillTimer(Timer8);
             SendClientMessage(playerid, COLOR_BLUE, "SYSTEM: Auto Messages Enabled");
             return true;
    }
        if(strcmp(cmdtext, "/unauto", true) == 0 && IsPlayerAdmin(playerid))
         {
             KillTimer(Timer0);
             KillTimer(Timer1);
             KillTimer(Timer2);
             KillTimer(Timer3);
             KillTimer(Timer4);
             KillTimer(Timer5);
             KillTimer(Timer6);
             KillTimer(Timer7);
             KillTimer(Timer8);
             SendClientMessage(playerid, COLOR_BLUE, "SYSTEM: Auto Messages Disabled");
             return true;
    }
        return 0;
}
Reply


Messages In This Thread
I need help with timers! - by Rokzlive - 02.12.2010, 21:34
Re: I need help with timers! - by Haydz - 02.12.2010, 21:48
Re: I need help with timers! - by Kitten - 02.12.2010, 21:56
Re: I need help with timers! - by Rokzlive - 02.12.2010, 22:01
Re: I need help with timers! - by PowerPC603 - 02.12.2010, 22:09
Re: I need help with timers! - by The_Moddler - 02.12.2010, 22:10

Forum Jump:


Users browsing this thread: 1 Guest(s)