xXMADEXx Posted April 7, 2013 Posted April 7, 2013 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") The Ultimate Lua Tutorial! | MTA PHP SDK
alcholistu Posted April 7, 2013 Posted April 7, 2013 triggerClientEvent(p,"message:centerText",p,"Your not in "..group, 3, 255, 0, 0) ..group should be ..group..
..:D&G:.. Posted April 7, 2013 Posted April 7, 2013 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 MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
xXMADEXx Posted April 7, 2013 Author Posted April 7, 2013 triggerClientEvent(p,"message:centerText",p,"Your not in "..group, 3, 255, 0, 0)..group should be ..group.. No, because "..group is the last thing, but if i was going to be that way, i would have to do "Your not in "..group..'!" The Ultimate Lua Tutorial! | MTA PHP SDK
xXMADEXx Posted April 7, 2013 Author Posted April 7, 2013 The resource "[ROG]Groups" is not started. yes, it is. The Ultimate Lua Tutorial! | MTA PHP SDK
Castillo Posted April 7, 2013 Posted April 7, 2013 Make sure the function is exported on the meta.xml of "[ROG]Groups". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
xXMADEXx Posted April 8, 2013 Author Posted April 8, 2013 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. --> The Ultimate Lua Tutorial! | MTA PHP SDK
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now