Faction Vehicles
#8

Try this:

pawn Код:
IsACopVehicle(carid)
{
    for(new v = 0; v < sizeof(CopVehicle); v++)
    {
        if(carid == CopVehicle[v]) return 1;
    }
    return 0;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(IsACopVehicle(vehicleid))
        {
            if(PlayerInfo[playerid][pMember] != 1)
            {
                RemovePlayerFromVehicle(playerid);
                new Float:x, Float:y, Float:z;
                GetPlayerPos(playerid, x, y, z);
                SetPlayerPos(playerid, x, y, z);
                SendClientMessage(playerid, COLOR_WHITE, "You dont have the keys to this vehicle! (Faction Restricted)");
            }
        }
    }
    return 1;
}
I have not tested the code, but it should work.
Reply


Messages In This Thread
Faction Vehicles - by Facerafter - 05.05.2013, 17:51
Re: Faction Vehicles - by BossZk - 05.05.2013, 18:11
Re: Faction Vehicles - by MattyG - 05.05.2013, 18:17
Re: Faction Vehicles - by Facerafter - 05.05.2013, 18:27
Re: Faction Vehicles - by MattyG - 05.05.2013, 18:32
Re: Faction Vehicles - by J4mmyHD - 05.05.2013, 18:45
Re: Faction Vehicles - by Facerafter - 05.05.2013, 18:51
Re: Faction Vehicles - by JJB562 - 05.05.2013, 20:55
Re: Faction Vehicles - by Facerafter - 05.05.2013, 21:40
Re: Faction Vehicles - by JJB562 - 05.05.2013, 22:50

Forum Jump:


Users browsing this thread: 1 Guest(s)