BriGhtx3 Posted January 18, 2012 Posted January 18, 2012 Is there a way to set the data for a string like Boom? For example : setElementData("boom","dog","cow") Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
MIKI785 Posted January 18, 2012 Posted January 18, 2012 String is not element.. you can't. Lua Scripter Owner of mshost.cz MTA portal.
Maurize Posted January 18, 2012 Posted January 18, 2012 setElementData( element, "data", value ) --[[for code use:]] tostring( value ) or tonumber( value )
BriGhtx3 Posted January 18, 2012 Author Posted January 18, 2012 Miki i would not have asked if i didn't know that -.- Maurize thats not what i asked Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
BriGhtx3 Posted January 18, 2012 Author 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 ? Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Castillo Posted January 18, 2012 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) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
BriGhtx3 Posted January 18, 2012 Author 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. Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Castillo Posted January 18, 2012 Posted January 18, 2012 You'll have to trigger back to the client with triggerClientEvent San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
BriGhtx3 Posted January 18, 2012 Author Posted January 18, 2012 Okay, got it, but now it first puts out "---" and by the second time the real text :edit got it Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
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