15.11.2009, 14:54
How can I make it so only pilots can get in planes. I have the teams and stuff setup.
if(PlayerTeam[playerid] != pilot) TogglePlayerControllable(playerid, 1), SendClientMessage(playerid, col, "Only pilots can drive a plane...");
Originally Posted by Kurence
pawn Код:
|
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(ispassenger == 0)
{
if(GetVehicleModel(vehicleid) == 593/*dodo vehicle modelid*/ && Team[playerid] != pilot)
{
SendClientMessage(playerid, 0xFFFFFFFF, "You cant drive this dodo because you are not a pilot");
TogglePlayerControlable(playerid, 0);//freeze
TogglePlayerControlable(playerid, 1);//unfreeze to prevent him from entering in the plane
}
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(ispassenger == 0) //Check to see if the player is a passenger
{
if(IsVehPlane(vehicleid))
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are not a pilot, you cannot fly planes!");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
forward IsVehPlane(vehicleid);
public IsVehPlane(vehicleid)
{
if(GetVehicleModel(vehicleid) == 593 || GetVehicleModel(vehicleid) == 592 || GetVehicleModel(vehicleid) == 577 || GetVehicleModel(vehicleid) == 511 || GetVehicleModel(vehicleid) == 512 || GetVehicleModel(vehicleid) == 520 || GetVehicleModel(vehicleid) == 553 || GetVehicleModel(vehicleid) == 476 || GetVehicleModel(vehicleid) == 519 || GetVehicleModel(vehicleid) == 460 || GetVehicleModel(vehicleid) == 513)
}