Rat32 Posted May 10, 2015 Posted May 10, 2015 Hey! serverside: function nadajkolory() kontod = getPlayerAccount(source) r = setAccountData(kontod, "kolor", 56) g = setAccountData(kontod, "kolor2", 24) b = setAccountData(kontod, "kolor3", 67) a = getAccountData(kontod, "kolor") b = getAccountData(kontod, "kolor2") c = getAccountData(kontod, "kolor3") triggerClientEvent(source, "kolorely", resourceRoot, a,b,c) end addEventHandler("onPlayerLogin", getRootElement(), nadajkolory) client: function dajkolor(a, b, c) setVehicleColor(kar, tonumber(a)..","..tonumber(b)..","..tonumber(c)) outputChatBox(a..","..b..","..c) end addEventHandler("kolorely", getRootElement(), dajkolor) In debugstring i have "Incorret numbers, but outputChatBox say good: "x, x, x". Any help?
Walid Posted May 10, 2015 Posted May 10, 2015 function nadajkolory(_,cur) local r,g,b = 56 , 24 , 67 local a,b,c = setAccountData(cur, "kolor", r),setAccountData(cur, "kolor2", g),setAccountData(cur, "kolor3", b) triggerClientEvent(source, "kolorely", source, r,g,b) end addEventHandler("onPlayerLogin", getRootElement(), nadajkolory) function dajkolor(a, b, c) setVehicleColor(kar, tonumber(a)..","..tonumber(b)..","..tonumber(c)) outputChatBox(a..","..b..","..c) end addEvent("kolorely",true) addEventHandler("kolorely", root, dajkolor)
Moderators IIYAMA Posted May 10, 2015 Moderators Posted May 10, 2015 Don't ask me why it gives that error, since it should not give you that one on that line... Yet, this is/was your problem: setVehicleColor(kar, tonumber(a) or 0,tonumber(b) or 0,tonumber(c) or 0)
Moderators IIYAMA Posted May 10, 2015 Moderators Posted May 10, 2015 Then you got the wrong line. Something wrong with your text editor?
Moderators IIYAMA Posted May 12, 2015 Moderators Posted May 12, 2015 "atempt to concetante a nil value" = "what ever" .. nil setVehicleColor(kar, tonumber(a) or 0,tonumber(b) or 0,tonumber(c) or 0) Do you see here .. ?????? I don't think so...
karer Posted May 12, 2015 Posted May 12, 2015 b = setAccountData(kontod, "kolor3", 67) [...] b = getAccountData(kontod, "kolor2") You're overwriting 'b' variable ;d
Enargy, Posted May 12, 2015 Posted May 12, 2015 client addEvent("kolorely", true); function dajkolor(a, b, c) setVehicleColor(getPedOccupiedVehicle(localPlayer), a,b,c); outputChatBox(a..","..b..","..c); end addEventHandler("kolorely", getRootElement(), dajkolor) server function nadajkolory(_, kontod) if kontod then r = setAccountData(kontod, "kolor", 56); g = setAccountData(kontod, "kolor2", 24); b = setAccountData(kontod, "kolor3", 67); a = getAccountData(kontod, "kolor"); b = getAccountData(kontod, "kolor2"); c = getAccountData(kontod, "kolor3"); if ( tonumber(a) and tonumber(b) and tonumber(c) ) then triggerClientEvent(source, "kolorely", resourceRoot, a,b,c); end end end addEventHandler("onPlayerLogin", getRootElement(), nadajkolory)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now