-
Posts
1,461 -
Joined
-
Last visited
-
Days Won
34
Everything posted by DiSaMe
-
Wouldn't it be easier to use dxDrawMaterialLine3D to draw the oil?
-
1. What do you mean by 'synchronization'? 2. What's so wrong about onResourceStart?
-
You seem to call triggerServerEvent with other arguments than I would expect. The first argument is the source and the following ones are passed as parameters to the handler function. So 'localPlayer' on the client becomes 'source' on the server, 'test' becomes 'cop', and 'cop' is ignored. Maybe localPlayer isn't supposed to be passed to triggerServerEvent, so that 'test' would become 'source' and 'cop' would remain 'cop'?
-
It's not hard to make the code flow visible. You can make the script output the lines using outputDebugString or some other output function. Like this: outputDebugString("doSomething()") doSomething() outputDebugString("doSomethingElse(argument)") doSomethingElse(argument) Making the code flow visible without modifying the script itself is harder. That requires reading the file from another script, then finding the separate statements, inserting new lines which output the information and then use loadstring to execute the resulting string as lua code.
-
Well, /debugscript in MTA does the same.
-
setPlayerMoney/givePlayerMoney/takePlayerMoney:
-
Then for sure it doesn't work because you check the points which the player had when resource started. You need to get the points every time before you check them.
-
To transfer the data between client and server, you need to use: setElementData or triggerClientEvent triggerServerEvent But I don't see any reason why you would need to use client-side script at all in this case. Setting money client-side does not change it server-side.
-
i will use this, but thanx, i will have example whenever i create other peds now This won't work. Although waiting a short moment is likely to give the clients enough time to stream in the ped, it's still not guaranteed, and what's more, this only looks correct as long as the client is in streaming range when the ped is created. As I said, you need to apply the animation when the ped gets streamed in.
-
Server: ped1 = createPed( 87, -285.9, 1206, 73.5 ) setElementDimension( ped1, 1 ) setElementID(ped1, "ped1") Client: ped1 = getElementByID("ped1") addEventHandler("onClientElementStreamIn", ped1, function() setPedAnimation( source, "STRIP", "PLY_CASH") end )
-
Some data is not kept by MTA client when the ped is streamed out. It's MTA problem. If server sets animation immediately after creating the ped, he won't be streamed in for any player, therefore no one will see him performing the animation. To workaround this problem, use a client-side script which applies the animation when the ped triggers onClientElementStreamIn.
-
attachTrailerToVehicle
-
getElementPosition getElementVelocity getElementRotation getVehicleTurnVelocity setElementPosition setElementVelocity setElementRotation setVehicleTurnVelocity setTimer
-
No shaders are needed. Make a circle from multiple rectangles using dxDrawImageSection.
-
You need to detect when certain controls are pressed and use setPedAnimation to make the player perform another running animation.
-
If you want to render the view from all points on the same client, then it will lag because the game can only render one view per frame. Something can be achieved without significant lag. For example, if you update the view of security camera every 30 frames rather than 1 frame, then your own view will only slow down every 30 frames with 1 security camera. With 2 security cameras, it would slow down every 15 frames. But lag isn't the biggest problem. Moving the camera long distances in short time intervals cause sync and LOD visibility problems. There is another way which may look better, but uses more computing power: make a script which keeps taking the screen data of the client and sending it to the server. The server sends that data to all players who are near security monitors. Then players will see the screen of the client. This way uses bandwidth and requires to run a few clients on the server for screen data, but won't have glitches.
-
I see nothing wrong here.
-
your_string:len() > 3
-
http://bugs.multitheftauto.com/view.php?id=5781 I don't know if that's going to allow us to fully control body parts or just affect them in a limited way. Sure, it would be nice to have a full control.
-
No need to "convert". Implementing the function in MTA will do the trick. function AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, angle, color1, color2) local vehicle = createVehicle(modelid, spawn_x, spawn_y, spawn_z, 0, 0, angle) local c1, c2, c3, c4 = getVehicleColor(vehicle) setVehicleColor(vehicle, color1, color2, c3, c4) toggleVehicleRespawn(vehicle, true) setVehicleRespawnDelay(vehicle, 60000) return vehicle end Add this function to the script and then you can call AddStaticVehicle.
-
You made it? Wow, I thought it was my airbrake script with modified controls... You have to use arctangent function to get the camera rotation angle. Like this: setPedRotation(localPlayer,math.deg(math.atan2(ctx,cty))) You may need to make the angle negative for this to work.
-
How to get free scripters? Simple. Make a good server and people may want to join you. So if you're a good scripter, you may be able to attract scripters. If you can't, then nobody will want to form a team with you and you either need to learn to script or pay people to make scripts.