02.03.2014, 05:29
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;
gDerbyTimer = SetTimer("SignUpAndDerbyStart", 1000, true);
}
return 1;
}
forward SignUpAndDerbyStart();
public SignUpAndDerbyStart()
{
new str[128];
t2++;
if (t2 == 5 && active == 1)
{
/* if (totalplayers < 0)
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][DerbySignUp] == 1)
{
PlayerInfo[i][DerbySignUp] = 0;
}
}
}
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);
KillTimer(gDerbyTimer); // Nothing happens after this...
InitiatePlayers();
}
return 1;
}
forward InitiatePlayers();
public InitiatePlayers()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][DerbySignUp] == 1)
{
PlayerInfo[i][DerbySignUp] = 0;
new Float:RandomSpawns[][] =
{
{3231.9502,732.2703,4.1086,269.8116},
{3356.9399,687.2062,4.1097,90.7039},
{3315.5073,761.3829,17.9094,183.8474},
{3273.1577,697.4916,4.1110,4.3769},
{3356.6091,784.9301,3.9539,91.3945},
{3289.0208,745.3491,3.9531,1.4095},
{3286.6167,823.3590,3.9528,181.5422}
};
PutPlayerInVehicle(i, 424, 0);
new Random = random(sizeof(RandomSpawns));
SetPlayerVehiclePos(i, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2], RandomSpawns[Random][3]);
}
}
}
return 1;
}