08.05.2012, 17:02
In$$ane there is something is not valid...
This will remover pilot from hunter not other classes.
This should be this:
This will remove all except pilot class member...
==> And one more thing i am not understanding your spy system..... Can u tell it clearly?
pawn Code:
new vehicleid = GetPlayerVehicleID(playerid);//variable to get vehicle ids
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == PILOT)//if player is pilot
{
SendClientMessage(playerid, COLOR_RED, "You Need to be a Pilot to fly Hunter");//messages goes to the player that he can't drive the hunter
RemovePlayerFromVehicle(playerid);//get u off from the hunter
}
This should be this:
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new Float:PosX,Float:PosY,Float:PosZ,model = GetVehicleModel(vehicleid);
if(model == 425)//Hunter
{
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == ASSAULT)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hunter!");
}
}
if(model == 425)//Hunter
{
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == SNIPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hunter!");
}
}
if(model == 425)//Hunter
{
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == ENGINEER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hunter!");
}
}
if(model == 425)//Hunter
{
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == JETTROOPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hunter!");
}
}
return 1;
}
==> And one more thing i am not understanding your spy system..... Can u tell it clearly?