Jump to content

dxDrawImage for 1 player


Recommended Posts

sry for doublepost but i got 1 problem left

when i login it doesnt directly draw my image,only when i kill someone

why doesnt this work?

function onLogin (_,account) 
    setElementData(source, "LV", getAccountData(account, "LV") or "0") 
    setElementData(source, "EXP", getAccountData(account, "XP") or "0") 
    local dLevel = getAccountData(account, "LV") or 0 
if dLevel == "100" then 
outputChatBox("1",root) 
triggerClientEvent(source,"onLevelHundred",source) 
outputChatBox("2",root) 
end 
addEventHandler ("onPlayerLogin", root, onLogin) 

it doesnt output anything and its server side

please help

Link to comment

If it doesn't output anything, then dLevel is not "100", besides, I think you meant:

if dLevel == 100 then 

maybe?

EDIT:

setElementData(source, "LV", getAccountData(account, "LV") or "0") 
    setElementData(source, "EXP", getAccountData(account, "XP") or "0") 
    local dLevel = getAccountData(account, "LV") or 0 

I don't understand why first 2 times "or "0"" and then "or 0" btw.

Link to comment

'123' and "123" are strings. 123 = int = number :P

And it depends on how you save it. You can use the string too but then you have to put 'tonumber(string)' for example.

btw im using or 0 to see if its new account and if it is it sets it to 0

Oh right, forgot that one. ^^

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