Jump to content

βurak

Members
  • Posts

    370
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by βurak

  1. βurak

    [HELP]

    you can use a variable you set it to false by default if true you can draw anything you want If you want to show it to another player, you can run the setVisible event with triggerClientEvent if you want to do it from the server side, if it is on the client side, just set the visible variable to true by the way, the player parameter in the triggerClientEvent may vary depending on where you use it, for example, it becomes "source" in the onPlayerWasted event local visible = false function render() if(visible) then dxDrawRectangle(300, 300, 50, 50) end end addEventHandler("onClientRender", root, render) addEvent("setVisible",true) addEventHandler("setVisible",root, function(value) visible = value end ) --server triggerClientEvent(player, "setVisible", player, true) --show someone the rectangle
  2. βurak

    [HELP]

    do you have the rest of the code? there are uncertainties here
  3. βurak

    [HELP]

    When there is something you do not know, open a topic, I will help you as much as I can.
  4. βurak

    [HELP]

    local validVehicles = { [596] = true, [597] = true, --continue from here you want [vehicleid] = true } addEventHandler("onClientVehicleEnter", root, function(thePed, seat) local vehid = getElementModel(source) local playerskin = getElementModel(localPlayer) if (not validVehicles[vehid]) 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)
  5. yes it worked now thank you I always make mistakes like this ?
  6. Thanks for writing to my post, I tried what you said, but when I attach the object to the vehicle, the object does not move, but if I do not attach it, here is the code local hunter = createVehicle(487,0,0,3) local hx,hy,hz = getElementPosition(hunter) local theObject = createObject(1337,hx,hy,hz) attachElements(theObject,hunter) setElementCollisionsEnabled(theObject,false) moveObject(theObject,10000,hx,hy,hz+20) --does nothing
  7. I need to move a vehicle in the same way as moveObject moves objects, that is, it will move from the current position to the target within a certain time. how do i do this?
  8. On which side are the objects created, server or client?
  9. hi here i made an example --client local theObject = createObject(18450, 0, 0, 2) --test object addEvent("destroyObject", true) addEventHandler("destroyObject", root, function() destroyElement(theObject) --destroy theObject end ) --server triggerClientEvent(root, "destroyObject", root) --destroy theObject object for everyone addCommandHandler("destroyobject", function(player) triggerClientEvent(player, "destroyObject", player) -- destroy that object for the person who wrote this command end )
  10. solved it was fixed after reloading with engineLoadTXD
  11. hello here I have two custom textures on the left my special model but the game model on the right although they both have the same texture my object's textures look bad what is the reason for this https://imgyukle.com/f/2022/12/16/JBLLMt.png here my object on the left looks noisy
  12. can you try this on server side addCommandHandler("emoji", function(player) local x,y,z = getElementPosition(player) -- get x,y,z position who used player emoji command local nearbyPlayers = getElementsWithinRange(x, y, z, 100, "player") -- get players 100 range for _,player in ipairs(nearbyPlayers) do triggerClientEvent(player, "Emoji5:activarEfecto", root, OnEnmojiRender) -- send them so they can see this effect end end )
  13. can you try this please triggerClientEvent(root, "Emoji5:activarEfecto", source, OnEnmojiRender) or try this triggerClientEvent(root, "Emoji5:activarEfecto", root, OnEnmojiRender)
  14. Problem Solved The problem of not sending email is because gmail does not have "2-step verification" enabled. For php warnings, it is necessary to check the array with isset. <?php include("sdk/mta_sdk.php"); $input = mta::getInput(); if(isset($input[0]) && isset($input[1]) && isset($input[2]) && isset($input[3])) { $resetMail = mail($input[0], $input[2], $input[3], "From: ".$input[1]."\n" . "Content-Type: text/html; charset=iso-8859-1\n"); if($resetMail){ mta::doReturn("Success"); } else{ mta::doReturn("Failed"); } } ?>
  15. other errors are gone but now it gives error like this and the mail is still not coming php: <?php require_once 'C:\Users\Burak2346\vendor\autoload.php'; use MultiTheftAuto\Sdk\Mta; $input = Mta::getInput(); mail($input[0], $input[2], $input[3], "From: ".$input[1]."\n" . "Content-Type: text/html; charset=iso-8859-1\n"); ?>
  16. I want to send an email from the lua script, it says it was sent successfully, but the email is not received. server: local allowed = {{48, 57}, {65, 90}, {97, 122 }} function generateString (len) if tonumber (len) then math.randomseed(getTickCount()) local str = "" for i = 1, len do local charlist = allowed[math.random( 1, 3 )] str = str .. string.char (math.random(charlist[1], charlist[2] )) end return str end return false end function sendMailTo (mail, sender, headertext, text) callRemote ("http://localhost/mail.php", EMailAccepted, mail, sender, headertext, text) end function EMailAccepted () outputDebugString ("E-Mail was succesfully sended." ) end addCommandHandler("sendmail", function() local resetKey = generateString(12) sendMailTo("[email protected]", "[email protected]", "Password Reset", "Here your password reset code: "..resetKey) end) php: <?php require_once 'C:\Users\Burak2346\vendor\autoload.php'; $input = mta::getInput(); mail($input[0], $input[2], $input[3], "From: ".$input[1]."\n" . "Content-Type: text/html; charset=iso-8859-1\n"); ?>
  17. hi you can try this but i didn't test it --Client addEvent("playWinSound", true) addEventHandler("playWinSound", root, function(soundFile) local sound = playSound(soundFile) --play the sound file that comes as a parameter setSoundVolume(sound, 1) setSoundMaxDistance(sound, 100) end ) --server function multi_sounds(player, commandName, soundType) if not (soundType) then return outputChatBox("You must be enter sound type.", player) end --if the player has not entered the soundType, exit immediately if(soundType == "cops") then --if soundType is "cops" enter here triggerClientEvent(player, "playWinSound", player, "sirens.mp3") elseif(soundType == "robbers") then --if soundType is "robbers" enter here triggerClientEvent(player, "playWinSound", player, "gangsters.mp3") end end addCommandHandler("win", multi_sounds)
  18. βurak

    setTimer

    You can do it this way. It works once after 3 seconds. You can enter the value you want in milliseconds. addEventHandler("onVehicleExplode", root, function() setTimer(function(source) destroyElement(source) end, 3000, 1, source) --run after 3 seconds end)
  19. I'm not sure but maybe you can give the object a value of -1 setElementDimension(object, -1) -- make visible all dimensions
  20. hello, have you tried this function? maybe it will work for you https://wiki.multitheftauto.com/wiki/FindRotation3D
  21. if you have any questions please open a new thread and tag me, i will help you. ?
  22. local x,y,z = getElementPosition(localPlayer) local myPed = createPed(0, x, y+1, z) setTimer(function() setPedFollow(myPed, localPlayer) end, 1000, 0) function setPedFollow(theElement, theTarget) if theElement then local x, y, z = getElementPosition(theTarget) local rx, ry, rz = getElementRotation(theTarget) local ex, ey, ez = getElementPosition(theElement) local distance = getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) local rotation = findRotation(ex, ey, x, y) setPedRotation(theElement, rotation) if distance > 2 then setPedControlState(theElement, "forwards", true) else setPedControlState(theElement, "forwards", false) end end end function findRotation( x1, y1, x2, y2 ) local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) return t < 0 and t + 360 or t end try this also change script file type to client if you don't have any other code in the file it works, i tested it
  23. Is the getConnection function coming from a separate resource?, are you using mysql or sqlite?, if possible, can you show the codes of the getConnection function? and have you tried using exports?
  24. βurak

    help

    Can you show the code for the db.lua file?
×
×
  • Create New...