.:HyPeX:. Posted February 18, 2014 Share Posted February 18, 2014 Im getting return "true", when there's no reason specified for that... client: function RadioButtonClick() local cash = triggerServerEvent("getAccData", getLocalPlayer(), "cash") local row, column = guiGridListGetSelectedItem ( RadioGrid ) local name = guiGridListGetItemText( RadioGrid, row, 1 ) outputChatBox(cash) for i, v in ipairs(Wheels) do if tostring(v.upgrade) == tostring(name) then if cash >= v.price then local cash = cash - v.price triggerServerEvent("setAccData", getLocalPlayer(), "cash", cash) outputChatBox("#00aaff[WheelPanel]: Wheels Bought!", 255,255,255,true) v.price = "Bought!" else outputChatBox("#00aaff[WheelPanel]: You dont have enought money!", 255,255,255,true) end end end end server: function getAccData(data) outputChatBox("Recived player: ".. getPlayerName(source), getRootElement(), 255,255,255,true) outputChatBox("Recived data: ".. data, getRootElement(), 255,255,255,true) local acc = getPlayerAccount(source) local data = getAccountData(acc, data) return data end addEvent("getAccData", true) addEventHandler("getAccData", getRootElement(), getAccData Link to comment
Moderators Citizen Posted February 18, 2014 Moderators Share Posted February 18, 2014 Can you please give us more details about your problem ? Because I didn't get it, I just understood that you are getting true as result but dunno where. Link to comment
Noki Posted February 18, 2014 Share Posted February 18, 2014 "Wheels" isn't defined. I don't know why you're looping that. Can you please post the exact debug? Link to comment
.:HyPeX:. Posted February 18, 2014 Author Share Posted February 18, 2014 "Wheels" isn't defined. I don't know why you're looping that.Can you please post the exact debug? There's no error, im reciving true as a return, Due to triggerClientEvent has no return part, it is returning true becouse it was successful, i need a way to take it back to client-side. About the wheels thing: Wheels = { { name = "Big Ray Wheel", price = "25000", upgrade = 1074 }, { name = "Black Badass", price = "25000", upgrade = 1076 }, { name = "Black Style Wheels", price = "25000", upgrade = 1085 }, { name = "Common Badass", price = "25000", upgrade = 1098 }, { name = "NFS Wheel 1", price = "25000", upgrade = 1075 }, { name = "Cool Wheel 1", price = "25000", upgrade = 1077 }, { name = "Styled Black", price = "25000", upgrade = 1096 }, { name = "Cool Grey", price = "25000", upgrade = 1081}, { name = "NFS Wheel 2", price = "25000", upgrade = 1080 }, { name = "Organe", price = "25000", upgrade = 1073 }, { name = "Cool Wheel 2", price = "25000", upgrade = 1078 }, { name = "Golden Style", price = "25000", upgrade = 1025 }, { name = "Really White Wheels", price = "25000", upgrade = 1082 }, { name = "Cool Wheel 3", price = "25000", upgrade = 1079 }, { name = "Cool Rays", price = "25000", upgrade = 1083 }, { name = "NFS Wheel 3", price = "25000", upgrade = 1097 }, { name = "4x4", price = "25000", upgrade = 1084 } } Link to comment
Saml1er Posted February 18, 2014 Share Posted February 18, 2014 "Wheels" isn't defined. I don't know why you're looping that.Can you please post the exact debug? There's no error, im reciving true as a return Are you sure? addEventHandler("getAccData", getRootElement(), getAccData There is a missing bracket ")". Link to comment
AboShanab Posted February 18, 2014 Share Posted February 18, 2014 .:HyPeX:. : add me in your skype name of my skype : alooy.almajhol Link to comment
AboShanab Posted February 18, 2014 Share Posted February 18, 2014 function getAccData(data) local acc = getPlayerAccount(source) if not ( isGuestAccount(acc) ) then local data = getAccountData(acc, data) return data outputChatBox("Recived player: ".. getPlayerName(source), getRootElement(), 255,255,255,true) outputChatBox("Recived data: ".. data, getRootElement(), 255,255,255,true) else return false end end addEvent("getAccData", true) addEventHandler("getAccData", getRootElement(), getAccData) Link to comment
Moderators Citizen Posted February 18, 2014 Moderators Share Posted February 18, 2014 function getAccData(data) local acc = getPlayerAccount(source) if not ( isGuestAccount(acc) ) then local data = getAccountData(acc, data) return data outputChatBox("Recived player: ".. getPlayerName(source), getRootElement(), 255,255,255,true) outputChatBox("Recived data: ".. data, getRootElement(), 255,255,255,true) else return false end end addEvent("getAccData", true) addEventHandler("getAccData", getRootElement(), getAccData) What's that ? Is it supposed to be the solution you made with him through skype ? If yes, then nice code ! (ironic) You are doing two outputs after a return statement. Even if that function is working as expected. Link to comment
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