Jump to content

Search the Community

Showing results for tags 'addcommandhandler'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 9 results

  1. Estou tentando por o addcommandhandler mas não consigo de forma nenhuma, se alguém tiver a solução para algum dos 3 scripts a baixo me avisa fznd o favor estou tentando abrir painel DX por comando ao em vez de por bindkey porem não consigo, já tentei de vários jeitos e formas porem nn vai, já pesquisei aqui no fórum, no YouTube porem nn vai function Pdx ( ) dxDrawRectangle(504, 197, 314, 397, tocolor(255, 0, 0, 100), false) dxDrawRectangle(554, 238, 218, 72, tocolor(255, 255, 255, 255), false) dxDrawRectangle(554, 347, 218, 72, tocolor(255, 255, 255, 255), false) dxDrawRectangle(554, 455, 218, 72, tocolor(255, 255, 255, 255), false) end function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addCommandHandler("disappear", abrir) addCommandHandler("v", abrir) tabem tentei fazer uma versão para uma bussola: --2017 ~ Mark Gyori https://markgyori.eu/ --Contact: [email protected] local sx, sy = guiGetScreenSize() local top = 30 local font1 = dxCreateFont("font.otf", 11) local font2 = dxCreateFont("font.otf", 10) local exibir_bulssola = false local cords = { {0, "N"}, {15, 15}, {30, 30}, {45, "NE"}, {60, 60}, {75, 75}, {90, "E"}, {105, 105}, {120, 120}, {135, "SE"}, {150, 150}, {165, 165}, {170, "S"}, {195, 195}, {210, 210}, {225, "SW"}, {240, 240}, {255, 255}, {270, "W"}, {285, 285}, {300, 300}, {315, "NW"}, {330, 330}, {345, 345} } function draw ( ) local show = 15 local center = math.ceil(show / 2) - 1 local _, _, r = getElementRotation(getCamera()) local pos = math.floor(r / 15) local slotwidth = 40 local smooth = ((r - (pos * 15)) / 15) * slotwidth local left = sx / 2 - ((show + 2) * slotwidth)/2 for i=1, show do local id = i + pos - center if(id > #cords)then id = id - #cords end if(id <= 0)then id = #cords - math.abs(id) end if(cords[id])then local alpha = (tonumber(cords[id][2]) or 0 > 0) and 175 or 255 if(i < center)then alpha = alpha * (i/center) end if(i > center)then alpha = alpha * ((show-i)/center) end dxDrawRectangle(left + slotwidth * i - smooth + (slotwidth / 2 - 1) + 1, top + 10 + 1, 2, 10, tocolor(0, 0, 0, alpha * 0.5)) dxDrawRectangle(left + slotwidth * i - smooth + (slotwidth / 2 - 1), top + 10, 2, 10, tocolor(255, 255, 255, alpha)) dxDrawText(cords[id][2], left + slotwidth * i - smooth + 1, top + 20, left + slotwidth * (i+1) - smooth + 2, top + 40, tocolor(0, 0, 0, alpha * 0.5), 1, font2, "center", "center") dxDrawText(cords[id][2], left + slotwidth * i - smooth, top + 20, left + slotwidth * (i+1) - smooth, top + 40, tocolor(255, 255, 255, alpha), 1, font2, "center", "center") end end dxDrawText("➤", left + 4, top + 26 + 2, left + ((show + 3) * slotwidth) + 30, 0, tocolor(0, 0, 0, 160), 1, font1, "center", "top", false, false, false, false, false, 90) dxDrawText("➤", left, top + 26, left + ((show + 3) * slotwidth) + 30, 0, tocolor(255, 255, 255, 255), 1, font1, "center", "top", false, false, false, false, false, 90) end addCommandHandler("m1", function() if exibir_bulssola = false then addEventHandler("onClientRender", getRootElement(), draw) exibir_bulssola = true else removeEventHandler("onClientRender", getRootElement(), draw) exibir_bulssola = false end end) --->--->--->---> (inclusive tentei mudar a direção a qual ele gira não consegui se alguém souber como avisa)<---<---<---<--- e também tentei para ativar e desativar primeira pessoa na arma através de comando: function zoomarma (thePlayer) setWeaponProperty ( 30 , "poor" , "flag_aim_1st_person" , true ) setWeaponProperty ( 30 , "std" , "flag_aim_1st_person" , true ) setWeaponProperty ( 30 , "pro" , "flag_aim_1st_person" , true ) end addCommandHandeler ("m1", zoomarma ) esse addCommandHandeler não funciona de jeito nenhum
  2. Eu queria saber como criar uma array de vários comandos e chamar eles no AddCommandHandler, tentei fazer assim cmd = { "cmd1", "cmd2", "cmd3", } e chamar usando addCommandHandler(#cmd, nomeDaFuncao) a função não me retornou nenhum erro porém simplesmente não consigo executar nenhum comando que coloquei acima...
  3. function upLevel (thePlayer) for i,player in ipairs(getElementsByType("player")) do if ( player ) then if ( getPlayerAccount(player) ) and not ( isGuestAccount(getPlayerAccount(player)) ) then setElementData(player,"minutes",(getElementData(player,"minutes") or 0) +1) if ( getElementData(player,"minutes") > 60 ) then setElementData(player,"minutes",0) setElementData(player,"Level",(getElementData(player,"Level") or 0) +1) local bonus = math.random(650,1200) local interest = math.random(60,220) local value = (bonus-interest) givePlayerMoney(player,value) outputChatBox("#FFFFFF[ #FAAC58Level #FFFFFF]", player, 255, 255, 255, true ) outputChatBox("#FFFFFFPagamento : R$ #00FF00"..value, player, 255, 255, 255, true ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Everyone" ) ) then end end end end end end setTimer(upLevel,69000,0) function setLevelLogin () local account = getPlayerAccount(source) if ( account ) then local Level = (getAccountData(account,"Level") or 0) local minutes = (getAccountData(account,"minutes") or 0) setElementData(source,"Level",Level) setElementData(source,"minutes",minutes) end end addEventHandler("onPlayerLogin",getRootElement(),setLevelLogin) function setLevelJoin () setElementData(source,"Level",0) setElementData(source,"minutes",0) end addEventHandler("onPlayerJoin",getRootElement(),setLevelJoin) function setLevelQuit () local account = getPlayerAccount(source) if ( account ) then local minutes = (getElementData(source,"minutes") or 0) local Level = (getElementData(source,"Level") or 0) setAccountData(account,"minutes",minutes) setAccountData(account,"Level",Level) end end addEventHandler("onPlayerQuit",getRootElement(),setLevelQuit) este é o script
  4. السلام عليكم ورحمة الله وبركاتة كنت اتمني ان اقوم بعمل مود بسيط واود مساعدتكم في تصميمة انا اود ان افعل سكربت صغير عبارة عن عند كتابت امر up علي سبيل المثال يقوم بحمل الاعب الذي يقوم بكتابت اسمة والاعب المحمول يقوم بعمل انيماشن معين هل بامكانكم مساعدتي؟
  5. Eu novamente aqui skkssk, Então meus irmãos, é um script que baixei do site original do mta, muitos devem conhece-l, é o script de danças do fortnite! Mais assim, parece que ele nao esta configurado e eu meio que nao entendo sobre arquivos ifp de dança, o author desse script, colocou um exemplo nele, que quando troca de nick exibe a animação e realmente apaguei os -- e funcionou, eu ate entendi, o script vem com 13 danças, porem nao estou conseguindo configurar! server.lua function setPedFortniteAnimation (ped,animation,tiempo,repetir,mover,interrumpible) if (type(animation) ~= "string" or type(tiempo) ~= "number" or type(repetir) ~= "boolean" or type(mover) ~= "boolean" or type(interrumpible) ~= "boolean") then return false end if isElement(ped) then if animation == "baile 1" or animation == "baile 2" or animation == "baile 3" or animation == "baile 4" or animation == "baile 5" or animation == "baile 6" or animation == "baile 7" or animation == "baile 8" or animation == "baile 9" or animation == "baile 10" or animation == "baile 11" or animation == "baile 12" or animation == "baile 13" then for i = 1,3 do triggerClientEvent ( root, "setPedFortniteAnimation", root, ped,animation,tiempo,repetir,mover,interrumpible ) if tiempo > 1 then setTimer(setPedAnimation,tiempo,1,ped,false) setTimer(setPedAnimation,tiempo+100,1,ped,false) end end end end end --[[ EJEMPLO/EXAMPLE CUANDO CAMBIA EL NICK WHEN NICK IS CHANGED function wasNickChangedByUser(oldNick, newNick, changedByUser) setPedFortniteAnimation(source,"baile 8",7000,true,false,false,false) end addEventHandler("onPlayerChangeNick", getRootElement(), wasNickChangedByUser) -- add an event handler --]] function howtouse ( player, command, dance ) if isElement(player) then exports.fortnitedances:setPedFortniteAnimation(player,"baile "..dance.."",-1,true,false,false,false) end end addCommandHandler ( "dance", howtouse ) client.lua local customIfp = nil function setPedFortniteAnimation (ped,animation,tiempo,repetir,mover,interrumpible) if (type(animation) ~= "string" or type(tiempo) ~= "number" or type(repetir) ~= "boolean" or type(mover) ~= "boolean" or type(interrumpible) ~= "boolean") then return false end if isElement(ped) then if animation == "baile 1" or animation == "baile 2" or animation == "baile 3" or animation == "baile 4" or animation == "baile 5" or animation == "baile 6" or animation == "baile 7" or animation == "baile 8" or animation == "baile 9" or animation == "baile 10" or animation == "baile 11" or animation == "baile 12" or animation == "baile 13" then for i = 1,3 do setPedAnimation(ped, "Fortnite_"..i.."", animation, tiempo, true, false, false) if tiempo > 1 then setTimer(setPedAnimation,tiempo,1,ped,false) setTimer(setPedAnimation,tiempo+100,1,ped,false) end end end end end addEvent("setPedFortniteAnimation",true) addEventHandler("setPedFortniteAnimation",getRootElement(),setPedFortniteAnimation) addEventHandler("onClientResourceStart", resourceRoot, function ( startedRes ) customIfp = engineLoadIFP ("Fortnite pt1.ifp", "Fortnite_1") customIfp2 = engineLoadIFP ("Fortnite pt2.ifp", "Fortnite_2") customIfp3 = engineLoadIFP ("Fortnite pt3.ifp", "Fortnite_3") if customIfp and customIfp2 and customIfp3 then outputDebugString ("Animaciones de Fortnite cargadas") else outputDebugString ("Las animaciones de Fortnite no fueron cargadas") end end ) Vou colocar o meta.xml tambem pra voces verem o export caso possa ser isso tambem meta.xml <meta> <info author="Drex" version="1.1" name="Bailes de Fortnite" type="script" /> <export function="setPedFortniteAnimation" type="shared" /> <file src="Fortnite pt1.ifp" /> <file src="Fortnite pt2.ifp" /> <file src="Fortnite pt3.ifp" /> <script src="client.lua" type="client" cache="false" /> <script src="server.lua" type="sever" cache="false" /> </meta>
  6. السلام عليكم , قمت بصناعة مود مكون من Tap1 - Tap2 طبعاً لكل تاب : Variable كيف أستطيع اضافة addCommandHandler لفتح اللوحة بأكملها؟ " All Taps " هل بأضافة فاكشن؟ ألرجاء المساعدة بأسرع وقت اخوتي.
  7. Greetings, i am making a new script to chatBox, but i have some problem making a script to binds with my new chatBox. The user when want make the bind (example: /bind 4 drawLineInScreen colorR colorG colorB) i take the string drawLineInScreen, but when i want make te bind using bindKey, there are 2 options. option 1 bool bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] ) option 2 bool bindKey ( player thePlayer, string key, string keyState, string commandName, [ string arguments ] ) In option 1 i can add 1 or more arguments, in option 2 i can add 1 only argument. The data than i have is the commandName, I need the function to my commandName and i can use very arguments with the option 1. PLS HELP ME.
  8. (sry for my bad english) Hi everyone! In my script when I write the command into game chatbox (/makeveh "myID" "CarModelName" "Faction" "R, G, B") i get this Error message to server console: ERROR: mta_vehicle\sourceS.lua:263: attempt to compare boolean with number. The code is: addCommandHandler("makeveh", function(player, _, ownerID, modelID, faction, r, g, b) if getElementData(player, "acc:admin") >= 7 then <--LINE 263 if not modelID or not tonumber(ownerID) then outputChatBox(rovid .. " /makeveh [Név/ID] [Model] [Frakció] [R] [G] ", player, 0, 0, 0, true) return end target, targetName = exports.mta_main:findPlayer(player, ownerID) if not target then return else ownerID = getElementData(target, "char:id") end if not tonumber(faction) then faction = 0 end if not tonumber(r) then r = 0 end if not tonumber(g) then g = 0 end if not tonumber(b) then b = 0 end r = tonumber(r) g = tonumber(g) b = tonumber(b) local vehname = tonumber(modelID) if not vehname then vehname = getVehicleModelFromName(modelID) end if not vehname then outputChatBox(rovid .. " Hibás jármű név vagy id", player, 0, 0, 0, true) return end local x, y, z = getElementPosition(target) local insertQuery = dbQuery(con, "INSERT INTO vehicle SET model=?, owner=?, pos=?, color=?, faction=?, rendszam=?", vehname, ownerID, toJSON({x,y,z}), toJSON({r,g,b}), faction, "modify") local insertResult, _, insertID = dbPoll(insertQuery, -1) if insertResult then addVehicle(ownerID, vehname, x, y, z, insertID, r, g, b, faction) exports.mta_item:giveItem(target, 34, insertID, 1, 0) exports.mta_admin:outputDeveloperMessage("#7cc576"..player:getData("char:anick").." #fffffflétrehozott egy járművet (ID: "..insertID.." Tulaj: "..targetName:gsub("_", " ")..")") dbFree(insertQuery) end end end)
  9. Hello How can i make teleportation that counts to 3seconds and teleports you to San Fierro but if you get damage timer sets to 20seconds that you would not run from death i can't find it on wiki anything with teleportation with timer .Or if you can give link that explains how to do addcommandhandler script that teleports and counts like that Thanks
×
×
  • Create New...