DREFTHUN

Members
  • Content count

    18
  • Joined

  • Last visited

Community Reputation

1 Neutral

About DREFTHUN

  • Rank
    Square
  • Birthday 07/07/02

Recent Profile Visitors

160 profile views
  1. Help with custom chat commands

    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.
  2. 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)
  3. 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)
  4. Add exceptions to the "max players"

    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.
  5. Add exceptions to the "max players"

    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.
  6. Ped entering passenger seat.

    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.
  7. dxDrawText cropping

    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
  8. dxDrawText cropping

    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!
  9. Dimension bug

    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!
  10. How to create anti-gravitygun script?

    Than I'm sorry, I don't know what to do
  11. How to create anti-gravitygun script?

    --Clientside: if getElementData(getPedTarget(localPlayer), "antigravitygun") then return end --It has to look like this: if isElement(ggun_obj) and isTimer(buildupTimer) then --(Row: 30) if not isElement(ggun_obj) then ggun_obj = getPedTarget(localPlayer) end --(Row: 31) if getElementData(getPedTarget(localPlayer), "antigravitygun") then return end --(Row: 32) Though, others can still lift the vehicle you are sitting in.
  12. How to create anti-gravitygun script?

    That just disables it for you.
  13. Dimension bug

    Here is a video demostrating my problem: My friend doesn't disappear, he just gets desynced... function setdim(thePlayer, cmd, targetPlayer, num) num = tonumber(num) targetPlayer = getPlayerFromName(targetPlayer) setElementDimension(targetPlayer, num) outputChatBox("Succesfully set dimension to "..num,root, 255, 255, 255, true) end addCommandHandler("setdim", setdim, false, false)
  14. How to create anti-gravitygun script?

    No problem!
  15. How to create anti-gravitygun script?

    You should use this: --Add this to the serverfile: function antigravitygun(player) if not getElementData(player, "antigravitygun") then setElementData(player, "antigravitygun", true) outputChatBox("You have succesfully turned off 'Gravity Gun'!",player,255,0,0) else setElementData(player, "antigravitygun", false) outputChatBox("You have succesfully turned on 'Gravity Gun'!",player,0,255,0) end end addCommandHandler("antigg", antigravitygun) --And this to the client: if getElementData(localPlayer, "antigravitygun") then return end --This one has to be between these two: if not getControlState("aim_weapon") or isElementInWater(localPlayer) then return end --(Row: 23) local ggun_obj = getElementData(localPlayer,"ggun_taken") --(Row: 24) --So it should look like this: if not getControlState("aim_weapon") or isElementInWater(localPlayer) then return end --(Row: 23) if getElementData(localPlayer, "antigravitygun") then return end --(Row: 24) local ggun_obj = getElementData(localPlayer,"ggun_taken") --(Row: 25)