04.01.2014, 02:35
(
Last edited by Scrillex; 04/01/2014 at 05:23 PM.
)
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..
Thank you for your time.
With best regards Scrillex.
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; }
With best regards Scrillex.