09.06.2012, 10:47
All vehicles on the server have an ID which is between 0 and 2000. "vehicleid" is not the model number, but you can use the "vehicleid" variable to determine the model number by using the GetVehicleModel function.
You should also look up logical operators, your use of it made no sense before. '!=' is used to check if something is unequal to the value you're comparing it against.
You might also want to add a validity check - i.e. if the person is an admin, they should still be able to enter, or whatever. At this rate, nobody can enter the vehicle.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid) == 425)
{
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, slx, sly, slz+1.5);
PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
SendClientMessage(playerid, COLOR_GREEN, "Your not allowed to enter this vehicle");
return 1;
}
return 1;
}
You might also want to add a validity check - i.e. if the person is an admin, they should still be able to enter, or whatever. At this rate, nobody can enter the vehicle.