SA-MP Forums Archive
Gang system help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gang system help (/showthread.php?tid=561398)



Gang system help - MrSwindle - 02.02.2015

As of right now my gang system and faction system are they same thing and any gang member can get in any gangs car. Will I have to split my systems or is there a way to restrict them being in one system


Re: Gang system help - SnG.Scot_MisCuDI - 02.02.2015

Use something like IsInGang and IsInFaction


Re: Gang system help - MrSwindle - 02.02.2015

How would implement that?


Re: Gang system help - Sime30 - 02.02.2015

Like this

pawn Код:
new BallasCar[17]; // Create a variable that we'll use for making cars, 17 cars, starts from 0 to 16
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

      if (IsBallasCar(vehicleid) && !ispassenger) // If you are entering a ballas vehicle as a driver
      {
               if(PlayerInfo[playerid][Member] == 1// This is an example how can you make a check. If the player is a member of a faction ID 1(In this case Ballas), player will enter the car and nothing will happen
               {
 
               }
               else // it the player is not in Ballas, set him a position whenever he presses F so he can't enter the car
               {
                     new Float:cx, Float:cy, Float:cz;
                GetPlayerPos(playerid, cx, cy, cz);
                SetPlayerPos(playerid, cx,  cy, cz);
               }
       }
forward IsBallasCar(carid);
public IsBallasCar(carid)
{
    for(new i = 0; i < sizeof(BallasCar); i++)
    {
        if(carid == BallasCar[i])   return 1;
    }
    return 0;
}

//And how we make the cars
BallasCar[0] = AddStaticVehicleEx(560,1669.5177,-1693.3754,15.3143,91.0343,116,1,300); // First car, starts from 0
BallasCar[1] = AddStaticVehicleEx(560,1669.5188,-1696.7054,15.3142,90.2332,116,1,300); //