Jump to content

setElementData, waiting for sync?


dzek (varez)

Recommended Posts

Posted

ok, im getting crazy with all those events

to script simple mission i need a lot of events,

it was easier to script main.scm

nvm

function startMission()
triggerServerEvent('startMission', getLocalPlayer()) -- this creates vehicle, and puts player into it
-- and also do setElementData (thePlayer, "missionVehicle", createdVehicle)
-- now i want to read element data, and set an client exit vehicle event
-- but i cannot, becouse of lag, between sending data
end
addEventHandler ( "onClientGUIClick", myBtn, startMission, false )

so, should i create next freaking event, for waiting data to sync? or theres another way.. maybe i dont know something yet?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

ok, im getting crazy with all those events

to script simple mission i need a lot of events,

it was easier to script main.scm

nvm

function startMission()
triggerServerEvent('startMission', getLocalPlayer()) -- this creates vehicle, and puts player into it
-- and also do setElementData (thePlayer, "missionVehicle", createdVehicle)
-- now i want to read element data, and set an client exit vehicle event
-- but i cannot, becouse of lag, between sending data
end
addEventHandler ( "onClientGUIClick", myBtn, startMission, false )

so, should i create next freaking event, for waiting data to sync? or theres another way.. maybe i dont know something yet?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
ok, im getting crazy with all those events

to script simple mission i need a lot of events,

it was easier to script main.scm

nvm

function startMission()
triggerServerEvent('startMission', getLocalPlayer()) -- this creates vehicle, and puts player into it
-- and also do setElementData (thePlayer, "missionVehicle", createdVehicle)
-- now i want to read element data, and set an client exit vehicle event
-- but i cannot, becouse of lag, between sending data
end
addEventHandler ( "onClientGUIClick", myBtn, startMission, false )

so, should i create next freaking event, for waiting data to sync? or theres another way.. maybe i dont know something yet?

Well, in the 'startMission' function you could put the event handler in the "setElementData" (or the trigger for a client event) so you'll be sure that the data has already been synced.

Posted
ok, im getting crazy with all those events

to script simple mission i need a lot of events,

it was easier to script main.scm

nvm

function startMission()
triggerServerEvent('startMission', getLocalPlayer()) -- this creates vehicle, and puts player into it
-- and also do setElementData (thePlayer, "missionVehicle", createdVehicle)
-- now i want to read element data, and set an client exit vehicle event
-- but i cannot, becouse of lag, between sending data
end
addEventHandler ( "onClientGUIClick", myBtn, startMission, false )

so, should i create next freaking event, for waiting data to sync? or theres another way.. maybe i dont know something yet?

Well, in the 'startMission' function you could put the event handler in the "setElementData" (or the trigger for a client event) so you'll be sure that the data has already been synced.

Posted

Gamesnert,

i think i explained it clearly.

on client side im triggering server side event to create a vehicle, setElementData for player, containing a reference to created vehicle then i want to create client side event onClientVehicleExit..

but Jumba' explained it well, thanks

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Gamesnert,

i think i explained it clearly.

on client side im triggering server side event to create a vehicle, setElementData for player, containing a reference to created vehicle then i want to create client side event onClientVehicleExit..

but Jumba' explained it well, thanks

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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