31.08.2012, 13:05
Hey all,
Im making my own Capture the flag GM, but when the timer turns 00:00 it starts counting down again so 00:-10 example.
Also the most points check doesnt work. it just sends the first message.
Code:
This is under onesecondpublic, a Public that does a action each 1sec.
Im making my own Capture the flag GM, but when the timer turns 00:00 it starts counting down again so 00:-10 example.
Also the most points check doesnt work. it just sends the first message.
Code:
This is under onesecondpublic, a Public that does a action each 1sec.
pawn Код:
if(PlayTimeMinutes >= 9)
{
PlayTimeSeconds --;
if(PlayTimeSeconds == 0)
{
PlayTimeMinutes --;
PlayTimeSeconds = 60;
}
format(string, sizeof(string), "%d:%d", PlayTimeMinutes, PlayTimeSeconds);
TextDrawSetString(TimeTD,string);
}
if(PlayTimeMinutes <= 10)
{
PlayTimeSeconds --;
if(PlayTimeSeconds == 0)
{
PlayTimeMinutes --;
PlayTimeSeconds = 60;
}
format(string, sizeof(string), "0%d:%d", PlayTimeMinutes, PlayTimeSeconds);
TextDrawSetString(TimeTD,string);
}
if(PlayTimeMinutes == 0)
{
if(PlayTimeSeconds >= 0)
{
PlayTimeSeconds --;
format(string, sizeof(string), "00:%d", PlayTimeSeconds);
TextDrawSetString(TimeTD,string);
}
if(PlayTimeSeconds == 0)
{
format(string, sizeof(string), "00:00");
TextDrawSetString(TimeTD,string);
TogglePlayerControllable(i, 0);
SetTimerEx("StartNewRound", 15000, false, "d", i);
if(BlueScore >= RedScore)
{
format(string, sizeof(string), "Congratulations to {0000FF}Team Blue, {FFFF00}they have won with %d point!", BlueScore);
SendClientMessageToAll(YELLOW, string);
}
else if(RedScore >= BlueScore)
{
format(string, sizeof(string), "Congratulations to {FF0000}Team Red, {FFFF00}they have won with %d point!", RedScore);
SendClientMessageToAll(YELLOW, string);
}
else if(RedScore == BlueScore)
{
format(string, sizeof(string), "Nobody won this match, {0000FF}%d {FFFF00}vs {FF0000}%d", BlueScore, RedScore);
SendClientMessageToAll(YELLOW, string);
}
}
}