SetTimer problem?
#9

Quote:
Originally Posted by G4M3Ov3r
View Post
You showed us what you had OnGameModeInit, Keep the printf you had under it.
I didn't have printf under OnGameModeInIt()

I had it under a callback. Here's what my script looks like:
pawn Code:
new GameMinutes = 14;
new GameSeconds = 59;
new Text:Timer;

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Call Of Duty: 5");
   
    AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); //Swats
    AddPlayerClass(286, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);//FBIs
   
    AddPlayerClass(104, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);//Ballas
    AddPlayerClass(106, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);//Groves
    AddPlayerClass(109, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);//Vagos
    AddPlayerClass(124, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);//Mafia
   
    Timer = TextDrawCreate(86.000000,427.000000,"15:00");
    TextDrawAlignment(Timer,2);
    TextDrawBackgroundColor(Timer,0x000000ff);
    TextDrawFont(Timer,3);
    TextDrawLetterSize(Timer,0.499999,2.000000);
    TextDrawColor(Timer,0xffffffff);
    TextDrawSetOutline(Timer,1);
    TextDrawSetProportional(Timer,1);
    TextDrawSetShadow(Timer,1);

    SetTimer("Timers",1000,true);
    return 1;
}

forward Timers();
public Timers()
{
    printf("testing...");
    if(GameMinutes > 0 || GameSeconds > 0)
    {
        GameSeconds--;
        if(GameSeconds == -1)
        {
            GameMinutes--;
            GameSeconds = 59;
        }
    }
    if(GameMinutes == 0 && GameSeconds == 0)
    {
        OnGameModeExit();
    }
    new tmpstr[50]; //Accommodate for string size
    format(tmpstr,sizeof(tmpstr),"%02d:%02d",GameMinutes,GameSeconds);
    TextDrawSetString(Timer,tmpstr);
    return 1;
}
The SetTimer function doesn't work though
Reply


Messages In This Thread
SetTimer problem? - by Tigerbeast11 - 24.08.2011, 12:53
Re: SetTimer problem? - by SmileyForCheat - 24.08.2011, 13:08
Re: SetTimer problem? - by iMonk3y - 24.08.2011, 13:11
Re: SetTimer problem? - by =WoR=G4M3Ov3r - 24.08.2011, 13:15
Re: SetTimer problem? - by Tigerbeast11 - 24.08.2011, 14:05
Re: SetTimer problem? - by =WoR=G4M3Ov3r - 24.08.2011, 14:11
Re: SetTimer problem? - by Tigerbeast11 - 24.08.2011, 14:14
Re: SetTimer problem? - by =WoR=G4M3Ov3r - 24.08.2011, 14:18
Re: SetTimer problem? - by Tigerbeast11 - 24.08.2011, 14:19
Re: SetTimer problem? - by =WoR=G4M3Ov3r - 24.08.2011, 14:24
Re: SetTimer problem? - by =WoR=Varth - 24.08.2011, 14:24
Re: SetTimer problem? - by Tigerbeast11 - 24.08.2011, 14:29
Re: SetTimer problem? - by =WoR=G4M3Ov3r - 24.08.2011, 14:33
Re: SetTimer problem? - by Tigerbeast11 - 24.08.2011, 14:35
Re: SetTimer problem? - by iMonk3y - 24.08.2011, 14:38
Re: SetTimer problem? - by Tigerbeast11 - 24.08.2011, 14:38
Re: SetTimer problem? - by =WoR=G4M3Ov3r - 24.08.2011, 14:40
Re: SetTimer problem? - by Generation-X - 24.08.2011, 14:41
Re: SetTimer problem? - by Tigerbeast11 - 24.08.2011, 14:43
Re: SetTimer problem? - by =WoR=G4M3Ov3r - 24.08.2011, 14:45
Re: SetTimer problem? - by Tigerbeast11 - 25.08.2011, 00:03
Re: SetTimer problem? - by =WoR=G4M3Ov3r - 25.08.2011, 00:09
Re: SetTimer problem? - by Tigerbeast11 - 25.08.2011, 00:21
Re: SetTimer problem? - by =WoR=G4M3Ov3r - 25.08.2011, 00:23
Re: SetTimer problem? - by Tigerbeast11 - 25.08.2011, 00:24

Forum Jump:


Users browsing this thread: 5 Guest(s)