SA-MP Forums Archive
Faction storage - 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: Faction storage (/showthread.php?tid=590566)



Faction storage - luccagomes15 - 01.10.2015

Idk how to do to when player login (enter password correct), check:
if he is a member to a faction, check in he faction members (list) if he is a member and set he officer

Код:
		if(fmembro[playerid] > 0) {
			if you are still in the member list and was not fired
			if he is not on member list, sendclientmsg: You are fired!
			&&
			set he officer: fcargo[playerid] = FactionInfo[IDFAC][cargoofplayer];
		}
Код:
		
enum factioninfos
{
    ID,
    facname[32],
	membro1[30],
	membro2[30],
	membro3[30],
	membro4[30],
	membro5[30],
	membro6[30],
	membro7[30],
	membro8[30],
	membro9[30],
	membro10[30],
	membro11[30],
	membro12[30],
	membro13[30],
	membro14[30],
	membro15[30],
	cargo1,
	cargo2,
	cargo3,
	cargo4,
	cargo5,
	cargo6,
	cargo7,
	cargo8,
	cargo9,
	cargo10,
	cargo11,
	cargo12,
	cargo13,
	cargo14,
	cargo15
}



Re: Faction storage - Rodri99 - 01.10.2015

Use SATDM login code, it's useful in your code +REP
Check my server banner, if you need help PM me.
xEF Owner.


Re: Faction storage - Aerotactics - 01.10.2015

The way you have it setup would require for a check in each faction info slot: "membro1, membro2," etc.

An easier way would be to assign factions to a number in the player data:

Quote:

new pdata
{
pName[MAX_PLAYER_NAME],
pLvl,
pFaction,
pfactionrank,
...
}

later...

if pInfo[playerid][pfaction] > 0 // if they have a faction
{
switch (pInfo[playerid][pfaction])
{
case 0: return 1; // this line does nothing and is never called
case 1:
{
new faction name = "Police";
if(..pfactionrank] > 0)
{
new rank = "Army";
}
}
}
}