-
Posts
1,461 -
Joined
-
Last visited
-
Days Won
34
Everything posted by DiSaMe
-
MTA supports health, armour, weapon and custom pickups, not just weapons. Make it a custom pickup and set the model ID.
-
Really? It has always worked fine for me. In video peds use getPedCameraRotation and setPedControlState to walk. They follow path nodes with no problems.
-
Why do you keep creating topics? If you're so curious, you could ask everything in one topic. You can't directly change weapons parameters. But it's scriptable. For example, script can detect when the player is hit by a weapon and lower his health, so it would imitate increased weapon damage.
-
Yeah, yeah... Where's the function makeTheServerARoleplayServer? Nowhere. But somehow people manage to run roleplay servers. That's what scripting is for.
-
What doesn't work? Does it output "Unable to open connect.xml" into chatbox or what?
-
With MTA functions you can do almost anything you can do in main.scm. And there's much you can do in MTA, but not in main.scm.
-
No, MTA doesn't use SCM functions at all. And it doesn't need them. It has its own functions.
-
As I said, you need trigonometry. Calculate the angle and set it with setPedCameraRotation.
-
You need setPedControlState and some trigonometry.
-
He wants to create water outside bounds of GTA SA map, so coordinates would be <-3000 or >3000. As far as I know, you can't do that. That must be GTA limitation, but it still would be nice to see MTA overcome it (it's not impossible, is it)
-
I don't know how PNG stores data. But uncompressed TXD textures store raster data in a similar way BMP files do. My script creates textures with DXT3 compression which stores data in 4x4 pixel blocks. Each block takes 16 bytes.
-
I learned about TXD files from here: http://www.gtamodding.com/index.php?tit ... tream_file. RW Analyzer by steve-m helped me a lot too.
-
There are two resources: drawtag and drawntag. Drawntag has TXD and a script which imports TXD and replaces a game texture with it. Drawtag has a client-side script for drawing. When you close drawing window, it sends image data to server. Server reads data, generates new TXD in drawntag and restarts that resource. So the texture changes. And drawtag also has a script which makes spray paint create tag object.
-
Less than 2 weeks ago RW binary stream files format seemed difficult to understand for me. Now it doesn't I have already requested the feature I wrote about in the video, but that was long time ago, when I hadn't even thought how important that feature is
-
addEventHandler("onClientRender",getRootElement(), function() if getTickCount()%2000 < 1000 then --draw it here end end )
-
The script is client-side, so object movement isn't synced. You need to make the script server-side. Alternatively, you can try attaching the event to all players (getRootElement() and checking element type in the function) and leaving the script client-side, but this way is less reliable.
-
Try changing local rx = x+(math.tan(math.deg(rz))) to local rx = x+math.tan(math.rad(rz))
-
Maybe you lose health with a value of 30 because Cheat engine doesn't set oxygen level that quick, so it lowers to 0?
-
When resource starts, to bind the key for all players, you must loop through them. function thisResourceStart () local players = getElementsByType ( "player" ) for _,this_player in ipairs(players) do bindKey ( this_player, "1", "down", stopEngine, "Lights on/off" ) end end To bind the key for players who join when resource has already started, put bindKey into function triggered by onPlayerJoin event. function playerJoined() bindKey ( source, "1", "down", stopEngine, "Lights on/off" ) end addEventHandler("onPlayerJoin",root,playerJoined) Function stopEngine seems to be fine, but we can shorten its code. function stopEngine ( player, key, state ) if getPedOccupiedVehicleSeat ( player ) == 0 then local vehicle = getPedOccupiedVehicle ( player ) setVehicleEngineState ( vehicle, not getVehicleEngineState ( vehicle ) ) end end By the way, I don't see what does that function argument "Lights on/off" mean
-
I think we need client-side file functions (fileOpen, fileWrite, etc.). If they were implemented, scripters could script this way of downloading files in their servers if they wanted.
-
First, you have to write numbers without [ and ] in these tables. To check if a table has the value, you can cycle through them. This code will check if current local player's weapon is included in table noreloadweapons: local is_weapon_in_table = false local player_weapon = getPedWeapon(getLocalPlayer()) for _,weapon_id in ipairs(noreloadweapons) do if player_weapon == weapon_id then is_weapon_in_table = true break end end if is_weapon_in_table then --the code executed if weapon is in the table end BUT there's much simpler way to do that if you store data in the table in other way noreloadweapons = {} noreloadweapons[16] = true noreloadweapons[17] = true noreloadweapons[18] = true noreloadweapons[19] = true noreloadweapons[25] = true --and continue this to 36 if noreloadweapons[getPedWeapon(getLocalPlayer())] then --the code executed if weapon is in the table end And if you don't want to show DX drawings with certain weapons, just don't draw them. They disappear 1 frame after they have been drawn, this is why you have to draw them in onClientRender.
-
You need to add command handler outside the function.
-
The code which gets health and armor of player should be put into the same function where drawing code is. And DX drawings don't detect resolutions, but you can use guiGetScreenSize().