04.10.2012, 15:42
Here is my code that is my derby, with the "endDerby" function which should spawn a player, Destroy the derby car, and send a message to all that the derby is ended, and it will start again soon. Anyhow, here is my code:
When he joins the derby, this is started:
endderby here:
That was the code, Why is this happening: ?
And another problem, when other players are driving their cars, suddenly all used cars are getting destroyed when the derby ends? I have struggled with that a long time now, i think it was time to get some help ^^
Thanks!
When he joins the derby, this is started:
pawn Код:
timerr[i][EDERBY] = SetTimer("EndDerby", 60*1000, false);
pawn Код:
forward EndDerby(playerid);
public EndDerby(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(playerid,"derby") == 1)
{
DestroyVehicle(GetPlayerVehicleID(playerid));
SpawnPlayer(playerid);
EnableDerby = 0;
SetPVarInt(playerid,"derby", 0);
}
else
{
EnableDerby = 0;
SetPVarInt(playerid,"derby", 0);
SetPVarInt(playerid, "HasSpawnedCar",0);
timerr[playerid][DTIMER] = SetTimer("StartDerby", 120000, false);
SendClientMessageToAll(COLOR_GREEN,"[SERVER] Derby has been ended!"cyellow" Everyone in derby has been spawned!");
SendClientMessageToAll(COLOR_GREEN,"[SERVER] New derby will be there in "cred"2 minutes!"cgreen" Kindly stay connected!");
KillTimer(timerr[playerid][EDERBY]);
KillTimer(timerr[playerid][STIMER]);
}
}
return 1;
}
And another problem, when other players are driving their cars, suddenly all used cars are getting destroyed when the derby ends? I have struggled with that a long time now, i think it was time to get some help ^^
Thanks!