Jump to content

Dzsozi (h03)

Members
  • Posts

    682
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Dzsozi (h03)

  1. So how can I make the nitro level visible with dx functions to players when they enter a vehicle?
  2. Hey guys! So today i tried to make a nitro-o-meter thing. So when you enter a vehicle and if it has nitro in it you should see a rectangle which is displays the nitro level. But it's not working for some reason, and I don't know why. Can somebody help me please? Here's my code: function drawNitro() dxDrawRectangle(1330, 950, fNitroLevel, 45, tocolor(0, 255, 0, 255), false) end function displayNitroLevel(pPlayer) if pPlayer == localPlayer then if getVehicleUpgradeOnSlot( source, 8 ) then -- Check if the vehicle has nitro installed local fNitroLevel = getVehicleNitroLevel(source) addEventHandler("onClientRender", root, drawNitro) --outputChatBox("The nitro level of this " .. getVehicleName(source) .. " is " .. fNitroLevel .. ".", 255, 180, 20, false) end end end addEventHandler("onClientVehicleEnter", root, displayNitroLevel) P.S.: I used wiki's example of 'getVehicleNitroLevel'.
  3. Hello, so today I found a picture on the web which is about a rectangular, GTA V style radar on MTA, here's a bit of the picture: My question is that how can I make the blips always visible inside the rectangle and rotate with the camera in this resource: https://community.multitheftauto.com/in ... ls&id=8883 So as you can see in the picture, the forklift icon is at the left bottom corner inside the rectangle radar, I think this icon is on the other island, maybe at the chilliad or something. So how can I make this instead of simple images on the map? I would be really grateful if someone could help me in this. Thank you!
  4. Hello everyone! Today I tried the triggering stuff, but it's not working. I don't know why. Can somebody help me please? This script is about when the engine is broken and you try to start it, it should start play a sound. Here's this part of the code: Server if (vehKey) or (owner < 0) and (faction == -1) or (playerFaction == faction) and (faction ~= -1) or (exports.global:isPlayerAdmin(source)) then local fuel = getElementData(veh, "fuel") local broke = getElementData(veh, "enginebroke") if broke == 1 then exports.global:sendLocalMeAction(source, "megpróbálja beindítani a jármûvet, de nem sikerül.") exports["notifications"]:showBox(source, "error", "A jármű motorja sérült.") triggerClientEvent ("onMotorSerult",getRootElement()) end end Client addEvent ("onMotorSerult",true) addEventHandler ("onMotorSerult",getRootElement(), function () local jatekosjarmu = getPedOccupiedVehicle(localPlayer) local x, y, z = getElementPosition(jatekosjarmu) motor = playSound3D("startup.mp3", x, y, z, false) setSoundMaxDistance(motor, 30) end )
  5. Not working and my fps jumped to 7 from 60 How can I do this with guiCreateStaticImage?
  6. Hello guys, so today I made a new hud. My problem is that I need to get the player's skin in picture, so how can I say... The image should be match with the ID and draw it in a picture on the hud. But mine is not working. Can somebody help me please? Here's a part of the code where this skin part is. local screenX, screenY = guiGetScreenSize() local skinID = tonumber(getPlayerSkin(localPlayer)) dxDrawImage(screenX*0.8505 , screenY*0.0915, 104, 104, "img/" .. skinID .. ".png")
  7. Okay, thank you, I'll try it tomorrow and tell you what's the result
  8. Hi guys, so I have a skin shop resource, my problem is that it doesn't contains a "Cancel" function, which is about to get your skin back, which was before you entered a marker. I hope you understand me. So I tried to make it, but it's not working. It's like when you press enter (the button which select the skin), it not gets your skin back. I would be grateful if somebody could help me in this! Thanks. local skinek = { 2, 7, 12, 13, 16, 19, 20, 21, 22, 23, 24, 25, 26, } local index = { } local skinshopmarker = createMarker ( 199.1015625, -127.908203125, 1002.4151977539, "cylinder", 1.5, 245, 140, 20, 200 ) setElementInterior(skinshopmarker, 3) setElementDimension(skinshopmarker, 128) model = getElementModel(player) function Kivalaszt ( player ) showCursor ( player, true ) bindKey ( player, "backspace", "down", MegseSkin ) bindKey ( player, "enter", "down", Spawn ) bindKey ( player, "arrow_l", "down", ValasztasSkin ) bindKey ( player, "arrow_r", "down", ValasztasSkin ) fadeCamera ( player, true ) index [ player ] = 1 setElementPosition ( player, 215.9755859375, -132.9267578125, 1003.5078125 ) setPedRotation ( player, 90 ) --setElementRotation ( palyer, 0, 0, 0 ) setElementInterior(player, 3) setElementDimension(player, 128) setElementFrozen ( player, true ) setCameraMatrix ( player, 211.48049926758, -132.75520324707, 1003.0266723633, 212.47685241699, -132.76715087891, 1003.1111450195 ) setCameraInterior( player, 3 ) end addEventHandler("onMarkerHit", skinshopmarker, Kivalaszt) function MegseSkin ( player ) setElementModel(player, model) showCursor ( player, false ) setElementPosition ( player, 207.9072265625, -132.1884765625, 1003.3125 ) setPedRotation ( player, 173 ) setElementInterior(player, 3) setElementDimension(player, 128) setElementFrozen ( player, false ) setCameraTarget ( player, player ) end function ValasztasSkin ( player, key ) if ( key == "arrow_l" ) then if ( index [ player ] == 1 ) then index [ player ] = #skinek else index [ player ] = ( index [ player ] - 1 ) end else if ( index [ player ] == #skinek ) then index [ player ] = 1 else index [ player ] = ( index [ player ] + 1 ) end end --outputChatBox ( index [ player ] ) setElementModel ( player, skinek [ index [ player ] ] ) playSoundFrontEnd ( player, 32 ) end function Spawn ( player ) showCursor ( player, false ) playSoundFrontEnd ( player, 44 ) --outputChatBox("!", player, 0, 255, 0) unbindKey ( player, "backspace", "down", MegseSkin ) unbindKey ( player, "enter", "down", Spawn ) unbindKey ( player, "arrow_l", "down", ValasztasSkin ) unbindKey ( player, "arrow_r", "down", ValasztasSkin ) setElementPosition ( player, 207.9072265625, -132.1884765625, 1003.3125 ) setPedRotation ( player, 173 ) setElementInterior(player, 3) setElementDimension(player, 128) setElementFrozen ( player, false ) setCameraTarget ( player, player ) end
  9. Not excatly what I'm thinking about I mean, if somebody gets injured, his nametag color turns to red, but if somebody shoots someone else, the attacker's nametag is purple, but the injured's nametag is red.
  10. Hi everybody! So I have a nametag resource, and I modificatied it. When somebody punches, or hits somebody with weapon, the attacker's nametag color turns to purple for 5 seconds. But I don't know how to change the injured person's nametag color on hit. Because I want to make this script work like when you hit somebody your nametag color turns to purple, and the injured person's nametag color turns to red. How can I make this? Here's a bit of the script when it changes to purple: g_Attacker = getLocalPlayer(attacker) addEventHandler("onClientPlayerDamage", g_Attacker, function (red, green, blue, alpha, attacker) color = tocolor(107, 6, 82, 255) setTimer ( function() color = tocolor(212, 201, 174, 255) end, 5000, 1 ) end ) -- and the dxDrawColorText which is draws the names dxDrawColorText ( getPlayerName(player):gsub("_", " ") .. " (".. id .. ") ", sx-w, sy - offset, sx, sy - offset, color, textscale*NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false ) Thank you for the help!
  11. Hey guys, so I want to make random camera positions for my account system. So when you in the login or register screen, it should change the camera positions with fade camera. How can I make it? Can somebody write me an example please? I would be grateful. Thank you!
  12. Hello guys! So today I made a script which is about a marker and a garage. When you enter in the marker with a car it brings up color picker and you can select your car's color. But my problem is that I don't know how to make it appear only for the man, who is in the driver seat, because now it appears for everybody in the car. Can anybody help me please? I would be grateful. Thank you! Just a bit of the code, this part is when the color picker appears. If it's needed I'll post the full code. function openColorPicker(hitPlayer, matchingDimension, seat) if localPlayer == hitPlayer then editingVehicle = getPedOccupiedVehicle(hitPlayer) seat = 0 if (editingVehicle) and seat then colorPicker.openSelect(colors) showCursor(true) end end end --addCommandHandler("color", openColorPicker) addEventHandler("onClientMarkerHit", marker, openColorPicker)
  13. Oh, thank you, it works!! Thank you very much!
  14. Well, I can't do this. I searched the wiki for hours but I don't know how to toggle the special fightning style, because this is with exit_enter, so I think it's going to disable the enter and the exit functions on vehicles. I don't know how to start or make it Please, can you write me an example? I would be really grateful!
  15. Not working Now it just draws the [ ] but no reason.
  16. Hello everyone! So I was just thinking about how can I disable the special fighting styles and replace them with the default left mouse click fightning style. So in single player when you hold down mouse2 and press F your character's fightning style is special. How can I disable special fightning styles? So if I hold mouse2 and press F it's like when you punch normally. I hope you can understand. Thanks for help!
  17. I don't know why, but it's still not working And debugscript doesn't show me errors.
  18. Works, thank you very much! Debugscript haven't showed me any errrors, but now it works. Thank you for you two!
  19. Hey guys! So today I tried to make a script which is make the killer person's screen fade to blue for a second when he kills somebody. Unfortunately, it's not working and I don't know why. Can anybody help me in this please? function addBlueOnDamage ( killer ) local killerPerson = getPlayerName ( killer ) if ( source == killer ) then fadeCamera ( killer, false, 1.0, 75, 161, 214 ) setTimer ( fadeCameraDelayed, 500, 1, killer ) end end addEventHandler ( "onPlayerWasted", getRootElement(), addBlueOnDamage ) function fadeCameraDelayed(killer) if (isElement(killer)) then fadeCamera(killer, true, 0.5) end end
×
×
  • Create New...