25.11.2016, 17:04
o IsVehicleOccupied nao esta matando o player q esta tentando roubar o carro.
oq devo fazer?
Stock
oq devo fazer?
Stock
PHP код:
stock IsVehicleOccupied(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i,vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER))
return 1;
}
return 0;
}
PHP код:
// Anti-Roubo
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
SendClientMessage(playerid, Vermelho, "[AVISO]{FFFFFF} Nгo tente roubar veнculos, vocк morrerб automaticamente{FF0000}.");
SendClientMessage(playerid, Vermelho, "[AVISO]{FFFFFF} Para ver os Comandos do Veiculo digite {FF0000}/vctrl");
SendClientMessage(playerid, Vermelho, "[AVISO]{FFFFFF} Usamos ANTI-HACK de SpeedHack, Velocidade Permitida e {FF0000}[400-KM/H].");
if(!ispassenger && IsVehicleOccupied(vehicleid))
{
AddVehicleComponent(vehicleid, 1010);
}
if(!ispassenger && IsVehicleOccupied(vehicleid)) SetPlayerHealth(playerid,0.0);
return 1;
}