Jump to content

getAccountData


TorNix~|nR

Recommended Posts

Posted

Hello guys, I have this code, I don't know why it's not working correctly

when I have 2999 zombie kills, I can't join the clan, and when I have 3001 zombie kils, I can't join the clan too :/ help please?

	local account = getPlayerAccount(source)
    if getAccountData(account, "Zombie kills") < 3000 then -------------
	outputChatBox("fail", source)
	return end

 

76561198387870432.png

ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003

560x95_FFFFFF_FF9900_000000_000000.png

Posted

Should work. Try this:

if tonumber(getAccountData(account, "Zombie kills")) < 3000 then

 

  • Sad 1

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

Posted (edited)

Try to output in chat the content of the account data. Maybe it's not a number?

Do this in a separate function:

function testStuff (player)

local acc = getPlayerAccount (player)

if acc and isGuestAccount (acc) then return end

local data = getAccountData (acc, "Zombie kills")

if data then

outputChatBox (data, player, 255, 0, 0)

end

addCommandHandler ("testdata", testStuff)

Just type "testdata" in chat and tell me what comes up. Server side script btw.

Edited by koragg
  • Thanks 1

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

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