05.08.2017, 10:43
(
Last edited by verlaj; 26/08/2017 at 07:32 PM.
)
Group System (2) Beta
Note: The script is currently in beta stage. And also, i will soon create the include file for this system to be used in the gamemode.
Introduction
Note: The script is currently in beta stage. And also, i will soon create the include file for this system to be used in the gamemode.
Introduction
This group system supports 10 groups per player and not just that, each group can have as many ranks as it demands but thats not just it. You can also create sperate permission structure for each rank (editable in-game). Now lets head to some details.
Requirements
PHP Code:
#include <izcmd>//zex
#include <sscanf2>//y less
#include <easydialog> //emette
#include <foreach> //y less
#include <y_iterate> //y less
#include <strlib> //by slice
Info related to table structure
This system uses three different tables. one for players, one for groups and the other one if for the ranks. I have also made sure that these tables are linked to each other by both the group id and the rank id. Therefore, make sure that you have these tables properly structured in your DB.
Basic commands and the method used.
PHP Code:
CMD:grouphelp(playerid,params[])
{
SCM(playerid,COLOR_GREY,"Group Commands");
SCM(playerid,COLOR_GREY,"/groups /groupinfo(ID) /creategroup /groupinvite /g /groupkick /groupranks");
SCM(playerid,COLOR_GREY,"/GroupEditRank /GroupSetRank /GroupCreateRank /GroupMembers /Gcp");
return 1;
}
Here are some of the useful functions. All are self-explanatory.
PHP Code:
GetGroupID(gropname[])
GroupLoopCheckName(playerid, grpname[])
GroupLoopCheck(playerid, groupid)
ReturnGroupName(playerid, groupslot)
forward CheckPlayerGroup(playerid, groupid);
forward CheckPlayerGroupPermission(playerid, groupid, permission);
forward CheckPlayerGroupRankLevel(playerid,groupid,level);
forward ReturnGroupLevel(playerid, groupid);
Built in group control panel
A panel which could be used by the leaders. Pretty average but estatic!
The panel offers various options, mostly interactable.
PHP Code:
strcat(dialogstr, sprintf("{59D983}Group Name\t%s(ID:%d)
", GroupInfo[groupid][gName], groupid));
strcat(dialogstr, sprintf("{22A1E0}Group Leader\t%s
", GroupInfo[groupid][gLeaderName]));
strcat(dialogstr, sprintf("{59D983}Credits\t%i
", GroupInfo[groupid][gCredits]));
strcat(dialogstr, sprintf("{59D983}Resources\t%i
", GroupInfo[groupid][gResources]));
strcat(dialogstr, sprintf("{59D983}Perks
"));
strcat(dialogstr, sprintf("{59D983}Color
"));
strcat(dialogstr, sprintf("{59D983}War Wins\t%i
", GroupInfo[groupid][gWarWins]));
strcat(dialogstr, sprintf("{22A1E0}Group Level\t%i
", GroupInfo[groupid][gLevel]));
strcat(dialogstr, sprintf("{22A1E0}Group Scores\t[%i / %i]
", GroupInfo[groupid][gScore], ((50+i)*i)));
strcat(dialogstr, sprintf("{22A1E0}Group Points\t%i
", GroupInfo[groupid][gWarWins]));
strcat(dialogstr, sprintf("{59D983}Group Members
"));
Perk system, group leveling, skill points
A have created a simple perk system which you could use if you like. You can also decide the perk cost which is currently skill points at the current moment. Perk cost also increases with the group level.Group leveling is a basic scripted system. A system which progressively becomes more and more difficult to level up. (note: you must set the group score bonus yourself for this to work) [Ill create an include file for use later on]
Skill points are awarded when a group level ups. These can be spent on the group perks.
There is also a credit converter which has a exchange rate, 1 cr = 1000$. See for yourself.
Thanks To
Code:
SAMP Team for everything. Y_Less for y includes and sscanf. Zex for izcmd Slice for strlib
Please notify. I am yet to spot them.