![](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Firespider
Members-
Posts
238 -
Joined
-
Last visited
Everything posted by Firespider
-
I have already solved it, but there is a small problem. statusMarker = createMarkerAttachedTo(source, "checkpoint") Doesn't working
-
Hello, I would like to solve the problem so that DXdrawrectangle can only be seen by a specific person, can you help?
-
Hello! I don't understand why this doesn't work. Can you help? function unit() status = 0 if (status == 0) then createBlipAttachedTo(source, 0, 4, 0, 0, 255) outputChatBox("#898c8f<<#2c469cNeXoN Roleplay#898c8f>> #0f5720Sikeressen megváltoztatad az egységed állapotát: #ffffff||Járőr||", source, 255, 255, 255, true) status = 0+1 else outputChatBox("#898c8f<<#2c469cNeXoN Roleplay#898c8f>> #0f5720Már ez az egységed állapota.", source, 255, 255, 255, true) end end addEvent("Button1", true) addEventHandler("Button1", root, unit)
-
On the server side, this is all approx.
-
Hello! I would like to solve the problem so that only those whose faction ID is 34 can see the clip. The only problem is that I don't understand MySQL, I am attaching the code and the table. function unit() createBlipAttachedTo(source, 0, 4, 0, 0, 255, root) end addEvent("Button1", true) addEventHandler("Button1", root, unit) The group id only needs to be queried and if it is 34 then it should be done.
-
Hello! I would like to have this function enabled for several cars. But can you help me? addEventHandler("onClientVehicleEnter", root, function(thePed, seat) local vehid = getElementModel(source) local playerskin = getElementModel(localPlayer) if (vehid ~= 596 or vehid ~= 597) then return end if (playerskin == 280) then playSound("beep.mp3") outputChatBox("#898c8f<<#2c469cNeXoN Roleplay#898c8f>> #0f5720Sikeress belépés", 255, 255, 255, true) PDMenu = true else playSound("beep.mp3") outputChatBox("#898c8f<<#2c469cNeXoN Roleplay#898c8f>> #0f5720Sikertelen belépés", 255, 255, 255, true) end end)
-
Hello, how can I solve it, for example by entering /setunit [Unit number] and the chat displays the unit number that the player entered?
-
@Shady1 And Shady, how can I solve it, for example by entering /setunit [Unit number] and the chat displays the unit number that the player entered?
-
So the problem would be that it doesn't delete the blip. I would like to make sure that the blip follows the player, indicating that a police unit is going there. However, in order not to be ugly, I would always like to delete the previous blip so that the map is full of blips.
-
The problem is that for some reason it doesn't detect myBlip and delete it.
-
@Shady1 Can you help me with this code as well? setTimer( function() local x, y, z = getElementPosition(localPlayer) sanyi = createBlip(x, y, z, 0) Reset(); end, 2000, 0) function Reset() destroyElement(sanyi) end setTimer(Reset, 3000, 0)
-
Hello! For some reason, the part that retrieves the car's ID does not work in this code. Can you help? addEventHandler("onClientVehicleEnter", root, function(theVehicle, seat, jacked) id = getVehicleID(theVehicle) skin = getElementModel(localPlayer) if (id == 596) then if (skin == 280) then playSound("beep.mp3") outputChatBox("#898c8f<<#2c469cNeXoN Roleplay#898c8f>> #0f5720Sikeress belépés", 255, 255, 255, true) PDMenu = true else playSound("beep.mp3") outputChatBox("#898c8f<<#2c469cNeXoN Roleplay#898c8f>> #0f5720Sikertelen belépés", 255, 255, 255, true) end end end )
-
Hello, I'm pretty stupid, I wrote a script for the databases that saves the name, serail, food and money, but for some reason it's not good. local conn = dbConnect("mysql", "dbname=test; host=127.0.0.1;charset=utf8", "root","","share=0") function SQL(hunger) local qh = dbQuery(conn,"SELECT * FROM playeradatok WHERE serial=?",getPlayerSerial(source)) local res = dbPoll(qh, 500) if #res > 0 then for _,rows in pairs(res) do setPlayerMoney(source,rows["money"]) setElementData(player, "hunger") end else local playername = getPlayerName(source) local money = getPlayerMoney(source) local serial = getPlayerSerial(source) local hunger = getElementData(player, "hunger") dbExec(conn,"INSERT into playeradatok (playername, serial, money, hunger) VALUES (?,?,?,?, NOW())", username, serial, money, hunger) end end function saveHunger(hunger) -- Elmentjük a változó értékét a játékos adataiba setElementData(source, "hunger", hunger) end addEvent("onClientSaveHunger", true) addEventHandler("onClientSaveHunger", root, saveHunger) function getHunger(player) local hunger = getElementData(player, "hunger") -- itt használd fel a hunger változó értékét end
-
How can I insert this so that it takes damage when the hunger is low. setPlayerHudComponentVisible("all", false) local sx,sy = guiGetScreenSize();--1920,1080 local relx,rely = sx/1920,sy/1080; local isHudVisible = true local stamina = 100 local hunger = 100 local hp = getElementHealth(localPlayer) function Panel() local armor = getPedArmor(localPlayer) if(isHudVisible) then dxDrawRectangle(sx*.8, sy*.010, sx*.13, sy*.150, tocolor(20, 30, 40, 200)) dxDrawRectangle(sx*.8, sy*.009, sx*.130, sy*.02, tocolor(100, 110, 120, 125))-- HP ALAP dxDrawRectangle(sx*.8, sy*.009, sx*(.130*(hp/100)), sy*.02, tocolor(138, 10, 31, 255)) dxDrawRectangle(sx*.8, sy*.05, sx*.130, sy*.02, tocolor(100, 110, 120, 125)) -- ARMOR ALAP dxDrawRectangle(sx*.8, sy*.05, sx*(.130*(armor/100)), sy*.02, tocolor(77, 145, 144, 255)) dxDrawRectangle(sx*.8, sy*.09, sx*.130, sy*.02, tocolor(100, 110, 120, 125)) -- ARMOR ALAP dxDrawRectangle(sx*.8, sy*.09, sx*(.130*(stamina/100)), sy*.02, tocolor(77, 145, 144, 255)) dxDrawRectangle(sx*.8, sy*.13, sx*.130, sy*.02, tocolor(100, 110, 120, 125)) -- ARMOR ALAP dxDrawRectangle(sx*.8, sy*.13, sx*(.130*(hunger/100)), sy*.02, tocolor(186, 148, 34, 255)) end end addEventHandler("onClientRender", root, Panel) addEventHandler("onClientPreRender",root, function() if (stamina > 0) then if (getPedMoveState(localPlayer) == "sprint") then stamina = stamina-01 else if (stamina < 100) then stamina = stamina+01 end end if (stamina <= 15) then toggleAllControls(false) setTimer(setPedAnimation,300,1,localPlayer,"fat","idle_tired") else toggleAllControls (true) setPedAnimation(localPlayer) end end end ) addCommandHandler("togg", function() toggleAllControls(true) end ) setTimer ( function () if (hunger > 0) then hunger = hunger-1 outputChatBox(hunger) if (hunger == 5) then outputChatBox("Egyél mert ehénfogsz halni.") hp = hp-01 end end end, 1, 0 )
-
Hi! Which function can I use to damage the player?
-
Hello! I would like to write that if someone dies, the ambulance can put them in a body bag. But this code doesn't work, what's wrong. e = exports.fv_engine; function Heal(Localplayer, target, cmd) if (target) then if getElementData(localPlayer,"duty.faction") == 53 then health = getDeadPlayers(target) if (health == true) then outputChatBox("Sikeressen be tetted a hullzsákba") else print("DEBUG") end end end end addCommandHandler("bag", Heal)
-
@SciptNovato Ok, I have it, I made it so that it works when you press it, but it doesn't flash when you move the cursor over it, can you help me with this
-
Hello! I have a small problem, I want to create a menu, but for some reason the button does not flash and does not work, and it still flashes first, could you help? local sx, sy = guiGetScreenSize() local relx,rely = sx/1920,sy/1080; local DutyPanel = false local MenuPoints = {00.35 ,00.20} color1 = tocolor(30, 40, 50, 255) addEventHandler("onClientRender", root, function() if (DutyPanel) then if not (getElementData(localPlayer, "Duty")) then dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*.5, tocolor(50, 60, 70, 230))-- Panel dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*0.08, tocolor(20, 30, 40, 255))-- Panel fejléc dxDrawRectangle(sx*.4, sy*.4 , sx*.2, sy*0.080, color1) dxDrawText("Duty Felvételi Panel", sx*.800, sy*.4 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) dxDrawText("Duty Felvétel", sx*.800, sy*0.80 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) else dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*.5, tocolor(50, 60, 70, 230))-- Panel dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*0.08, tocolor(20, 30, 40, 255))-- Panel fejléc dxDrawRectangle(sx*.4, sy*.4 , sx*.2, sy*0.080, color1) dxDrawText("Duty Felvételi Panel", sx*.800, sy*.4 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) dxDrawText("Duty leadása", sx*.800, sy*0.80 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end ---------- if isMouseInPosition(sx*.4, sy*.4 , sx*.2, sy*0.080) then color1 = tocolor(80, 90, 100, 255) else color1 = tocolor(30, 40, 50, 255) end addEventHandler("onClientClick", root, function(button, state) if (DutyPanel) then if ( button == "left" and state == "down" ) then if isMouseInPosition(sx*.4, sy*.4 , sx*.2, sy*0.080) then triggerServerEvent("Dutyon", root) DutyPanel = false end end end end ) end end end ) addEvent("OpenDutyPanel", true) addEventHandler("OpenDutyPanel", root, function() if not (DutyPanel) then DutyPanel = true else outputChatBox("#961f17[RENDSZER]: #ffffffMár menűbe vagy!", 0, 0, 0, true) end end ) function ShowCursor() if not isCursorShowing() then showCursor(true) else showCursor(false) end end bindKey("m", "Down", ShowCursor)
-
@Addlibs I have a problem, it's like a car shop and it's supposed to put the very first car down, but I don't know where the beginning of the whole thing starts, so to speak, because English is not my native language and I might have misread something. So, so to speak, which is the very first function that should be used in this situation. Thanks in advance for your answer!