Faction storage
#1

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
}
Reply
#2

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

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";
}
}
}
}

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)