Jump to content

Passing variables problem


steadyfi

Recommended Posts

Posted

Hello.

How can I pass Booleans and Floats to other sides ? I know that triggerClientEvent, triggerServerEvent, setElementData only work with elements.

Is it possible or I just need to work more with each side ?

Thanks :D

  • MTA Team
Posted

Are those floats/booleans same for each player?

Why do not simply use the trigger_Event functions?

Posted (edited)
Are those floats/booleans same for each player?

Why do not simply use the trigger_Event functions?

Some of them are global and some for each player, i just need to know how I can pass them.

Edited by Guest
  • MTA Team
Posted

You can actually use the resourceRoot to pass the data to each player.

setElementData(resourceRoot, "info", { a = "yes", position = {200.5, 1205.2, -2} }) 

If you have to send data to a specific player, then you have to first send a signal clientside, that the client resource has started and then send the data back to the player

triggerLatentClientEvent(player, "eventName", resourceRoot, { somedata = true }) 

Posted
You can actually use the resourceRoot to pass the data to each player.
setElementData(resourceRoot, "info", { a = "yes", position = {200.5, 1205.2, -2} }) 

If you have to send data to a specific player, then you have to first send a signal clientside, that the client resource has started and then send the data back to the player

triggerLatentClientEvent(player, "eventName", resourceRoot, { somedata = true }) 

Thanks :D ! Now I can continue my gamemode :)

SOLVED

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