Faction ID's - 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 ID's (
/showthread.php?tid=450678)
Faction ID's -
arjanforgames - 14.07.2013
I have faction numbers 1 to 7 but how can I make the command /makeleader [playerid / name] [factionid]
I've tried multiple things but it wouldn't work.
Respuesta: Faction ID's -
Xabi - 14.07.2013
You must have two variables, one to store the players faction and another one to store the player rank into that faction, for example, if you have PlayerInfo[playerid][pMember] to store the faction and PlayerInfo[playerid][pRank] to store the rank in the faction, just make a command that stores the given factionid in the first array and the maximum allowed rank in the second array.
Re: Faction ID's -
arjanforgames - 14.07.2013
Yes I can store them but how do I get the factionid the admin typed and when its 2 for example, so I can
pawn Код:
PlayerInfo[playerid][pTeam] = 2;
PlayerInfo[playerid][pLeader] = 2;
PlayerInfo[playerid][pRank] = 6;
Respuesta: Faction ID's -
Xabi - 14.07.2013
Suposing that you use zcmd and sscanf2, this could be the code for that command:
pawn Код:
CMD:makeleader(playerid, params[])
{
new player, faction;
if(sscanf(params, "ud", player, faction)) return SendClientMessage(playerid, Blanco, "USAGE: /makeleader [playerid / name] [factionid]");
if(player!= INVALID_PLAYER_ID)
{
if((PlayerInfo[playerid][pLeader] != faction) SendClientMessage(playerid, Rojo, "* You are not the leader of that faction.");
else
{
PlayerInfo[player][pTeam] = faction;
PlayerInfo[player][pLeader] = faction;
PlayerInfo[player][pRank] = 6;
}
}
else SendClientMessage(playerid, Rojo, "* The player is not online.");
return 1;
}