/Invite || /Accept -> Factions -
HY - 23.11.2014
Hello, as title said, I have a problem with /Invite, /Accept commands for Faction Leaders.
So, I have 2 factions, look here Faction Info Enums:
pawn Code:
enum fInfo
{
LiderG,
MembruG,
LiderL,
MembruL
}
new FactionInfo[MAX_PLAYERS][fInfo];
new Invited[MAX_PLAYERS];
Then, I started scripting for factions, with /Invite Command !
pawn Code:
CMD:invite(playerid, params[])
{
new ID;
new string[128];
new name[MAX_PLAYER_NAME];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(ID, pname, sizeof(pname));
if(FactionInfo[playerid][LiderG] >= 1)
{
if(sscanf(params,"u", ID)) return SendClientMessage(playerid,-1,"{FF0000}Folosire: {15FF00}/Invite [JucatorID]");
format(string, sizeof(string), "{FFCC33}Informatie: {15FF00}Ai fost invitat de {FF00000}%s {15FF00}in factiunea {0066CC}Groove Street!", name);
SCM(ID, -1, string);
format(string, sizeof(string), "{FFCC33}Informatie: {15FF00}Scrie {FF00000}/accept {15FF00}pentru a accepta!", name);
SCM(ID, -1, string);
format(string, sizeof(string), "{FFCC33}L-ai invitat pe {FF0000}%s {FFCC33}pentru a intra in factiunea ta!", pname);
SCM(playerid, -1, string);
Invited[ID] = 1;
}
else if(FactionInfo[playerid][LiderL] >= 1)
{
if(sscanf(params,"u", ID)) return SendClientMessage(playerid,-1,"{FF0000}Folosire: {15FF00}/Invite [JucatorID]");
format(string, sizeof(string), "{FFCC33}Informatie: {15FF00}Ai fost invitat de {FF00000}%s {15FF00}in factiunea {0066CC}Familia Leonte!", name);
SCM(ID, -1, string);
format(string, sizeof(string), "{FFCC33}Informatie: {15FF00}Scrie {FF00000}/accept {15FF00}pentru a accepta!", name);
SCM(ID, -1, string);
format(string, sizeof(string), "{FFCC33}L-ai invitat pe {FF0000}%s {FFCC33}pentru a intra in factiunea ta!", pname);
SCM(playerid, -1, string);
Invited[ID] = 1;
}
return 1;
}
Then, players are invited, by variable:
And I started command /Accept. But I don't know how to make..
pawn Code:
CMD:accept(playerid, params[])
{
if(Invited[playerid] == 1)
{
// Code... Don't know. For First Faction...
}
return 1;
}
+REP, of course.
I just wanna' only for 1 Faction, then I see model and I try make for 2 faction.. I don't know how to start.
I hope you understanded me.
Re: /Invite || /Accept -> Factions -
HY - 23.11.2014
Bump?

Sorry, I really need help.
Re : /Invite || /Accept -> Factions -
streetpeace - 23.11.2014
Something like this :
pawn Code:
pInfo[playerid][LegalFaction] = 1;
pInfo[playerid][LegalRank] = 1;
SendClientMessage(playerid, -1, "You've accepted the faction invitation, welcome to the police!");