Jump to content

[REL]Group System


Smart.

Recommended Posts

Posted
I'm testing this system in my server and sometimes the players lose his team (the founder) so the team is deleted, any bug there? No errors in the debugscript, sometimes the bug is in this line:
function printManagment(player) 
    if (player) then player = client end 
    local group = getPlayerGroup(client) 
    for ind, data in pairs(GAC) do 
        if (data[1] == group) then 
            local rank, warning, joined, lastTime = GAC[ind][2], GAC[ind][3],GAC[ind][4], GAC[ind][5] 
            triggerClientEvent(client, "groupSystem.addToList", client, tostring(ind), rank, warning, joined, lastTime, "N/A", getAccountPlayer(getAccount(ind))) --Here is the error (Bad Argument @ getAccountPlayer) 
        end 
    end 
end 
addEvent("groupSystem.print", true) 
addEventHandler("groupSystem.print", root, printManagment) 

I have no clue, haven't played MTA in ages.

whaat is the exported function to get the turf color? i mean the function that returns with r,g,b?

r,g b = getGroupChatColor(groupString)

Thanks for the positive feedback! :)

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Posted
I'm testing this system in my server and sometimes the players lose his team (the founder) so the team is deleted, any bug there? No errors in the debugscript, sometimes the bug is in this line:
function printManagment(player) 
    if (player) then player = client end 
    local group = getPlayerGroup(client) 
    for ind, data in pairs(GAC) do 
        if (data[1] == group) then 
            local rank, warning, joined, lastTime = GAC[ind][2], GAC[ind][3],GAC[ind][4], GAC[ind][5] 
            triggerClientEvent(client, "groupSystem.addToList", client, tostring(ind), rank, warning, joined, lastTime, "N/A", getAccountPlayer(getAccount(ind))) --Here is the error (Bad Argument @ getAccountPlayer) 
        end 
    end 
end 
addEvent("groupSystem.print", true) 
addEventHandler("groupSystem.print", root, printManagment) 

I have no clue, haven't played MTA in ages.

whaat is the exported function to get the turf color? i mean the function that returns with r,g,b?

r,g b = getGroupChatColor(groupString)

Thanks for the positive feedback! :)

is the argument the group name?

  • 2 weeks later...
Posted
I'm testing this system in my server and sometimes the players lose his team (the founder) so the team is deleted, any bug there? No errors in the debugscript, sometimes the bug is in this line:
function printManagment(player) 
    if (player) then player = client end 
    local group = getPlayerGroup(client) 
    for ind, data in pairs(GAC) do 
        if (data[1] == group) then 
            local rank, warning, joined, lastTime = GAC[ind][2], GAC[ind][3],GAC[ind][4], GAC[ind][5] 
            triggerClientEvent(client, "groupSystem.addToList", client, tostring(ind), rank, warning, joined, lastTime, "N/A", getAccountPlayer(getAccount(ind))) --Here is the error (Bad Argument @ getAccountPlayer) 
        end 
    end 
end 
addEvent("groupSystem.print", true) 
addEventHandler("groupSystem.print", root, printManagment) 

I have no clue, haven't played MTA in ages.

whaat is the exported function to get the turf color? i mean the function that returns with r,g,b?

r,g b = getGroupChatColor(groupString)

Thanks for the positive feedback! :)

is the argument the group name?

yep

  • 2 weeks later...
Posted
is there any turf system which works with this groups sysstem?

Take a look at this one: https://community.multitheftauto.com/index.php?p=resources&s=details&id=9056. Specially made to work with this group system and open source as well. Just remember to verify that the exported functions to get turf color and team color are in the meta.xml file of the group system.

<export function="getGroupChatColor" type="server"/> 
<export function="getGroupTurfColor" type="server"/> 

It's currently in an early beta state and has only been quickly scripted and tested so there are some configuration to do to make it work, like a few variable names and other exports, but except for that it seems to be pretty appreciated after all. For some reason the whole inspiration for the turf system came from this group system so a special thanks to Smart for the group system.

Posted
can you add group level..

nice works

Group level? There's group ranks already where you can modify the rank permissions?

I'm also planning on improving this system or writing some of the missing functions such as making the group logs or perhaps something else you'd like to see?

Posted
is there any turf system which works with this groups sysstem?

Take a look at this one: https://community.multitheftauto.com/index.php?p=resources&s=details&id=9056. Specially made to work with this group system and open source as well. Just remember to verify that the exported functions to get turf color and team color are in the meta.xml file of the group system.

<export function="getGroupChatColor" type="server"/> 
<export function="getGroupTurfColor" type="server"/> 

It's currently in an early beta state and has only been quickly scripted and tested so there are some configuration to do to make it work, like a few variable names and other exports, but except for that it seems to be pretty appreciated after all. For some reason the whole inspiration for the turf system came from this group system so a special thanks to Smart for the group system.

co

thanks..

can you give me a working link for the resource 'ac-message' ?

Posted
is there any turf system which works with this groups sysstem?

Take a look at this one: https://community.multitheftauto.com/index.php?p=resources&s=details&id=9056. Specially made to work with this group system and open source as well. Just remember to verify that the exported functions to get turf color and team color are in the meta.xml file of the group system.

<export function="getGroupChatColor" type="server"/> 
<export function="getGroupTurfColor" type="server"/> 

