[FilterScript] Group System (2). [MySQL\Dynamic Rank and permission system]
#1

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


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;

Now the method i use is quite simple. Each player has an array slot (of 10) which is used by a GroupLoopCheck function to find and match the required group or the rank from the given player. This method is pretty useful as it simplifies things when creating new commands or functions relating to group or rank detection.


Here are some of the useful functions. All are self-explanatory.

PHP Code:
GetGroupID(gropname[])
GroupLoopCheckName(playeridgrpname[])
GroupLoopCheck(playeridgroupid)
ReturnGroupName(playeridgroupslot)
forward CheckPlayerGroup(playeridgroupid);
forward CheckPlayerGroupPermission(playeridgroupidpermission);
forward CheckPlayerGroupRankLevel(playerid,groupid,level);
forward ReturnGroupLevel(playeridgroupid); 
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(dialogstrsprintf("{59D983}Group Name\t%s(ID:%d) "GroupInfo[groupid][gName], groupid));
    
strcat(dialogstrsprintf("{22A1E0}Group Leader\t%s "GroupInfo[groupid][gLeaderName]));
    
strcat(dialogstrsprintf("{59D983}Credits\t%i "GroupInfo[groupid][gCredits]));
    
strcat(dialogstrsprintf("{59D983}Resources\t%i "GroupInfo[groupid][gResources]));
    
strcat(dialogstrsprintf("{59D983}Perks "));
    
strcat(dialogstrsprintf("{59D983}Color "));
    
strcat(dialogstrsprintf("{59D983}War Wins\t%i "GroupInfo[groupid][gWarWins]));
    
strcat(dialogstrsprintf("{22A1E0}Group Level\t%i "GroupInfo[groupid][gLevel]));
    
strcat(dialogstrsprintf("{22A1E0}Group Scores\t[%i / %i] "GroupInfo[groupid][gScore], ((50+i)*i)));
    
strcat(dialogstrsprintf("{22A1E0}Group Points\t%i "GroupInfo[groupid][gWarWins]));
    
strcat(dialogstrsprintf("{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
Bugs

Please notify. I am yet to spot them.

Reply
#2

I wouldn\'t recommend providing only a Mediafire link, make it easier for people to check the code up and use
Pastebin and Github
Reply
#3

done
Reply
#4

not working group
Reply
#5

Not bad 5/10
Reply
#6

You should really make your system work both as an include or filterscript. My reasoning is this and I have learned first hand it is pretty much pointless to do any real work in OnPlayerConnect() until the player actually logs in. So that is where the include would be useful by disabling OnPlayerConnect() and requiring the end user to implement the use of loading when a player actually logs in.
Reply
#7

how to /gwar?
please update /gwar and gang zone system.
Reply
#8

Quote:
Originally Posted by Pottus
View Post
You should really make your system work both as an include or filterscript. My reasoning is this and I have learned first hand it is pretty much pointless to do any real work in OnPlayerConnect() until the player actually logs in. So that is where the include would be useful by disabling OnPlayerConnect() and requiring the end user to implement the use of loading when a player actually logs in.
Alright.

Quote:
Originally Posted by NewFreeroamStunt
View Post
how to /gwar?

please update /gwar and gang zone system.
I am currently trying to fix some bugs and rework some of the commands. The next update shall be stable, so, as of now i won\'t recommend using this FS unless you are able to understand it well.
Reply
#9

Looks good,

downloading
Reply
#10

Nice,
Reply
#11

Updates:


*Stabilized the system. Now supports 10 groups per player.

*Added group control panel with some interesting features.

*Added afew more commands.


Note: this filterscript is meant to be edited by you. Please do not complain if you find the command structure incomplete. Also, i will link the include file for the next update(soon).
Reply
#12

Nice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)