YSI:Groups
From SA-MP Wiki
Contents |
Group system
Intro
What is a Group?
A group is a collection of people, just like in real life. The idea of groups is that they are an abstraction from other methods of collecting people. For example if you have admins in your mode then an admin level is a collection of players - i.e. certain players (a group of players) are in an admin level, in the same way the people in a faction or the people in a gang are a group together.
Using groups you can quickly define groups of people for any purpose and can easily define what they can and can't do.
Functions
Create a Group
Group_Create(name[] = ""); This function creates the group. The name need to be your group name.
new group; public OnGameModeInit() { group = Group_Create("My first group"); return 1; }
Create a temporary group.
Group_CreateTemp(); I don't know what this function does do. I hope Alex Cole will see this and explain this function.
Rename a group.
Group_NameGroup(groupid, name[]); This function change the name of the group you want.
Group_NameGroup(group, "My first renamed group");
Set a class for a group
Group_SetClass(groupid, class, set);
Groupid = The group you've made. class = This is the skin id. set = 0 The skin is not allowed. 1 The skin is allowed for the group.
public OnGameModeInit() { Group_SetClass(group, 252, 1); return 1; }
Set a default class for a group.
Group_SetDefaultClass(class, set);
Class = Need to be the class id like:
new class; public OnGameModeInit(); { class = Class_Add(254, x, y, z, a, 38, 500, 34, 500, 32, 500); Group_SetDefaultClass(class, 0); }
Set = 1 is allowed. 2 is not allowed.
Foot note of the creator of this page
I'm not finished with this page, but i just don't have it anymore, tomorrow i going finish this page.