-
Posts
696 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Dzsozi (h03)
-
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!
-
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!
-
Oh, thank you very much!!
-
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)
-
Thank you very much! It works.
-
Oh, thank you, it works!! Thank you very much!
-
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!
-
Not working Now it just draws the [ ] but no reason.
-
Okay, I'll try something, thank you!
-
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!
-
I don't know why, but it's still not working And debugscript doesn't show me errors.
-
Add fadecamera when other player is wasted
Dzsozi (h03) replied to Dzsozi (h03)'s topic in Scripting
Works, thank you very much! Debugscript haven't showed me any errrors, but now it works. Thank you for you two! -
Add fadecamera when other player is wasted
Dzsozi (h03) replied to Dzsozi (h03)'s topic in Scripting
Still not working -
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
-
Okay, sorry about debugscript But it's not working as well. I tried it. Is this worked for you?
-
Hey guys, today I made custom sirens for police cars, but my problem is that I don't know how to attach it to all police cars, not a specified one. I made something like that (I think), but it's not working. Heres my code: function policeSirens( ) local occveh = getPedOccupiedVehicle ( localPlayer ) local id = getElementModel ( theVehicle ) if id == 596 or id == 597 then setVehicleSirens ( occveh, 7, -0.800, -2.849, 0.050, 60, 118, 224, 255, 255 ) addVehicleSirens ( occveh, 7, 3, true, false, true, false ) end end So how can I attach these sirens to all police cars with id 596 and 597? I hope someone could help me in this, I would be grateful. Thank you!
-
This is helped me alot too! But I have a question. How to make something visible when the resource starts and then the can toggle it invisible and visible again. So the question is how to make it visible on resource start?
-
I know, but I mean how to remove event handlers without function name, as I mentioned in the beginning.
-
setElementInterior(exitMarker, 3) Put this in a new line after exitMarker = createMarker(...)
-
Hey everyone! I have a question for scripters. How can I remove event handlers written like this? addEventHandler("onClientPreRender", root, function() -- script stuff end ) Or how to call it in another resource? I would be grateful if someone could help me, I'm really interested in this. Thank you!
-
I don't really understand this I don't know how to do it. Can you help me in this please?
-
Now the names are shown thank you! But now I have other problem. I tried to translate the reasons to my language, but it's not showing the reason when somebody quits or getting kicked or timedout or whatever. It just shows empty space. local x, y = guiGetScreenSize() local sx, sy = guiGetScreenSize() local nev = "" local reason = "" if reason == "Unknown" then reason = "Ismeretlen indok" end if reason == "Quit" then reason = "Kilépés" end if reason == "Kicked" then reason = "Kirúgva" end if reason == "Banned" then reason = "Bannolva" end if reason == "Bad Connection" then reason = "Rossz kapcsolat" end if reason == "Timed out" then reason = "Időtúllépés" end function drawCsatlakozas ( ) -- 1411, 228, 269, 84 dxDrawRectangle(x*0.83988, y*0.217142, x*0.160119, y*0.08, tocolor(0, 0, 0, 125), true) -- 1411, 312, 269, 21 dxDrawRectangle(x*0.83988, y*0.297142, x*0.160119, y*0.02, tocolor(0, 0, 0, 185), true) -- 1411, 228, 269, 21 dxDrawRectangle(x*0.83988, y*0.217142, x*0.160119, y*0.02, tocolor(245, 140, 20, 200), true) -- 1425, 234, 1680, 244 dxDrawText("Csatlakozás / Kilépés", x*0.848214, y*0.2228571, sx*1, sy*0.23238, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) -- 1430, 453, 1680, 244 dxDrawText("CoreGaming", x*0.8511904, y*0.380952, sx*1, sy*0.23238, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) -- 1465, 249, 1657, 280 dxDrawText(nev, x*0.872023, y*0.237142, sx*0.985, sy*0.266666, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) -- 1455, 285, 1675, 302 dxDrawText("csatlakozott a szerverre.", x*0.8660714, y*0.271428, sx*0.99702, sy*0.28761, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end --addEventHandler("onClientRender", root, drawCsatlakozas) function drawKilepes( ) -- 1411, 228, 269, 110 dxDrawRectangle(x*0.83988, y*0.217142, x*0.160119, y*0.104761, tocolor(0, 0, 0, 125), true) dxDrawRectangle(x*0.83988, 338, x*0.160119, y*0.02, tocolor(0, 0, 0, 185), true) dxDrawRectangle(x*0.83988, y*0.217142, x*0.160119, y*0.02, tocolor(245, 140, 20, 200), true) dxDrawText("Csatlakozás / Kilépés", x*0.848214, y*0.2228571, sx*1, sy*0.23238, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) -- 1430, 453, 1680, 244 dxDrawText("CoreGaming", x*0.8511904, y*0.430952, sx*1, sy*0.23238, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) -- 1465, 249, 1657, 280 dxDrawText(nev, x*0.872023, y*0.237142, sx*0.985, sy*0.266666, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("lecsatlakozott a szerverről.", x*0.8660714, y*0.271428, sx*0.99702, sy*0.28761, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) -- 1455, 340, 1675, 302 dxDrawText("[ "..reason.." ]", x*0.866071, y*0.3238095, sx*0.99702, sy*0.28761, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end --addEventHandler("onClientRender", root, drawKilepes) addEventHandler("onClientPlayerJoin", root, function() nev = getPlayerName(source) addEventHandler("onClientRender", root, drawCsatlakozas) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawCsatlakozas) end, 5000, 1 ) end ) addEventHandler("onClientPlayerQuit", root, function ( reason ) nev = getPlayerName(source) addEventHandler("onClientRender", root, drawKilepes) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawKilepes) end, 5000, 1 ) end )
-
It does not show the player's name when somebody joins or quits. Debugscript error shows this error: WARNING: join\client.lua21: Bad argument @ 'dxDrawText' [Expected string at argument 1, got boolean]
-
Oh, sorry function drawJoin() dxDrawRectangle(1411, 228, 269, 84, tocolor(0, 0, 0, 125), true) dxDrawRectangle(1411, 228, 269, 21, tocolor(245, 140, 20, 235), true) dxDrawText("Csatlakozás / Kilépés", 1425, 234, 1680, 244, tocolor(254, 254, 254, 235), 1.00, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(nev, 1470, 249, 1657, 280, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("csatlakozott a szerverre.", 1455, 285, 1675, 302, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end function drawQuit(reason) dxDrawRectangle(1411, 228, 269, 84, tocolor(0, 0, 0, 125), true) dxDrawRectangle(1411, 228, 269, 21, tocolor(245, 140, 20, 235), true) dxDrawText("Csatlakozás / Kilépés", 1425, 234, 1680, 244, tocolor(254, 254, 254, 235), 1.00, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(nev, 1470, 249, 1657, 280, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("lecsatlakozott a szerverről. ("..reason..")", 1455, 285, 1675, 302, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end addEventHandler("onClientPlayerJoin", root, function() nev = getPlayerName(source) addEventHandler("onClientRender", root, drawJoin) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawJoin) end, 5000, 1 ) end ) addEventHandler("onClientPlayerQuit", root, function() nev = getPlayerName(source) addEventHandler("onClientRender", root, drawQuit) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawQuit) end, 5000, 1 ) end )
-
I have already posted it at the beginning function drawJoin() dxDrawRectangle(1411, 228, 269, 84, tocolor(0, 0, 0, 125), true) dxDrawRectangle(1411, 228, 269, 21, tocolor(245, 140, 20, 235), true) dxDrawText("Csatlakozás / Kilépés", 1425, 234, 1680, 244, tocolor(254, 254, 254, 235), 1.00, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(getPlayerName(source), 1470, 249, 1657, 280, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("csatlakozott a szerverre.", 1455, 285, 1675, 302, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end function drawQuit(reason) dxDrawRectangle(1411, 228, 269, 84, tocolor(0, 0, 0, 125), true) dxDrawRectangle(1411, 228, 269, 21, tocolor(245, 140, 20, 235), true) dxDrawText("Csatlakozás / Kilépés", 1425, 234, 1680, 244, tocolor(254, 254, 254, 235), 1.00, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(getPlayerName(source), 1470, 249, 1657, 280, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("lecsatlakozott a szerverről. ("..reason..")", 1455, 285, 1675, 302, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end addEventHandler("onClientPlayerJoin", root, function() addEventHandler("onClientRender", root, drawJoin) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawJoin) end, 5000, 1 ) end ) addEventHandler("onClientPlayerQuit", root, function() addEventHandler("onClientRender", root, drawQuit) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawQuit) end, 5000, 1 ) end )