Jump to content

jingzhi

Members
  • Posts

    288
  • Joined

  • Last visited

Everything posted by jingzhi

  1. Hello everyone, I am now working on a login system. I noticed in the mta wiki that it is recommended to use the function passwordHash to encrypt passwords. However, they also said that there can be short freezes if using this algorithm. Although I already used a call back function as they suggested, I still want to make sure it will not cause any lag in the server. Has anyone used this function yet? Please tell me what happens when using this function (especially on a server with many players). Thanks in advance!
  2. As it indicated in the wikipage of dxDrawText (https://wiki.multitheftauto.com/wiki/DxDrawText), the font scale can be splitted into 2 variables. However, I am not quite sure how to do that. Can anyone give me an example on how can it be implemented? Thanks in advance!
  3. Hi everyone, I am working on a general database script and I am wondering if establishing multiple database connections in different resources will affect the performance. If that is true, can database connections be shared in different resources(e.g. by exporting function)? Thanks in advance! Moreover, if I export a function that uses database connection to a different resource, does the function use the dbconnection established in the resource exporting the function, or it must use the connection in the resource I'm calling the function from?
  4. Make sure the group of your db user is set to "host"
  5. I remember there is an event that is triggered when the player starts entering a vehicle, you can use this one and if the engine is off then after the player enter the vehicle use setEngineState to turn it off. When the player exit you can just easily use the onPlayerVehicleExit trigger and turn the engine off with setEngineState
  6. Dude you should learn a lot more then come back and ask....
  7. jingzhi

    Help

    Lol answer from the original creater
  8. Show the full code, also show your codes with the "lua" funcion, otherwise it's hard to read
  9. use getVehicleHandling() The max speed is also depending on the road
  10. Hello! meta = xmlLoadFile ("meta.xml") for index,node in pairs ( xmlNodeGetChildren ( meta ) ) do xmlLoadFile returns false, here is the xml file: Any thoughts?
  11. Hello, I have made it as you said, don't know if it will work or not. What exactly do these events work? ( how to apply these 2 events in this very script ?)
  12. Here is a part of arresting system scripts: addEvent("onPlayerArrested",true) addEventHandler("onPlayerArrested",root, function(arrestercop) arrester = arrestercop toggleAllControls(false,true,false) fadeCamera() setCameraTarget(arrestercop) addEventHandler("onClientRender",root,cuffed) end) function cuffed() local copx, copy, copz = getElementPosition (arrester) local x, y, z = getElementPosition (localPlayer) local rx, ry, _ = getElementRotation (localPlayer) local dist = getDistanceBetweenPoints2D (copx, copy, x, y) local relx = copx - x local rely = copy - y if rely == 0 then if relx < 0 then copangle = 90 else copangle = 270 end else if rely > 0 then local copangle = 360 - math.deg(math.atan(relx / rely)) % 360 else local copangle = 180 - math.deg(math.atan(relx / rely)) end end setElementRotation(localPlayer,_,_, copangle) if dist < 5 then setControlState("forwards", false) setControlState("sprint", false ) else setControlState("forwards", true) setControlState("sprint", true ) if dist > 50 then setElementPosition(localPlayer,copx,copy,copz) end end end The arrested players can still change the direction when they move the mouse, any help?
  13. Use getElementPosition() setTimer() This won't give you the most precise mileage (should be smaller than the actual number), but it also won't cause any lag
  14. Are you looking for this? : setVehicleHandling
  15. jingzhi

    Radio

    Do you mean this: playSFX
  16. Firstable, you should use executeSQLQuery instead Read and learn more : https://wiki.multitheftauto.com/wiki/Database
  17. I didn't realize that, thanks! I have another question, too small for making it a post. Can you get a return in server-side, by a client-side? Or vice versa You can just use triggerServerEvent to trigger back
×
×
  • Create New...