Jump to content

Spakye

Members
  • Posts

    108
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Spakye

  1. Hi, you could use a command handler so player can writte an hex color code, save it with setAccountData then use the event onPlayerChat to get the color with getAccountData and apply it with outputChatBox. its basic but should work.
  2. Ahhhhh i think i get it now! Thanks for your time, really appreciated the help!
  3. Ty i didnt see my mistake ! Im a bit confused about the event "onPlayerReady" that you talk about, i can't find anything about it in the wiki. Though i did try to follow your instructions server side function setTimeOnJoin() timehour, timeminute = getTime() triggerClientEvent(source, "eventSetTimeOnJoin", source,timehour,timeminute) end -- addEventHandler ( "onPlayerJoin", getRootElement(), setTimeOnJoin ) addEvent( "playerIsReady", true ) addEventHandler( "playerIsReady", getRootElement(), setTimeOnJoin ) Client side function setTimeClientSide (timehour,timeminute) setTime(timehour,timeminute) end addEvent( "eventSetTimeOnJoin", true ) addEventHandler( "eventSetTimeOnJoin", localPlayer, setTimeClientSide ) addEventHandler("onPlayerReady", localPlayer, function() triggerServerEvent("playerIsReady", localPlayer) end)
  4. Ty for your reply its very helpfull ! i did take a look into theses functions but im a novice in scripting so its a bit overwhelming for me right now, but ill put myself into it when i get some more skills. I did code that, as a temporary fix : function setTimeOnJoin() timehour, timeminute = getTime() triggerClientEvent(source, "eventSetTimeOnJoin", source,timehour,timeminute) end addEventHandler ( "onPlayerJoin", getRootElement(), setTimeOnJoin ) function setTimeClientSide (timehour,timeminute) setTime(timehour,timeminute) end addEvent( "eventSetTimeOnJoin", true ) addEventHandler( "onPlayerJoin", localPlayer, setTimeClientSide ) i didnt have opportunity to test it with someone yet but i think it should work.
  5. local myCar = getPedOccupiedVehicle(source) Source of this event is the player that left vehicle not the vehicle itself, also you can directly use the vehicle argument of your function function removeHelmetOnExit ( vehicle, seat, jacked ) local engine = getVehicleEngineState (vehicle) if engine then setElementData(vehicle,"engine",1) elseif not engine then setElementData(vehicle,"engine",0) end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), removeHelmetOnExit )
  6. Hi, Im working on a server project and i would need some suggestion to synchronise clients clocks. I have zombies spawning only from 23:00 till 08:00, also a script change the weather during this period to create a mist, so everynight there is zombies everywhere and you see nothing. Tonight my gf joined the server so we could do some testing, and we realised our clocks were not synced wich just ruin all the night experience, when it was night for me it was day for her. Setting time from the admin panel does solve the problem but on the long run i would like a script to do that automaticly. So im wondering what would be the best way to do that. Each time a player join i could get the time server side and set it again ? or something else using a timer ? What do you thing would be the most efficent and less laggy for the server ?
×
×
  • Create New...