Jump to content

Group/Fraction system based on SQL


Recommended Posts

Hi guys. Can u tell me which fuctions  from mta:wiki should I use to make this system. I want in this system: saving group to the player based on sql, indvidual commands for group. Like a Police - /arrest, Medics /heal. For all groups leader panel inlc. cmd /invite /kick. For admin /creategroup /setownergroup. I think in sql I need some table which saves values like a loginplayer, nicknameplayer, idGroup, nameGroup, leaderGroup, membersGroup? and make permission system for indvidual cmd but which fuction is responsible for that ?

Edited by M3Mori3s93
Link to comment

Hello. You have to use the SQL functions, which are:

dbConnect()
dbQuery()
dbPoll()
dbExec()

If you need further explanation about how to use SQL, send me a message and I'll try to explain it.

You also have to check the access of the player, which is a simple if-then.

So like, I have a value from SQL that he is a police member. The variable of this value is for example: group. So if the player does something that requires the police group you do it that way:

if (group == "police") then
  -- Do something
end

Same here, if you need further explanation, I'll be glad to help you.

Other way is to store players in ACL groups, but that is not SQL based.

Link to comment

Hi. So I made this fraction system based on mysql and create table with values like id fraction and name fraction, but now I have a question. I have my login/register system in other resource/file and in other table in my MySQL base. My login/register system save a values like a id player, login, password, money, nick, weapons, positions, interior and all values saves when player leave a game and set when he log in on account but how I should call value "id_fraction" from system fraction table to my login/register system and save this id_fraction to player account? 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...