Deihim007 Posted July 2, 2017 Share Posted July 2, 2017 Hi Community i wrote this script for setting a specif player wanted level: function setWanted (source,cmd,wanted) local account = getPlayerAccount(source) if not account or isGuestAccount(account) then return end local accountName = getAccountName(account) if not isObjectInACLGroup("user."..accountName,aclGetGroup("Admin")) then return end exports["PoliceDatabase"]:setPlayerWanted(client,wanted) outputChatBox(..account.."Wanted Set To:"..wanted) end addCommandHandler ( "setwanted", setWanted ) and the Exported function: function setPlayerWanted(player, amount) and get this error:[2017-07-02 16:02:47] ERROR: Cmd\SetWanted\s_SetWanted.lua:7: attempt to concatenate global 'wanted' (a nil value) Link to comment
WorthlessCynomys Posted July 2, 2017 Share Posted July 2, 2017 In XML <export function="setWanted" type="shared" /> In script exports.theNameOfTheResourceTheFunctionIsIn:setWanted(arguments) Link to comment
Moderators IIYAMA Posted July 2, 2017 Moderators Share Posted July 2, 2017 Sometimes it is better to use the call function. Because some how it can fail to pass arguments, which I think is very strange. call Link to comment
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