Jump to content

get| playerIP, playerAccount, accountName problem


Tete omar

Recommended Posts

function onTheGround ( player ) 
    local hisIP = getPlayerIP( player ) 
        local hisAccountName = getAccountName ( getPlayerAccount( player ) ) 
            triggerClientEvent ( player, "hisIPandhisaccount", player, hisIP, hisAccountName ) 
end 
addEventHandler("onResourceStart", resourceRoot, onTheGround) 

Debug Errors :

Bad argument @ 'getPlayerIP' [Expected element at argument 1, got resource-data]

Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got resource-data]

Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean]

I doubt that player element is the wrong

Link to comment
function onTheGround() 
     for i, player in pairs(getElementsByType("player")) do 
          local hisIP = getPlayerIP(player) 
          local hisAccountName = getAccountName(getPlayerAccount(player)) 
          triggerClientEvent(player, "hisIPandhisaccount", player, hisIP, hisAccountName) 
     end 
end 
addEventHandler("onResourceStart", resourceRoot, onTheGround) 

onResourceStart does not have player parameter.

Edit: you will still will have problem

You need to use setElementData.

and with event onPlayerJoin

Link to comment

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