Hello, i need some help about my derby "minigame"
soo i created 18 pickups, each time a player pickup one of those pickups, a car is created and he is thrown into it. Now i ve set a timer of 5 mins to prevent player from moving when they picked up a pickup and also to destroy the pickups to avoid others players to join after the round started. But when the timer ends, only the player that started the derby is unfrozen, all the others are still frozen but they still got the message "The Derby has started".
"TogglePlayerControllable(playerid, 1);" Doesn't work for all players
public MaxJoinTime(playerid)
{
SendClientMessageToAll(COLOR_RED, "The Derby Event has started.");
if(GetPlayerInterior(playerid) == 15)
{
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid,"~r~THE DERBY HAS STARTED!", 5000, 5);
PlayerPlaySound(playerid, 5201, 0.0, 0.0, 10.0);
//Destroying Pickups to avoid players to join after the timer finished.
DestroyPickup(V1);
DestroyPickup(V2);
DestroyPickup(V3);
DestroyPickup(V4);
DestroyPickup(V5);
DestroyPickup(V6);
DestroyPickup(V7);
DestroyPickup(V8);
DestroyPickup(V9);
DestroyPickup(V10);
DestroyPickup(V11);
DestroyPickup(V12);
DestroyPickup(V13);
DestroyPickup(V14);
DestroyPickup(V15);
DestroyPickup(V16);
DestroyPickup(V17);
DestroyPickup(V18);
}
return 1;
}
//The first pickup, the other are all the same
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == V1)
{
new vehicle1 = AddStaticVehicle(504,-1276.6234,1001.8982,1037.0726,95.9995,186,186); //
LinkVehicleToInterior(vehicle1, 15);
SetPlayerInterior(playerid, 15);
PutPlayerInVehicle(playerid, vehicle1, 0);
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid, "~g~PLEASE WAIT FOR OTHER PLAYERS", 5000, 5);
DestroyPickup(V1);
SendClientMessage(playerid,COLOR_RED, "Please wait for other players");
ResetPlayerWeapons(playerid);
}
I did forwarded the MaxJoinTime & it is started when a player does a cmd
with SetTimerEx(#MaxJoinTime, 300000, false, #i, playerid);//5 Mins
I hope you guys can help me