BriGhtx3 Posted January 18, 2012 Share Posted January 18, 2012 Is there a way to set the data for a string like Boom? For example : setElementData("boom","dog","cow") Link to comment
MIKI785 Posted January 18, 2012 Share Posted January 18, 2012 String is not element.. you can't. Link to comment
Maurize Posted January 18, 2012 Share Posted January 18, 2012 setElementData( element, "data", value ) --[[for code use:]] tostring( value ) or tonumber( value ) Link to comment
BriGhtx3 Posted January 18, 2012 Author Share Posted January 18, 2012 Miki i would not have asked if i didn't know that -.- Maurize thats not what i asked Link to comment
BriGhtx3 Posted January 18, 2012 Author Share Posted January 18, 2012 New thing : --Clientside thesitetext = tostring(triggerServerEvent("getText",getLocalPlayer(),url)) --ServerSide function getSiteText(site) local thetext = tostring(MySQL_GetString("web", "Text", "Site='"..site.."'")) return thetext end addEvent("getText",true) addEventHandler("getText",getRootElement(),getSiteText) Why does it return true? But when I output it serverside it outputs the text ? Link to comment
Castillo Posted January 18, 2012 Share Posted January 18, 2012 Why don't you check the wiki page for that function? Wiki quote:Returns Returns true if the event trigger has been sent, false if invalid arguments were specified. -- client side: triggerServerEvent("getText",getLocalPlayer(),url) -- server side: function getSiteText(site) local thetext = MySQL_GetString("web", "Text", "Site='"..site.."'") return thetext end addEvent("getText",true) addEventHandler("getText",getRootElement(),getSiteText) Link to comment
BriGhtx3 Posted January 18, 2012 Author Share Posted January 18, 2012 Yes but i don't know how to output the text clientside. It still just returns true and not the text. Link to comment
Castillo Posted January 18, 2012 Share Posted January 18, 2012 You'll have to trigger back to the client with triggerClientEvent Link to comment
BriGhtx3 Posted January 18, 2012 Author Share Posted January 18, 2012 Okay, got it, but now it first puts out "---" and by the second time the real text :edit got it 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