DREFTHUN

Members
  • Content Count

    26
  • Joined

  • Last visited

Community Reputation

1 Neutral

1 Follower

About DREFTHUN

  • Rank
    Advanced Member
  • Birthday 07/07/2002

Recent Profile Visitors

545 profile views
  1. 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)
  2. DREFTHUN

    Fuel System

    --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)
  3. 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.
  4. DREFTHUN

    Fuel System

    PM me your discord name and I’ll help you in about 3 hrs.
  5. It happens with the chainsaw, and with simple punching too. Should I just change the fighting style and it should be good to go?
  6. 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.
  7. 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.
  8. 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.
  9. 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)
  10. 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)
  11. 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.
  12. 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.
  13. 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.
  14. 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