Question about y_groups - 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: Question about y_groups (
/showthread.php?tid=299393)
Question about y_groups -
iNorton - 25.11.2011
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
Re: Question about y_groups -
WooTFTW - 25.11.2011
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.
Re: Question about y_groups -
iNorton - 25.11.2011
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?