29.01.2013, 05:38
(
Последний раз редактировалось Jewell; 29.01.2013 в 08:51.
)
anyway, i think your code doesn't work.. because you need to get vehicle model(GetVehicleModel(vehicleid)) not the vehicle id..
if your code is bugged then try This..
FIXED
pawn Код:
if(gClass[playerid] == CLASS_PILOT)
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
new veh, Float:x,Float:y,Float:z;
veh = GetPlayerVehicleID(playerid);
if(veh > 425 || 447 || 464 || 476 || 520)
GetPlayerPos(playerid, x,y,z);
SetPlayerPos(playerid, x,y,z+1);
}else return SendClientMessage(playerid, red, "[ERROR]: You need to be a pilot to fly this vehicle");
return 1;
}
}
if your code is bugged then try This..
FIXED
pawn Код:
if(gClass[playerid] != CLASS_PILOT)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
new veh,model, Float:x,Float:y,Float:z;
veh = GetPlayerVehicleID(playerid);
model = GetVehicleModel(veh );
if(model == 425 || model == 447 ||model == 464 || model == 476 || model == 520)
{
GetPlayerPos(playerid, x,y,z);
SetPlayerPos(playerid, x,y,z+1);
return SendClientMessage(playerid, red, "[ERROR]: You need to be a pilot to fly this vehicle");
}
}
}