This is not how the operator || is used (To know how,
click me). You should of used "," instead of it if you wanna save lines, like this:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new model = GetVehicleModel(vehicleid);
if(model == 541)
{
if (GetPlayerSkin(playerid) != 0 ) return SendClientMessage(playerid, -1, "You may not drive this vehicle!"), RemovePlayerFromVehicle(playerid);
}
return 1;
}
But, this still won't work because you're using RemovePlayerFromVehicle under OnPlayerEnterVehicle which is called before a player enters a vehicle (Actually as soon as they press RETURN), so RemovePlayerFromVehicle won't have effects as the player hasn't entered the vehicle yet. If I were you, I'd do it this way:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new model = GetVehicleModel(vehicleid);
if(model == 541)
{
if (GetPlayerSkin(playerid) != 0 )
{
SendClientMessage(playerid, -1, "You may not drive this vehicle!");
TogglePlayerControllable(playerid, false); // freezes the player
TogglePlayerControllable(playerid, true); // then unfreezes him, which will cause him to stop the entering animation (and won't enter the vehicle)
return 1;
}
}
return 1;
}