Question - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Question (
/showthread.php?tid=180669)
Question -
Scriptissue - 02.10.2010
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.
Re: Question -
iJumbo - 02.10.2010
you have 2 save the dini into a variable then make like if(yourwariable == 1) he can enter in the car
Re: Question -
Rudyy - 02.10.2010
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.
Re: Question -
iJumbo - 02.10.2010
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
Re: Question -
Scriptissue - 02.10.2010
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.