public ScheduledRespawn(playerid)
{
new bool:unwanted[CAR_AMOUNT];
for(new i = 0; i < MAX_PLAYERS; i++)
{
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
}
for(new car = 1; car <= 359; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
SendClientMessage(playerid,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
}
getTime();
new Time = getTime();
if(Time == "12:00")
{
RespawnVehicles();
}
public ScheduledRespawn(playerid) { if(IsPlayerConnected(playerid)) { new bool:unwanted[CAR_AMOUNT]; for(new i = 0; i < MAX_PLAYERS; i++) { for(new player=0; player<MAX_PLAYERS; player++) { if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; } for(new car = 1; car <= 359; car++) { if(!unwanted[car]) SetVehicleToRespawn(car); } SendClientMessage(playerid,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •"); } } } } |
public SyncTime() { new string[64]; new tmphour; new tmpminute; new tmpsecond; gettime(tmphour, tmpminute, tmpsecond); if ((tmphour > ghour) || (tmphour == 0 && ghour == 23)) { format(string, sizeof(string), "Este ora Fix Ceasul acuma este: %d:00 Succes incontinuare!",tmphour); BroadCast(COLOR_WHITE,string); ghour = tmphour; PayDay(); if (realtime) { SetWorldTime(tmphour); } for(new i=0; i<MAX_PLAYERS; i++) { SendClientMessage( i, COLOR_YELLOW, "• In 20 secunde toate masinile se vor respawna ! •"); } SetTimer("ScheduledRespawn",20000,false); } } |
public OnGameModeInit()
{
SetTimer("ScheduledRespawn", time, true); //Change time to your wanted time span
return 1;
}
forward ScheduledRespawn();
public ScheduledRespawn()
{
new bool:unwanted[MAX_VEHICLES];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInAnyVehicle(i))
{
unwanted[GetPlayerVehicleID(i)] = true;
}
}
for(new car = 0; car < MAX_VEHICLES; car++)
{
if(!unwanted[car])
{
SetVehicleToRespawn(car);
}
}
SendClientMessageToAll(COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
}