Leader set... - 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: Leader set... (
/showthread.php?tid=485390)
Leader set...(y_groups) -
Scrillex - 04.01.2014
So I made makeleader cmd.. But there is million question.. How can I set players group with it.. (using y_groups)
So basically what I need is Group_SetPlayer(set group, playerid, true);
Like in this case it would be
Group_SetPlayer(factionid, playerid, false);
Maybe you guys have some ideas.. How could I set it as it's needs to be..
Code:
YCMD:makeleader(playerid, params[],help)
{
new targetid, factionid, string[128], targetname[24], playername[24];
if(sscanf(params, "ui", targetid, factionid)) return SendClientMessage(playerid, -1, "Usage: /makeleader [playerid][factionid]");
if(PlayerInfo[playerid][pAdmin] != 6) return SendClientMessage(playerid, -1, "You are not an admin");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!");
if(0 < factionid < 3)
{
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(targetid, targetname, sizeof(targetname));
format(string, sizeof(string), "You made %s leader of faction id %i!", targetname, factionid);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "You were made leader of faction id %i by %s", factionid, playername);
SendClientMessage(playerid, -1, string);
PlayerInfo[playerid][pFac] = factionid;
PlayerInfo[playerid][pLeader] = factionid;
}
else return SendClientMessage(playerid, -1, "Invalid factionid. Factionid's: 1-2");
return 1;
}
Thank you for your time.
With best regards Scrillex.
Re: Leader set... -
Scrillex - 04.01.2014
BUMP!