Question
#1

I made a Faction script, It works, I used Dini thingy, I don't know how to add to the faction vehicles, can any one help with that ? that only belongs to the Faction.
Reply
#2

you have 2 save the dini into a variable then make like if(yourwariable == 1) he can enter in the car
Reply
#3

Okay here we go.
First of all define the vehicle.
pawn Код:
new faction1;
new faction2;
new faction3;
//ect... how much you need

And then
pawn Код:
faction1 = AddStaticVehicle(model,........);
faction2 = AddStaticVehicle(model,.........);
faction3 = AddStaticVehicle(model,........);
//Ect....
after that
OnPlayerStateChange.

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            if(vehicleid == faction1 && faction[playerid] != FACTIONiD)
            {
                SendClientMessage(playerid, 0xFFFFFFFF, "This vehicle belongs to "Your Faction Name".");
RemovePlayerFromVehicle(playerid);
            }

        }
Add that 3 times on your script.
Reply
#4

where dini read from player you have 2 put like this in dini file FACTION=1
or FACTION=2 if is 1 is for faction 1 2 for faction 2 ... then read like this

ex:
pawn Код:
SetPVarInt(playerid, "FACTION",dini_Int(file,"FACTION"));
then use this code
pawn Код:
if(GetPVarInt(playerid, "FACTION") == 1)
    {
... try
Reply
#5

I have added all the new files for one Faction, just for now, and then I tired to add your code in statechange, and it doesn't work,
Can any one give me the full code that I should put in OnPlayerStateChange.
I don't have a name for the Faction it just makes a Users/%s.ini file on the player and adds 1 or 0 if he is in a Faction.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)