Jump to content

setElementData for strings


BriGhtx3

Recommended Posts

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

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

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