How to create a faction?
#4

Quote:

enum pInfo
{
pLeader,
pRank,
pMember
};

new PlayerInfo[MAX_PLAYERS][pInfo];


Making somebody a leader. (Took from my script)
CMD:makeleader(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 5)
{
new string[128], giveplayerid, faction;
if(sscanf(params, "ud", giveplayerid, faction))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeleader [playerid] [factionid]");
SendClientMessageEx(playerid, COLOR_LIGHTGREEN, "|1 LSPD |2 FBI |3 FDSA |4 SAAS");
return 1;
}
if(faction > 13 || faction < 0) { SendClientMessageEx(playerid, COLOR_YELLOW, "Don't go below number 0 or above number 4!"); return 1; }

if(IsPlayerConnected(giveplayerid))
{
new ftext[30];
PlayerInfo[giveplayerid][pLeader] = faction;
PlayerInfo[giveplayerid][pRank] = 6;
PlayerInfo[giveplayerid][pMember] = faction;
if(PlayerInfo[giveplayerid][pLeader] == 1) { ftext = "LSPD"; }
else if(PlayerInfo[giveplayerid][pLeader] == 2) { ftext = "FBI"; }
else if(PlayerInfo[giveplayerid][pLeader] == 3) { ftext = "FSDA"; }
else if(PlayerInfo[giveplayerid][pLeader] == 4) { ftext = "SAAS"; }
else { return 1; }


format(string, sizeof(string), "You have been made the leader of the %s by Administrator %s.",ftext, GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have made %s the leader of the %s.", GetPlayerNameEx(giveplayerid),ftext);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}

If you need anymore help, PM me, i can explain it further.
Reply


Messages In This Thread
How to create a faction? - by MrBorsh - 15.09.2012, 15:43
Re: How to create a faction? - by doreto - 15.09.2012, 15:45
Re: How to create a faction? - by Sig Hansen - 15.09.2012, 15:45
Re: How to create a faction? - by RLGaming - 15.09.2012, 15:55
Re: How to create a faction? - by Sig Hansen - 15.09.2012, 15:57
Re: How to create a faction? - by MrBorsh - 15.09.2012, 16:03
Re: How to create a faction? - by Sig Hansen - 15.09.2012, 16:05
Re: How to create a faction? - by RLGaming - 15.09.2012, 16:07
Re: How to create a faction? - by Stanford - 15.09.2012, 16:25
Re: How to create a faction? - by MrBorsh - 15.09.2012, 16:35

Forum Jump:


Users browsing this thread: 1 Guest(s)