Jump to content

DREFTHUN

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by DREFTHUN

  1. Contact the server. There’s nothing MTA can do.
  2. • Completey written from scratch (or if you are willing from refurbished functions of my own scripts for faster work) • Quick work • Communication between seller and buyer • Relatively cheap • MySQL and phpmyadmin knowledge • Can make almost anything DM me on Discord (DREFT#7428) if you are interested. I can send video proof of my previous projects too.
  3. It is bugged. setPedLookAt Issues Issue ID Description #4325 setPedLookAt does not work for remote players
  4. function MakePlayerHeadshot( attacker, weapon, bodypart, loss ) if getElementType ( attacker ) == "ped" then if bodypart == 9 then if getPedArmor(source) > 0 then triggerEvent( "onPlayerHeadshotArmor", source) else triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) setPedHeadless ( source, true ) killPed( source, attacker, weapon, bodypart ) setTimer( BackUp, 900, 1, source ) end end end end function onPlayerHeadshotArmor() setPedArmor(source, 0) end addEvent("onPlayerHeadshotArmor", true) addEventHandler("onPlayerHeadshotArmor", root, onPlayerHeadshotArmor) Try this (Not tested)
  5. --Server fuelConsumption = 0.004 fuelTable = {} function vehMove() for i,v in ipairs(getElementsByType("vehicle")) do x,y,z = getElementPosition(v) if fuelTable[v] then distance = getDistanceBetweenPoints3D(x,y,z,fuelTable[v][2],fuelTable[v][3],fuelTable[v][4]) enginePlus = 0 if getVehicleEngineState(v) then enginePlus = 0.08 end newFuel = fuelTable[v][1] - (fuelConsumption*(distance+enginePlus)) fuelTable[v] = {newFuel,x,y,z} setElementData(v, "fuel", fuelTable[v][1]) else if getElementData(v, "fuel") then fuelTable[v] = {getElementData(v, "fuel"), x, y, z} else fuelTable[v] = {100, x, y, z} end end end end setTimer(vehMove, 1000, 0) --Client sx,sy = guiGetScreenSize() function testShowFuel() if isPedInVehicle(localPlayer) then dxDrawRectangle(sx-210,sy-30,200,20,tocolor(0,0,0,120)) if getElementData(getPedOccupiedVehicle(localPlayer), "fuel") then fuel = getElementData(getPedOccupiedVehicle(localPlayer), "fuel") else fuel = 100 end dxDrawRectangle(sx-210,sy-30,fuel/100*200,20,tocolor(127,198,118,255)) end end addEventHandler("onClientRender", root, testShowFuel)
  6. Hello! I have a problem. I wrote a custom damage system with the event onClientPlayerDamage. But whenever the player is doing a driveby. The event doesn’t seem to get called, even tho the player is taking damage. Is there a fix to it? Thanks, in advance.
  7. PM me your discord name and I’ll help you in about 3 hrs.
  8. It happens with the chainsaw, and with simple punching too. Should I just change the fighting style and it should be good to go?
  9. My friend bought a new laptop. It has an integrated vga eith the processor, and a dedicated vga, but MTA uses the integrated vga and we don’t know how to change it.
  10. Thank you IIYAMA! Your reply was helpful! ShayF Yeah, it's good, but when I want to type like /mute DREFTHUN 34 that script won't seperate the arguments. Anyway, thanks! I'm all good now.
  11. I made a custom chat, and I made it to recognize commands by using if string.sub(guiGetText(chatGUI),1,1) == "/" then It's all good, but then I can't get the arguments server side. Like when I type /mute Player12 30, I don't know how to seperate them, in 2 arguments. I just need a little help to get started with.
  12. I can script almost anything you want. You just need to go here: https://selly.gg/@DREFT (All information about the scripts are here) Here, you can select which service you want, you are going to get a file called TS3.txt, and you just have to join my TS3 server with the IP you can find in the file, and we can discuss your order. (I'm not always online. If I'm not online, you can use selly.gg to contact me!) You can use coupon 'MTAFORUM' for a 15% discount on every product (Limited to 50 people)
  13. I can script almost anything you want. You just need to go here: https://selly.gg/@DREFT (All information about the scripts are here) Here, you can select which service you want, you are going to get a file called TS3.txt, and you just have to join my TS3 server with the IP you can find in the file, and we can discuss your order. (I'm not always online. If I'm not online, you can use selly.gg to contact me!) You can use coupon 'MTAFORUM' for a 15% discount on every product (Limited to 50 people)
  14. It won't do the trick better. The method I wrote down is easier then almost anything else. And check out the edited script too.
  15. MaxPlayers = 48 allowedSerials = { [""]=true, } function playerJoinKick() serial = getPlayerSerial(source) if not allowedSerials[serial] and getPlayerCount() >= MaxPlayers then kickPlayer(source, "Console", "You tried joining in a reserved slot!") end end addEventHandler("onPlayerJoin", root, playerJoinKick) setTimer(function() if getPlayerCount() >= MaxPlayers then setMaxPlayers(getPlayerCount() + 1) else setMaxPlayers(MaxPlayers) end end,50,0) Try this.
  16. I want to do a Taxi Job on my server, but I can't get it to work. Is there any way to use the enter_passenger control on Peds? --Server taxiNPCk = {} function warpTaxiNPCInTaxi(player, skin, name, vehicle) taxiNPCk[player] = createPed(skin, 0, 0, 0) setElementData(taxiNPCk[player], "pedname", name) warpPedIntoVehicle(taxiNPCk[player], vehicle, math.random(2,3)) end addEvent("warpTaxiNPCInTaxi", true) addEventHandler("warpTaxiNPCInTaxi", root, warpTaxiNPCInTaxi) --Client NPCnevek = { {"Tom"}, {"Patrik"}, } NPCskinek = { {21}, {22}, {23}, } taxiNPCkLS = { {1173.0035400391, -1274.3172607422, 13.546875, 180}, {1313.7718505859, -1389.6131591797, 13.518327713013, 180}, } function taxiRender() if not isPedInVehicle(localPlayer) then return end x, y, z = getElementPosition(localPlayer) x1, y1, z1 = getElementPosition(taxiNPC) distance = getDistanceBetweenPoints3D(x, y, z, x1, y1, z1) outputChatBox(distance) if distance < 7 then ottVan = true end if ottVan then setPedRotation(taxiNPC, findRotation(x1, y1, x, y)) setControlState("handbrake", true) setPedControlState(taxiNPC, "forwards", true) setPedControlState(taxiNPC, "walk", true) if distance < 2.3 then triggerServerEvent("warpTaxiNPCInTaxi", localPlayer, localPlayer, getElementModel(taxiNPC), getElementData(taxiNPC, "pedname"), getPedOccupiedVehicle(localPlayer)) destroyElement(taxiNPC) setControlState("handbrake", false) toggleAllControls(true, true, true) removeEventHandler("onClientRender", root, taxiRender) ottVan = false setPedControlState(taxiNPC, "forwards", false) setPedControlState(taxiNPC, "walk", false) end end end function taxiSpawnNPC() if isElement(taxiNPC) then destroyElement(taxiNPC) end random1 = math.random(1, #taxiNPCkLS) random2 = math.random(1, #NPCnevek) random3 = math.random(1, #NPCskinek) taxiNPC = createPed(NPCskinek[random3][1], taxiNPCkLS[random1][1], taxiNPCkLS[random1][2], taxiNPCkLS[random1][3]) outputChatBox("-- Taxi NPC Spawned --") outputChatBox(" -Skin: "..NPCskinek[random3][1]) outputChatBox(" -Position (X, Y, Z): "..taxiNPCkLS[random1][1]..", ".. taxiNPCkLS[random1][2]..", ".. taxiNPCkLS[random1][3]) setPedRotation(taxiNPC, taxiNPCkLS[random1][4]) outputChatBox(" -Rotation: "..taxiNPCkLS[random1][4]) setElementData(taxiNPC, "pedname", NPCnevek[random2][1].." #7cc576(Pedestrian)") outputChatBox(" -Name: "..NPCnevek[random2][1].." #7cc576(Pedestrian)",255,255,255,true) addEventHandler("onClientRender", root, taxiRenderTeszt) end taxiSpawnNPC() function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end This is good enough too, but if possible, I would like to use the enter_passenger.
  17. Love you mate Tho you messed it up a little. dxDrawText("Test text please work already", 0, sy/2-15, startXTest, sy/2+15,tocolor(0,0,0,255),1,"arial","left","center",true,false,false) Thanks anyway Liked :DD
  18. Hey guys! I need help with dxDrawText cropping, cause I just can't get it to work. I used these lines of code startXTest = 0 function renderTest() sx, sy = guiGetScreenSize() startXTest = startXTest + sx/1000 if startXTest > sx then startXTest = 0 end dxDrawRectangle(startXTest, sy/2-15,3,30) dxDrawText("Test text please work already", 0, sy/2, startXTest+30, sy/2,tocolor(255,255,255,255),1,"arial","left","center",true,false,false) end addEventHandler("onClientRender", root, renderTest) but the only thing I get is... It should display the text within the line, shouldn't it? What should I do? Please help!
  19. I use this: function getPos() x, y, z = getElementPosition(localPlayer) rot = getPedRotation(localPlayer) int = getElementInterior(localPlayer) dim = getElementDimension(localPlayer) position = x .. ", ".. y .. ", ".. z outputChatBox(position) outputChatBox("Rot: "..rot) outputChatBox("Int: "..int) outputChatBox("Dim: "..dim) setClipboard(position) end addCommandHandler("getpos", getPos) It is client-sided, and it still returns the dimension I gave... And no debug errors... Not even warnings... I tried even reinstalling the server, and everything... Just in case, I added that code to my script, to see what happens. http://kephost.com/image/wlEg Got the source of the problem! Gonna change hostings now! Thank you for your help anyways!
  20. Than I'm sorry, I don't know what to do
×
×
  • Create New...