01.12.2018, 16:09
All right. How do you define IsGovVehicle?
put before OnGameModeInit ()
IsGovVehicle (carid) {if ((carid> = 1) && (carid <= 5)) {return 1;} return 0;}
then check on public OnPlayerStateChange (playerid, newstate, oldstate)
public OnPlayerStateChange (playerid, newstate, oldstate)
{
if (IsPlayerNPC (playerid))
{
return 1;
}
if (newstate == PLAYER_STATE_DRIVER)
{
GetVehicleParamsEx (newcar, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx (newcar, engineOn [newcar], lights, alarm, doors, bonnet, boot, objective);
if (IsGovVehicle(newcar))
{
if (PlayerInfo[playerid][pFac] == 2) {return 1; }
else RemovePlayerFromVehicle (playerid); SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the GOV.");
}
return 1;
}
that should work
put before OnGameModeInit ()
IsGovVehicle (carid) {if ((carid> = 1) && (carid <= 5)) {return 1;} return 0;}
then check on public OnPlayerStateChange (playerid, newstate, oldstate)
public OnPlayerStateChange (playerid, newstate, oldstate)
{
if (IsPlayerNPC (playerid))
{
return 1;
}
if (newstate == PLAYER_STATE_DRIVER)
{
GetVehicleParamsEx (newcar, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx (newcar, engineOn [newcar], lights, alarm, doors, bonnet, boot, objective);
if (IsGovVehicle(newcar))
{
if (PlayerInfo[playerid][pFac] == 2) {return 1; }
else RemovePlayerFromVehicle (playerid); SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the GOV.");
}
return 1;
}
that should work