Question about y_groups
#1

I am just wondering, I might update my base script so people will stop asking me how to make factions... and this seems the easiest way :P (Atleast it will improve my scripting level and I know it aint the best way to do RP factions either way a good solid info for future wont hurt rite?)

Yes indeed I did read https://sampforum.blast.hk/showthread.php?tid=194480 and I do understand how to make a group however how do you actually "make people members" of a certain group? here I am baffled a bit about it (by a cmd) and kick out as well

I do understand few stuff from the original topic, not my fault what ****** writes is way too much for my brain
Reply
#2

pawn Код:
COMMAND:kick(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, 0x8094ABFF, "USAGE: /kick <player Id>");
    }
    else
    {
        if(IsPlayerConnected(strval(params))) // checking if the player is connected
        {
            if(Group_GetPlayer(/*group 'Id' here*/, strval(params)) == Group_GetPlayer(/*group 'Id' here*/, playerid)) // check if the player groups matches
            {
                Group_SetPlayer(/*group 'Id' here*/, strval(params), false); // remove the player from group
            }
        }
    }
    return true;
}
COMMAND:invite(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, 0x8094ABFF, "USAGE: /invite <player Id>");
    }
    else
    {
        if(IsPlayerConnected(strval(params))) // checking if the player is connected
        {
            Group_SetPlayer(/*group 'Id' here*/, strval(params), true); // invite the player to the group!
        }
    }
    return true;
}
You need to edit the CMD by yourself, but i gave you the base.
Don't know if there's any errors, didn't compile it.
Reply
#3

Quote:
Originally Posted by Skorch
Посмотреть сообщение
pawn Код:
COMMAND:kick(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, 0x8094ABFF, "USAGE: /kick <player Id>");
    }
    else
    {
        if(IsPlayerConnected(strval(params))) // checking if the player is connected
        {
            if(Group_GetPlayer(/*group 'Id' here*/, strval(params)) == Group_GetPlayer(/*group 'Id' here*/, playerid)) // check if the player groups matches
            {
                Group_SetPlayer(/*group 'Id' here*/, strval(params), false); // remove the player from group
            }
        }
    }
    return true;
}
COMMAND:invite(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, 0x8094ABFF, "USAGE: /invite <player Id>");
    }
    else
    {
        if(IsPlayerConnected(strval(params))) // checking if the player is connected
        {
            Group_SetPlayer(/*group 'Id' here*/, strval(params), true); // invite the player to the group!
        }
    }
    return true;
}
You need to edit the CMD by yourself, but i gave you the base.
Don't know if there's any errors, didn't compile it.
Yea but still It has to save that THAT player is a member of that group, wouldnt Enums be needed?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)