30.05.2011, 00:28
Olб ReDKiiL.
Atenciosamente,
Falcon.
pawn Код:
new bool:VeiculoOcupado[MAX_VEHICLES];
stock IsVehicleEmpty(vehicleid)
{
if(VeiculoOcupado[vehicleid])return 0;
else return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/respawncarros", true) || !strcmp(cmdtext, "/rc", true))
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFF, "Comando de uso exclusivo de administradores");
static nome[MAX_PLAYER_NAME];
static string[72];
GetPlayerName(playerid, nome, sizeof nome);
format(string, sizeof string, "Os Veнculos foram respawnados pelo administrador: %s", nome);
SendClientMessageToAll(0xFFFFFF, string);
for(new v = 0; v < MAX_VEHICLES; ++v)
{
if(VeiculoOcupado[v] == false)
{
SetVehicleToRespawn(v);
}
}
return 1;
}
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
VeiculoOcupado[vehicleid] = false;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2) VeiculoOcupado[GetPlayerVehicleID(playerid)] = true;
return 1;
}
Falcon.