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;
}
new Random = random(sizeof(RandomSpawns));
new vid = CreateVehicle(424, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2], RandomSpawns[Random][3], -1, -1, -1);
PutPlayerInVehicle(i, vid, 0);
I have made a stock for SetPlayerVehiclePos, it includes an extra parameter which is facing angle. (Just to make things easy)
I don't receive any car after the message: [EVENT] Derby signups are now closed! Derby is loading.. |
Why do you use 424 as the ID when using PutPlayerInVehicle?
|
Thanks a lot!
![]() PutPlayerInVehicle(playerid, vehicleid, seatid); 424 is the vehicle ID. I have one question.. I have created random spawns for the derby players to spawn, can two players spawn at one place? (This will be a big problem) if yes, can you tell me the way to avoid this? |
if(RandomSpawn[idx][5] == true){
// This has been used so add one to idx and redo...
}