y_groups makeleader... ****** I NEED YOU!
#1

Hello everyone...

I have some little thing whats needed to be understand how it's possible to do..

So I need to set player in group but the question is how..

My question is how can I set it to check players PlayerInfo[playerid][pFac] and equally to that set his group..

Like if players pFac = 1 then Set players group to Group_SetPlayer(Ballas, playerid, false);
Here is cmd..
pawn Код:
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(1 < factionid < 24)
    {
        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 - 24");
    return 1;
}
Reply
#2

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
Hello everyone...

I have some little thing whats needed to be understand how it's possible to do..

So I need to set player in group but the question is how..

My question is how can I set it to check players PlayerInfo[playerid][pFac] and equally to that set his group..

Like if players pFac = 1 then Set players group to Group_SetPlayer(Ballas, playerid, false);
Here is cmd..
pawn Код:
//code.
Do you notice something different? you used playerid(Code who used the command) instead of targetid(playerid who assigned)

Wrong
pawn Код:
PlayerInfo[playerid][pFac] = factionid, PlayerInfo[playerid][pLeader] = factionid;
Correct
pawn Код:
PlayerInfo[targetid][pFac] = factionid, PlayerInfo[targetid][pLeader] = factionid;
Reply
#3

Uhh my bad.. but still in the same point.. But thanks for your good eye.. just how to set group by it is the question.. I even can't imagine.. Because I already added it under player spawn as checker..
Reply
#4

BUMP!
Reply
#5

Could you provide the code were you create the Group (Group_Create) and load/sort the faction data?
Reply
#6

Yeah everything is done in that but I need to set it as it is.. Like Group_SetPlayer(faction, playerid, true);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)