05.01.2014, 01:38
Testa ai
pawn Код:
// Callback chamada quando o player entra no veiculo
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
// Cria as variaveis
new engine, lights, alarm, doors, bonnet, boot, objective;
// Liga Motor e luzes
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
return 1;
}
// Callback chamada quando o player sai do veiculo
public OnPlayerExitVehicle(playerid, vehicleid)
{
// Cria as variaveis
new engine, lights, alarm, doors, bonnet, boot, objective;
// Verifica se o jogador e motorista do veiculo
if (GetPlayerVehicleSeat(playerid) == 0)
{
// Desliga Motor e luzes
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, objective);
}
return 1;
}