Gang Cars HELP...!
#1

Hello guys, I need your help... I want to make my own Gang Cars ... I did it...

Quote:

forward IsAGangCar(carid);
forward IsAGangCar2(carid);
forward IsAGangCar3(carid);
forward IsAGangCar4(carid);
forward IsAGangCar5(carid);

Quote:

public IsAGangCar(carid)
{
if((carid >= 184) && (carid <= 186))
{
return 1;
}
return 0;
}

public IsAGangCar2(carid)
{
if((carid >= 187) && (carid <= 189))
{
return 1;
}
return 0;
}

public IsAGangCar3(carid)
{
if((carid >= 190) && (carid <= 192))
{
return 1;
}
return 0;
}

public IsAGangCar4(carid)
{
if(carid >= 155 && carid <= 159)
{
return 1;
}
return 0;
}

public IsAGangCar5(carid)
{
if(carid >= 168 && carid <= 171)
{
return 1;
}
return 0;
}

and there...
Quote:

//-------------------------------------------------------------------------------------------
AddStaticVehicleEx(412,-2448.320312,2337.785400,4.982542,88.6221, -1,-1,30000); // Crips Car 184
AddStaticVehicleEx(466,-2437.975585,2340.052978,4.988764,88.6221, -1,-1,30000); // Crips Car 185
AddStaticVehicleEx(467,-2425.776611,2342.580078,4.990283,88.6221, -1,-1,30000); // Crips Car 186
AddStaticVehicleEx(474,-2478.843750,2476.655029,17.842821,88.6221, -1,-1,30000); // Bloods Car 187
AddStaticVehicleEx(467,-2485.978759,2482.203125,18.056169,88.6221, -1,-1,30000); // Bloods Car 188
AddStaticVehicleEx(492,-2485.774414,2492.726806,18.056169,88.6221, -1,-1,30000); // Bloods Car 189
AddStaticVehicleEx(505,-2624.263183,2344.941406,8.438805,88.6221, -1,-1,30000); // Black Yakuza Car 190
AddStaticVehicleEx(500,-2623.501464,2337.013427,8.347093,88.6221, -1,-1,30000); // Black Yakuza Car 191
AddStaticVehicleEx(545,-2623.216552,2331.438476,8.319751,88.6221, -1,-1,30000); // Black Yakuza Car 192
//-------------------------------------------------------------------------------------------

Quote:

if(IsAGangCar(newcar))
{
if(PlayerInfo[playerid][pLeader] == 15||PlayerInfo[playerid][pMember] == 15) { }
else {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
}
if(IsAGangCar2(newcar))
{
if(PlayerInfo[playerid][pLeader] == 16||PlayerInfo[playerid][pMember] == 16) { }
else {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
}
if(IsAGangCar3(newcar))
{
if(PlayerInfo[playerid][pLeader] == 14||PlayerInfo[playerid][pMember] == 14) { }
else {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
}
if(IsAGangCar4(newcar))
{
if(PlayerInfo[playerid][pLeader] == 15||PlayerInfo[playerid][pMember] == 4) { }
else {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
}
if(IsAGangCar5(newcar))
{
if(PlayerInfo[playerid][pLeader] == 16||PlayerInfo[playerid][pMember] == 5) { }
else {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
}

what must I do now? The cars added but everyone can use them... Every Gang member and Civilians too can use this gang cars ... :S Help me please (I'm using GTA:RP and I'm learning scripting and don't laugh at me please...)
Reply
#2

I want to no one can use the cars... for example civilians mustn't use this cars and only a gang members can use this cars... help me please. .. :S sorry for my bad english : )
Reply
#3

the only way i know its like this ,with car name not id ->

pawn Код:
new CARNAME[number of cars+1]
ex
pawn Код:
new CARNAME[1]
pawn Код:
public IsAGangCar(carid)
{
    for(new i = 0; i < sizeof(CARNAME); i++)
    {
        if(carid == CARNAME[i]) return 1;
    }
    return 0;
}
then do smthn like

pawn Код:
CARNAME[0] = AddStaticVehicleEx(412,-2448.320312,2337.785400,4.982542,88.6221, -1,-1,30000); // Crips Car 184
and then

pawn Код:
if(IsAGangCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == FACTIONNR||PlayerInfo[playerid][pMember] == FACTIONNR) { CanTurnEngine[playerid] = newcar; }
            else
            {
                SafeRemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "** this car belongs to faction x");
                }
            }

p.s : you'll most likely get errors if you copy paste this ,i just gave you an example,you might not even have "canturnengine" ,you may delete that line


i hope this helps you,somehow,if you're smart you can figure it out from my example

p.s2: i dont see how you linked the car id from isagangcar to those cars you made for the gang ,or im just not familiar enough with that type of making gang cars
Reply
#4

Thank's a lot man ... I really needed it...
Reply
#5

show the actual line pls?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)