In$$ane there is something is not valid...
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 will remover pilot from hunter not other classes.
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;
}
This will remove all except pilot class member...
==> And one more thing i am not understanding your spy system..... Can u tell it clearly?