24.08.2011, 14:19
Quote:
You showed us what you had OnGameModeInit, Keep the printf you had under it.
|
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;
}