Jump to content

DarkStalker30

Members
  • Posts

    36
  • Joined

  • Last visited

  • Days Won

    1

DarkStalker30 last won the day on April 6

DarkStalker30 had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

DarkStalker30's Achievements

Rat

Rat (9/54)

8

Reputation

  1. I found another way. On start interface resource add and instant remove armor to localPlayer, it's turning on armor bar, then taking health bar coords, armorY + (healthY - armorY) / 2 = breathY. And it's working perfect. UPDATE: for correct working of this method you need to let armor bar to be drawn for 1 frame at least. I used a timer, which checking armorX and armorY, until they became not 0, 0.
  2. That's something that I want to do. And if breath bar has its coords, then all ok. But if not, then stamina bar going to left top corner. I just can't upload images. If character will be in water while player has black screen by fadeCamera() and HUD off, will it trigger breath bar?
  3. Hi guys. In 1.6 was added some new functions for HUD. I liked the idea to use it to draw my stamina bar in place, where is breath bar by default. But then I got a problem - until the player gets into the water, breath bar x, y = 0, 0. Is there a way to force draw that bar without going into water?
  4. Okay then, thanks a lot! I will try it later
  5. Well, looks like it can be changed with timer too smooth transition. But it will take time to figure this out. If really, I don't understand how can I freeze lighting. Timer with setSkyGradient()? SetWorldProperty() looks interesting, but many works to do as well. I guess, for now I leave it, because my server on early stage of development. So if I can to do it simple and hacky way - I will do it, if not - then leave it.
  6. Hi guys, didn't write some time, but now want to return. I have an idea to use different weather on the map, because as you know in single SA different regions have different weather. I find a way to do it - when player changing region (prototype for now, in future will do collision cubes) start setWeatherBlended() and then accelerate game time with setMinuteDuration(), after it return time to the server. But it has problem, because with fast time you will get fast day and night. If in some border time like between 20:00 and 22:00 you can even didn't notice it, then at another time it's too obvious. Is there a way to freeze lighting to create illusion of not changing time?
  7. Well, I tried to use it, but GPT very stupid in code, really. And stupid by itself. You probably don't want to use it for real code, only for ideas or simple monkey job. And it's loving to invent new functions in standard MTA, so you need to check it on wiki or in IDE with code highlighting. I guess it's because on MTA not so many free code in network. Maybe new versions will can do it better, but not now.
  8. You can save your coordinates to the variables, and the use them to build text. Like: local rectangleStartX = x*1200 local rectangleWidth = x*1400 dxDrawText(rectangleStartX + rectangleWidth + 10, etc...) But i'm not sure right now about your coordinates, because "width" for dxDrawRectangle - it's not the endpoint, if wiki is right And then code will be more easy, because for width you can use just "200". As for take coordinates from rectangle - well, looks like it can't be done in MTA. P.S. I'm not good in UI scripting, just trying to help with simple logic.
  9. Solution: local shader = dxCreateShader("texture.fx", 0, 0, false, "ped") Thanks @IIYAMA for help!
  10. "*" applies shader to all textures. And I already tried this, found name of texture in skin page and wrote it. Didn't work.
  11. Hello everyone, I'm trying to work with shaders. For now it just simple texture replace, but I can't apply it on local player. Other textures change OK. texture.fx code (simplest): texture myTexture; technique ClothesShader { pass P0 { Texture[0] = myTexture; } } Client code: local shader = dxCreateShader("texture.fx") local texturesTable = { [1] = dxCreateTexture("1.png"), [2] = dxCreateTexture("2.png"), [3] = dxCreateTexture("3.png") } addCommandHandler("testclothe", function(_, variant) variant = tonumber(variant) if variant > 0 and variant < 4 then dxSetShaderValue(shader, "myTexture", texturesTable[variant]) engineApplyShaderToWorldTexture(shader, "*", localPlayer) end end) No any errors, all files added in meta.xml. As I said before, this code can apply shader to all textures, if delete "localPlayer" from arguments, but it can't apply on player, and I can't understand, why. I readed on wiki "engineApplyShaderToWorldTexture", and saw the recommend of using argument "elementTypes" as "ped" or "all", but if it's the problem, then I don't know, what to put in other arguments (and I think that default value of this argument include "all"). If need, can add screenshots, but it only duplicates that text message.
  12. Yes, I've already did strings like that, and it works correctly (not when I'm trying to do multiple statement). I can't remember, where I found it, but it was on MTAWiki 99%, or some resource which was referenced by wiki. Example: local insertString = "INSERT INTO `houses`\ (`house_owner_id`, `house_enter_x`, \ `house_enter_y`, `house_enter_z`, `house_enter_rotation`, \ `house_exit_x`, `house_exit_y`, `house_exit_z`, \ `house_exit_world`, `house_exit_dimension`, `house_exit_rotation`, \ `house_interior_type`, `house_base_price`, `house_current_price`) \ VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);" Works 100% good, no errors or data corruption in tables. I didn't knew about this, I'll check. But if the problem in that flag, this is weird, that error by MySQL. Yes, this is the solution. Thank you very much, I would never have guessed where is the problem.
  13. Hello everyone, I have a problem with database. I'm trying to add outfit into database and update player's info, but every time I'm getting this trouble: String to use: local insertString = "INSERT INTO `inventories`(`inventory_type`, \ `inventory_big_sells`, `inventory_mid_sells`, `inventory_small_sells`, \ `inventory_max_weight`, `inventory_owner_id`) VALUES \ ('outfit','0','0',?,'-1',?);\ UPDATE `chars_invs` SET `char_inv_outfit`=? WHERE `char_inv_id`=?;" It looks like correct SQL code. In phpMyAdmin SQL field I tried too, and it didn't create any errors, but in MTA it's not work. I can guess that because nearby "UPDATE" appears ', but I don't know how to fix that. Any ideas?
  14. Да. Well, I assumed that. Okay, if with sirens I can creating something new, did you find any another ways to script work for that models? Or it can work only on standard models (I read bugreport and find all I now right now about non-working models, but I have no idea how it can be fixed by MTA scripts)? Thanks for framework, but I'm trying to do as much as possible by myself, because it's interesting for me in that way. And thanks for help!
  15. Во втором куске я просто пропустил часть кода, так как там ещё срабатывает пара штук, и модель, если она оригинальная, переопределяется там же. Как я уже писал, на стандартных работает хорошо, на заменённых - нет, но оно добавляется, так как звук есть. В первом не совсем понял смысла дописывать ещё один setElementData, так как это происходит при спавне машины, и он уже есть. newModelName - это как раз оно, я просто тут тоже не весь код привёл, чтобы он не таким большим был, но забыл, что некоторые детали могут быть важны Короче, все эти исправления, которые ты предложил, у меня уже есть, и оно всё равно не работает))
×
×
  • Create New...