Faction Vehicles
#9

Quote:
Originally Posted by JJB562
Посмотреть сообщение
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.
With this one?
Код:
    CopVehicle[0] = AddStaticVehicle(477,1566.2892,-1615.8591,13.1186,270.1325,1,1); // cop car 1
    CopVehicle[1] = AddStaticVehicle(477,1557.3464,-1615.8545,13.1397,270.2108,1,1); // cop car 2
    CopVehicle[2] = AddStaticVehicle(477,1591.6287,-1606.2499,13.1367,180.9415,1,1); // cop car 3
    CopVehicle[3] = AddStaticVehicle(477,1597.4304,-1606.0475,13.1902,181.4439,1,1); // cop car 4
    CopVehicle[4] = AddStaticVehicle(477,1601.6312,-1630.6210,13.2421,91.8427,1,1); // cop car 5
    CopVehicle[5] = AddStaticVehicle(477,1564.4960,-1631.6226,13.1129,88.9426,1,1); // cop car 6
Because from what im reading i need to add this:
Код:
stock IsACopVehicle(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 477: return 1;
    }
    return 0;
}
But than all ZR-350's (Veh ID 477) would be blocked for normal players?
Please correct me if im wrong, Still a beginner
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: 3 Guest(s)