SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/01/2014, 02:35 AM   #1
Scrillex
High-roller
 
Scrillex's Avatar
 
Join Date: Jan 2012
Location: In my dreams!
Posts: 1,226
Reputation: 31
Default Leader set...(y_groups)

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.
__________________
If you need something just ask!


Last edited by Scrillex; 04/01/2014 at 05:23 PM.
Scrillex is offline   Reply With Quote
Old 04/01/2014, 05:23 PM   #2
Scrillex
High-roller
 
Scrillex's Avatar
 
Join Date: Jan 2012
Location: In my dreams!
Posts: 1,226
Reputation: 31
Default Re: Leader set...

BUMP!
__________________
If you need something just ask!

Scrillex is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
leader cmd Dw.UsHer Scripting Help 3 13/03/2012 08:14 PM
[Help]Leader? Tamao_Serizawa Scripting Help 2 17/01/2012 02:12 AM
Leader name Qur Scripting Help 8 19/11/2011 08:04 AM
member becomes a leader? Nemanja92 Help Archive 11 28/12/2010 10:43 PM
Leader help JoeDaDude Help Archive 1 10/05/2009 12:58 PM


All times are GMT. The time now is 02:08 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.