Jump to content

[HELP]What's wrong with this?


Recommended Posts

Posted

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] 
  

Posted

try :D

  
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) 

mtaubluascripter.png

My skype: skiper964

I helped you? Help me! ^^

Help me bro! ^^

Posted

Jesse, the 'source' of onMarkerHit is the MARKER the player just hit.

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.

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