Jump to content

Problem on first load


Shidony

Recommended Posts

Posted

textePerso is defined at the start of the script, the problem is there i think:

triggerServerEvent("onClientGetCharacterInfos", source, 1) 
nomPerso = getElementData(source, "Personnage") 
argentPerso = getElementData(source, "argentPersonnage") 

Posted

Actually you should use localPlayer instead of source as i guess there something wrong with the trigger maybe?

Do you use any export at server side? it might that the exported resource haven't started yet.

Posted

Sorry for thread bumping but i found that the problem is here:

addEvent("onClientGetCharacterInfos", true ) 
addEventHandler("onClientGetCharacterInfos", root,  
function(characterID) 
    local name = tostring(getElementData(peds[characterID], "Nom")) 
    local argent = tonumber(getElementData(peds[characterID], "Argent")) 
    setElementData(source, "nomPerso", name) 
    setElementData(source, "argentPerso", argent) 
    outputChatBox(name, source, 0, 255, 255, false) 
    outputChatBox(argent, source, 0, 255, 255, false) 
end)  

The two outputChatBox send me the good values but when i use outputChatBox but here:

triggerServerEvent("onClientGetCharacterInfos", thePlayer, actualPerso[thePlayer]) 
     
    outputChatBox("2", 255, 255, 255, false) 
     
    nomPerso = getElementData(thePlayer, "nomPerso") 
    argentPerso = getElementData(thePlayer, "argentPerso") 
     
    outputChatBox(nomPerso, 255, 255, 255, false) 
    outputChatBox(argentPerso, 255, 255, 255, false) 

The two outputChatBox send me false.

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