Jump to content

Link2012

Members
  • Posts

    19
  • Joined

  • Last visited

Link2012's Achievements

Square

Square (6/54)

0

Reputation

  1. Yeah, it works, see my second edit on my second post
  2. But there's no real difference in doing local minute = real.minute doStuff(minute) and doStuff(real.minute) Can't see the point
  3. It IS defined https://wiki.multitheftauto.com/wiki/GetRealTime EDIT: kay, you edited the post when I was posting this stuff, let me try what you've posted EDIT 2: Okay, works, thanks... But real.minute IS defined
  4. How to implement a real time clock? I tried: setTimer(function() local real = getRealTime() setTime(real.hour, real.minute) end, 500, 0) But the sky starts flickering =/
  5. Yeah, but the position is for different vehicle models for a unique coordinate (tried that center of mass something and it return 0.0)
  6. Nope, the vehicle shouldn't move. With setElementFrozen the vehicle freeze on the air (while spawning, going to the ground), tried with isVehicleOnGround but it returns true even when the cars touch a bit with the wheel on the ground.
  7. Works, thanks, But explosions still affect the preview vehicle, anyway to disable explosions to physically move my ghost vehicle?
  8. How can I make a client vehicle (that is, created client-side, visible only for the client) ghost for collision with other elements? This vehicles is a preview vehicle and I don't want others disturbing the preview. Actually when some guy hits the preview vehicle the guy that hitted it doesn't feels nothing (since there's no vehicle for the guy) and for me that see the preview vehicle, the vehicle flies off from the collision. I tried setElementCollisionsEnabled, but the vehicle starts floating right after the spawn, My next try should be maybe setElementCollidableWith with all the players\vehicles present in game, but what if another vehicle get spawned? How can I make my client vehicle uncollidable?
  9. So the answer is: there's no difference?
  10. You didn't understand, really (I expected I didn't had to say that doStuff and doMoreStuff are pseudo-funcs) What I mean is, what's the difference between putting my functions\commands\whatever_I_Want_To_Do in onClientResourceStart and on the "main part" of the lua file, since the "main part" of the lua file has started, it means that the resource started, right?
  11. he, what's the difference between doing: doStuff() doMoreStuff() and addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()) , function(res) doStuff() doMoreStuff() end ); I can't see the point...
  12. The title tells everything, is it safe? I mean, the user can go there and edit the XML and that's it, he can buy items with the price he wants to? The XML is downloaded into client-side because it will be used in the GUI-creation to show the price and other stuff.
  13. Your ideia seems good, see this little pseudo-code and tell me if this is the way: -- server.lua function onTryLogin(login, password) -- check login and password code triggerClientEvent("onLoginReturnState", getRootElement(), return_code) end addEvent, bla bla bla -- client.lua coroutine_handle = 0 function onLoginReturnState(return_code) coroutine.resume(coroutine_handle, return_code) end function onButtonLoginClick() -- assume this is a coroutine created somewhere when the button is clicked -- bla bla bla triggerServerEvent("onTryLogin", bla bla bla) exit_code = coroutine.yield() -- check exit code etc end addEvent bla bla bla
  14. I understand this, read again my question, my question is the best way to return a exit code from a event, for example: Client GUI sends a event to the server (triggerServerEvent) saying "Hey server, this guy is trying to log with login: leet and password: 1337", if the account doesn't exist the server returns a error code (to the client) and if the accout exists and the login succeeded the server returns a success code.
×
×
  • Create New...