08.06.2012, 01:53
Olб galera! eu preciso uma funзгo para destruir veiculos com mais de 30 minutos inativos (sem ninguйm usб-lo) .
@EDIT
Veiculos criados no jogo, claro.
@EDIT
Veiculos criados no jogo, claro.
public OnPlayerExitVehicle(playerid, vehicleid)
{
SetTimerEx("Destruir",30*60*1000,false,"d",playerid);
return 1;
}
forward Destruir(playerid);
public Destruir(playerid);
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
)
public OnPlayerExitVehicle(playerid, vehicleid) return SetTimerEx("VehicleDestroy", 30*60000, false, "d", vehicleid);
public VehicleDestroy(vehicleid);
public VehicleDestroy(vehicleid) return DestroyVehicle(vehicleid);
public OnPlayerUpdate(playerid_
{
if(!IsVehicleOccupied(i)) return SetTimer("respawn",60000x30,false);
return 1;
}
forward respawn(playerid);
public respawn(playerid)
{
for(new i=0; i<MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
}
stock IsVehicleOccupied(vehicleid)
{
foreach(Player,i)
{
if(IsPlayerInAnyVehicle(i))
{
if(GetPlayerVehicleID(i)==vehicleid)
{
return 1;
}
else
{
return 0;
}
}
}
}