28.02.2014, 11:53
I'm trying to make a derby system based on signups, this is the code of the part in which i have problem:
active - if derby is active or not.
The SetTimer("SignUpAndDerbyStart", 1000, true); does not load, everything works correctly but when it comes to the SignUpAndDerbyStart function, nothing happens. I'm including a timer in a timer...(I think thats the problem). Can someone please help me to figure out the problem and tell me the solution?
pawn Код:
forward EventStart();
public EventStart()
{
time++;
if (time == 20 && active == 0)
{
SendClientMessageToAll(-1, ""YELLOW"[EVENT] {5DF0BF}Derby event has started! Type "YELLOW"/derby {5DF0BF}to sign up for the event!");
active = 1;
time = 0;
SetTimer("SignUpAndDerbyStart", 1000, true);
}
return 1;
}
forward SignUpAndDerbyStart();
public SignUpAndDerbyStart()
{
new str[128];
t2++;
if (t2 == 5 && active == 1)
{
if (totalplayers < 2) return SendClientMessageToAll(-1, ""YELLOW"[EVENT] {5DF0BF}Derby event has been cancelled due to lack of participants!");
format(str, sizeof(str), ""YELLOW"[EVENT] {5DF0BF}Derby signups are now closed! Derby event is loading.. "REDORANGE"(Total participants: %d)", totalplayers);
SendClientMessageToAll(-1, str);
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][DerbySignUp] == 1)
{
PlayerInfo[i][DerbySignUp] = 0;
}
}
}
}
return 1;
}
The SetTimer("SignUpAndDerbyStart", 1000, true); does not load, everything works correctly but when it comes to the SignUpAndDerbyStart function, nothing happens. I'm including a timer in a timer...(I think thats the problem). Can someone please help me to figure out the problem and tell me the solution?