It's currently in an early beta state and has only been quickly scripted and tested so there are some configuration to do to make it work, like a few variable names and other exports, but except for that it seems to be pretty appreciated after all. For some reason the whole inspiration for the turf system came from this group system so a special thanks to Smart for the group system.

I have a question about your turf system.. it works but when i create a turf and i capture it, then i restart the resource the turf gets created but the owner is set to 'none'

Posted
is there any turf system which works with this groups sysstem?

Take a look at this one: https://community.multitheftauto.com/index.php?p=resources&s=details&id=9056. Specially made to work with this group system and open source as well. Just remember to verify that the exported functions to get turf color and team color are in the meta.xml file of the group system.

<export function="getGroupChatColor" type="server"/> 
<export function="getGroupTurfColor" type="server"/> 

It's currently in an early beta state and has only been quickly scripted and tested so there are some configuration to do to make it work, like a few variable names and other exports, but except for that it seems to be pretty appreciated after all. For some reason the whole inspiration for the turf system came from this group system so a special thanks to Smart for the group system.

I have a question about your turf system.. it works but when i create a turf and i capture it, then i restart the resource the turf gets created but the owner is set to 'none'

Ask questions about that resource on it's own page, this thread is for the group system only.

Posted

How can I show gang and rank on the scoreboard?

getPlayerGroup(player) -- get the group string of the player

getGroupMembers(group) -- returns a table of the player(s) inside that group (not entirely sure whether I finished this function, if not I will soon)

Posted
is there getGroupTurfColor in that code ?? :?::roll:

In the server lua, I feel stupid now since I can't remember if I added these by myself or if they where included from the beginning, anyway these 2 functions can be used to get turf color and chat color, if they not in the system already it's easy to add.

function getGroupChatColor(group) 
    if (not groupTable[group]) then return 255, 255, 255 end 
    local color = fromJSON(groupTable[group][3]) 
    return color[1], color[2], color[3] 
end 
  
function getGroupTurfColor(group) 
    if (not groupTable[group]) then return 255, 255, 255 end 
    local color = fromJSON(groupTable[group][6]) 
    return color[1], color[2], color[3] 
end 

And secondly, there is a security bug in the function attemptMakeGroup(), it's explained here: http://mta.albonius.com/index.php?topic=457.0, and a solution is included as well. I recommend you all to see it if you want to prevent special characters from being used to steal existing groups. Remember to backup your database first, and it's already commonly exploited by many players.

  • 1 month later...
Posted
is there getGroupTurfColor in that code ?? :?::roll:

In the server lua, I feel stupid now since I can't remember if I added these by myself or if they where included from the beginning, anyway these 2 functions can be used to get turf color and chat color, if they not in the system already it's easy to add.

function getGroupChatColor(group) 
    if (not groupTable[group]) then return 255, 255, 255 end 
    local color = fromJSON(groupTable[group][3]) 
    return color[1], color[2], color[3] 
end 
  
function getGroupTurfColor(group) 
    if (not groupTable[group]) then return 255, 255, 255 end 
    local color = fromJSON(groupTable[group][6]) 
    return color[1], color[2], color[3] 
end 

And secondly, there is a security bug in the function attemptMakeGroup(), it's explained here: http://mta.albonius.com/index.php?topic=457.0, and a solution is included as well. I recommend you all to see it if you want to prevent special characters from being used to steal existing groups. Remember to backup your database first, and it's already commonly exploited by many players.

Tjenare,

They were included.

  • 2 months later...
Posted

After many many many many days I've added group balance which lets you store money in the group. Obviously the amount will be saved using sql.

It has NOT been tested too thoroughly so if you find a bug let me know and I'll fix it.

This means there is a new export which is: getGroupBankAmount(group) which returns the balance (I recommend using groupTable[group][7] inside the script because it's basically the same thing).

You can also decide who's able to withdraw money using the rank editor and everybody is able to deposit and if the logging is enabled it's logged. In-fact I've made all group outputs logged (only if it's turned on)

  • 2 months later...
  • 2 months later...
Posted

Help!! i type /gc but the message don't output in the chatbox

The group bank too, when i deposit money in the bank my money descrase but the money balance stays nil and i cant withdraw

Posted
Help!! i type /gc but the message don't output in the chatbox

The group bank too, when i deposit money in the bank my money descrase but the money balance stays nil and i cant withdraw

Have you configured it to work with a SQL database of some sort? Also, what does your debugscript say when you attempt to chat, or withdraw money?

Posted
Have you configured it to work with a SQL database of some sort? Also, what does your debugscript say when you attempt to chat, or withdraw money?

if you mean MySQL then no i didn't :/

Here's the debug:

When i click deposit:

http://i.imgur.com/ZYCm3v3.png

When i click Withdraw:

http://i.imgur.com/u39C78R.png

And when i type /gc :

http://i.imgur.com/uGXI27l.png

Also, i thought smart added the log feature, why it says in chat that its not available yet?

Posted

The group system is designed to work with an SQL database system of some sort. That's probably why a lot of features aren't working for you.

Posted
The group system is designed to work with an SQL database system of some sort. That's probably why a lot of features aren't working for you.

Oh SQL, then where i have to put my SQL details in the script (hostname, username, password) ??

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...