Newbie question :P
#7

Would i do the same for this?

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        for(new i = 0; i < sizeof(PoliceVehcles); i++)
        {
            if(vid == PoliceVehcles[i])
            {
                if(PlayerInfo[playerid][pTeam] == 6)
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid,COLOR_RED,"You Are Not A Police Officer!");
                    return 1;
                }
            }
        }
    }
    else if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        for(new i = 0; i < sizeof(PilotHunter); i++)
        {
            if(vid == PilotHunter[i])
            {
                if(PlayerInfo[playerid][pClass] == 4)
                {
                    if(PlayerInfo[playerid][pARank] == 3)
                    {
                        RemovePlayerFromVehicle(playerid);
                        SendClientMessage(playerid,COLOR_RED,"You Are Not An Level 3 Pilot!");
                        return 1;
                    }
                }
            }
        }
    }
    else if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        for(new i = 0; i < sizeof(PilotHydra); i++)
        {
            if(vid == PilotHydra[i])
            {
                if(PlayerInfo[playerid][pClass] == 4)
                {
                    if(PlayerInfo[playerid][pARank] == 4)
                    {
                        RemovePlayerFromVehicle(playerid);
                        SendClientMessage(playerid,COLOR_RED,"You Are Not An Level 4 Pilot!");
                        return 1;
                    }
                }
            }
        }
    }
    else if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        for(new i = 0; i < sizeof(PilotNevada); i++)
        {
            if(vid == PilotNevada[i])
            {
                if(PlayerInfo[playerid][pClass] == 4)
                {
                    if(PlayerInfo[playerid][pARank] == 1)
                    {
                        RemovePlayerFromVehicle(playerid);
                        SendClientMessage(playerid,COLOR_RED,"You Are Not An Level 1 Pilot!");
                        return 1;
                    }
                }
            }
        }
    }
    else if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        for(new i = 0; i < sizeof(PilotShamal); i++)
        {
            if(vid == PilotShamal[i])
            {
                if(PlayerInfo[playerid][pClass] == 4)
                {
                    if(PlayerInfo[playerid][pARank] == 1)
                    {
                        RemovePlayerFromVehicle(playerid);
                        SendClientMessage(playerid,COLOR_RED,"You Are Not An Level 1 Pilot!");
                        return 1;
                    }
                }
            }
        }
    }
    else if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        for(new i = 0; i < sizeof(PoliceHydra); i++)
        {
            if(vid == PoliceHydra[i])
            {
                if(PlayerInfo[playerid][pTeam] == 6)
                {
                    if(PlayerInfo[playerid][pClass] == 4)
                    {
                        if(PlayerInfo[playerid][pARank] == 4)
                        {
                            RemovePlayerFromVehicle(playerid);
                            SendClientMessage(playerid,COLOR_RED,"You Are Not An Level 4 Police Pilot!");
                            return 1;
                        }
                    }
                }
            }
        }
    }
    else if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        for(new i = 0; i < sizeof(MedicVehicles); i++)
        {
            if(vid == MedicVehicles[i])
            {
                if(PlayerInfo[playerid][pTeam] == 5)
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid,COLOR_RED,"You Are Not A Medic!");
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Newbie question :P - by Shockey HD - 27.08.2011, 21:03
Re: Newbie question :P - by dice7 - 27.08.2011, 21:22
Re: Newbie question :P - by Shockey HD - 27.08.2011, 21:25
Re: Newbie question :P - by Amel_PAtomAXx - 27.08.2011, 21:27
Re: Newbie question :P - by dice7 - 27.08.2011, 21:27
Re: Newbie question :P - by Kush - 27.08.2011, 21:29
Re: Newbie question :P - by Shockey HD - 27.08.2011, 21:39

Forum Jump:


Users browsing this thread: 1 Guest(s)