Jump to content

weird problem


Castillo

Recommended Posts

hey, i've found a really weird problem at my script, i'm triggering from client side some datas and when i want to get them at server keeps saying "nil", if i change the argument positions at function it will work some times but its really annoying to catch them all working, here is my code.

function editDatas(cliente,evento,color,bank,cash) 
local jug = getElementData(cliente,"clickedPlayer") 
local charjug = getElementData(cliente,"clickedCharacter") 
if evento == "color" then 
exports.CasHaw:setCharacterData(jug,charjug,"redcolor",color[1]) 
exports.CasHaw:setCharacterData(jug,charjug,"greencolor",color[2]) 
exports.CasHaw:setCharacterData(jug,charjug,"blueolor",color[3]) 
outputChatBox("Colors changed to: ".. color[1] ..":".. color[2] ..":".. color[3] .."!",cliente,0,255,0) 
elseif evento == "bank" then 
exports.CasHaw:setCharacterData(jug,charjug,"bank",tostring(bank)) 
outputChatBox("Bank balance set to: ".. tostring(bank) .."!",cliente,0,255,0) 
elseif evento == "cash" then 
exports.CasHaw:setCharacterData(jug,charjug,"cash",tostring(cash)) 
outputChatBox("Hand money set to: ".. tostring(cash) .."!",cliente,0,255,0) 
   end 
end 
addEvent( "changeCharData", true ) 
addEventHandler( "changeCharData", getRootElement(),editDatas) 

Link to comment
i can only say two things

1. debug. you are here for long time and still can't debug?

2. indentations. you are scripting for long time and still not making proper indentations? o.O

2nd one makes me too lazy to check what's your code doing and where could be error

what do you mean with "debug"?? its output when i execute the function "nil" ..

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