Jump to content

setElementData for strings


BriGhtx3

Recommended Posts

Posted

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%
Posted

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%
Posted

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%
Posted

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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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%
Posted

You'll have to trigger back to the client with

triggerClientEvent 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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%

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