Jump to content

getPlayerGang - Group System


xXMADEXx

Recommended Posts

Posted

Im making vehicle spawners, but for some reason getting the gang is failing... I don't know why.

Error:

ERROR: call: failed to call "[ROG]Groups:getPlayerGang" [string "?"] 

Code:

    addEventHandler("onMarkerHit",marker, 
        function (p) 
            local getGang = exports['[ROG]Groups']:getPlayerGang(p) 
            if (getGang==group) then 
                triggerClientEvent(p,"showGroupVehicleSpawners",p,cars) 
            else 
                triggerClientEvent(p,"message:centerText",p,"Your not in "..group, 3, 255, 0, 0) 
            end 
        end 
    ) 
  
-- This is what i use to create the spawner: 
addGroupSpawner({1319.1091308594, -2584.6645507813, 13.5390625, -90}, {411, 412}, {120, 0, 255}, "Military") 

Posted
triggerClientEvent(p,"message:centerText",p,"Your not in "..group, 3, 255, 0, 0)

..group should be ..group..

Not really, because there is a comma ( , ) at the end of ..group, if there would be other quotation, for example:

"Your not in "..group.."so you can't use this command.", 3, 255, 0, 0) 

Then yes, at the end of 'group' should be 2 dots, but not in this case ;)

76561198066470453.png

SP37Ecj.jpg?2MTA:Rust Pre-Alpha Build v.0.3:SP37Ecj.jpg?2

https://forum.mtasa.com/viewtopic.php?f=114&t=97848

2Pac: ''Only God can judge me!''

Posted

Make sure the function is exported on the meta.xml of "[ROG]Groups".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Make sure the function is exported on the meta.xml of "[ROG]Groups".

Yea, it is. I use that "if" statment in my gate scripts, and it works fine, i really have no idea why it won't work in this one...

Here is the export:

<export function="getPlayerGang" type="server" /> <!-- Arguments: thePlayer. Returns: The gang. --> 

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