PDA

View Full Version : Gang system help


MrSwindle
02/02/2015, 10:16 PM
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

SnG.Scot_MisCuDI
02/02/2015, 10:18 PM
Use something like IsInGang and IsInFaction

MrSwindle
02/02/2015, 11:10 PM
How would implement that?

Sime30
02/02/2015, 11:23 PM
Like this


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); //