NotAvailable Posted July 26, 2011 Share Posted July 26, 2011 Hi, i'm getting an boolean error, i tried to fix it several times but i keep getting that annoying boolean error. Server-side code: function checkHim() local playerAcc = getPlayerAccount(source) if (getAccountData(playerAcc, "efr.license") == false ) then triggerClientEvent("noLicense", source) else triggerClientEvent("gotLicense", source) end end addEventHandler("onMarkerHit", gunMarker, checkHim) The error: WARNING: EFRammu/shop.c.lua:17: Bad argument @ 'getAccountData' [Expected account at argument 1, got boolean] Link to comment
#Paper Posted July 26, 2011 Share Posted July 26, 2011 try function checkHim(player, matchingDimension) if getElementType( player) == "player" then local playerAcc = getPlayerAccount(player) if (getAccountData(playerAcc, "efr.license") == false ) then triggerClientEvent("noLicense", player) else triggerClientEvent("gotLicense", player) end end end addEventHandler("onMarkerHit", gunMarker, checkHim) Link to comment
Castillo Posted July 27, 2011 Share Posted July 27, 2011 Jesse, the 'source' of onMarkerHit is the MARKER the player just hit. Link to comment
NotAvailable Posted July 27, 2011 Author Share Posted July 27, 2011 Jesse, the 'source' of onMarkerHit is the MARKER the player just hit. Ohh thanks Castillo I thought the source was the player that hit the marker. Link to comment
NotAvailable Posted July 29, 2011 Author Share Posted July 29, 2011 Thanks acitanox T_T Thanks Acitanox! (Sorry, i forgot to thank you, was a bit busy ) 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