Search the Community

Showing results for tags 'scripting'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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

Found 193 results

  1. [help] some events

    Hello all I want to know if anyone have duel system ,most wanted system ,sky falls events ,more stuffs for freeroam servers or tell me how can I make them pls? Any suggest will be good
  2. This is the code (not the full): addEvent("robbed", true ) addEventHandler("robbed", root, function () setTimer(function() addEventHandler("onClientRender",root,remainingtime); resetTimer(remainingt) end, 10000, 1) setTimer(function() removeEventHandler("onClientRender",root,remainingtime); resetTimer(remainingt) end,1800000,1) end) and when i reconnect to the server, the remainingtime dx elements are hide.. how to fix this?
  3. function test() setElementPosition ( mark, pos.x,pos.y,pos.z ) end addEventHandler("onMarkerHit", mark, test) this is the code. if i hit the marker, the element position change for all players.. how to fix this? sorry for my bad english.
  4. This is the code: function stimers(thePlayer) if getElementData(thePlayer,"asdasd") == true then local lejartimer1 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","10 mins!") local lejartimer2 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","9 mins!") end,60000, 1) local lejartimer3 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","8 mins!") end,120000, 1) local lejartimer4 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","7 mins!") end,180000, 1) local lejartimer5 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","6 mins!") end,240000, 1) local lejartimer6 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","5 mins!") end,300000, 1) local lejartimer7 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","4 mins!") end,360000, 1) local lejartimer8 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","3 mins") end,420000, 1) local lejartimer9 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","2 mins") end,480000, 1) local lejartimer10 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","1 mins") end,540000, 1) local lejartimer11 = setTimer(function() setElementVisibleTo(mark, thePlayer, false) setElementData(thePlayer, "asdasd", false) local pos = positions[math.random(1,#positions)] setElementPosition ( mark, pos.x,pos.y,pos.z ) end,600000, 1) end,100,1) --- elseif getElementData(thePlayer,"asdasd") == false then if isTimer ( lejartimer1 ) then killTimer ( lejartimer1 ) end if isTimer ( lejartimer2 ) then killTimer ( lejartimer2 ) end if isTimer ( lejartimer3 ) then killTimer ( lejartimer3 ) end if isTimer ( lejartimer4 ) then killTimer ( lejartimer4 ) end if isTimer ( lejartimer5 ) then killTimer ( lejartimer5 ) end if isTimer ( lejartimer6 ) then killTimer ( lejartimer6 ) end if isTimer ( lejartimer7 ) then killTimer ( lejartimer7 ) end if isTimer ( lejartimer8 ) then killTimer ( lejartimer8 ) end if isTimer ( lejartimer9 ) then killTimer ( lejartimer9 ) end if isTimer ( lejartimer10 ) then killTimer ( lejartimer10 ) end end end addEvent("ctimers",true) addEventHandler("ctimers", root,stimers) Why not working the killTimers? How to fix this?
  5. This is the code: When i type twice " /asd " the marker position does not change.. How to fix this?
  6. I want create a script, which create a marker with random position, from a table. How to make this?
  7. Lua ile ilgili her desteği ücretsiz olarak verebilirim. Piyasaya kopyala - yapıştır yöntemi veya editlenip sunulmuş eklentilerden çok Türkler tarafından kodlanmış eklentilerin bulunmasını istiyorum. Aklınıza takılan en ufak sorunda benimle iletişime geçebilir veya forumda konu açarsanız yardım etmekten memnun olurum. Bunun dışında 0'dan başlamak isteyen veya halihazırda birşeyler bilenler kendi kodladığım sunucuya yardım etmek ve geliştirmek isteyenler benimle iletişime geçebilir. Discord : Asokanta#9451
  8. This is the code: And i get this warnings: bad argument @ 'stopSound' [expected sound at argument 1, got nil] and bad argument @ 'detachElement' [expected element at argument 1, got nil] .. -.- how to fix this?
  9. [HELP] libmysql16 problem

    [2018-01-12 14:55:12] ERROR: Could not load /home/gameservers/mta/turbo1/x64/./ - /home/gameservers/mta/turbo1/x64/./ symbol __cxa_pure_virtual, version libmysqlclient_16 not defined in file with link time reference[2018-01-12 14:55:12] ERROR: san_mysql/server.lua:19: dbConnect failed; Could not connect [2018-01-12 14:55:12] INFO: [mysql]: Sikertelen MYSQL csatlakozás! please help me, how to fix this?
  10. This is the code: addEvent ( "aPlayer", true ) addEventHandler ( "aPlayer", _root, function ( player, action, data, additional, additional2, kickedname ) if checkClient( "command."..action, source, 'aPlayer', action ) then return end if not isElement( player ) then return -- Ignore if player is no longer valid end if ( hasObjectPermissionTo ( source, "command."..action ) ) then local admin = source local mdata = "" local more = "" if ( action == "kick" ) then local reason = data or "" mdata = reason~="" and ( "(" .. reason .. ")" ) or "" setTimer ( kickPlayer, 100, 1, player, source, reason ) exports.ig_kickban:showBoxS (root ,"Kirúgás", player.." kirúgta "..source.." nevű játékost", "kick") the exports.ig_ki...etc line does not working.. why? i get this error: "Attempt to concatenate global source (a userdata value)"
  11. NAME-TAG (À VENDA) ❯Script de name-tag 100% em Dx e bonito disponível para compras. Vídeo de demonstração acima. ❯Compre acessando:
  12. I tried triggering, but does not working :c How to get my account name in client side?
  13. waht is the commands

    what is the commands to create a video intro for server ? and how to create automated video stop timer ? addEventHandler("onClientResourceStart",resourceRoot, function () ? = ?("video.mp4",true) end )
  14. this is the code: and the problem: if i'm far away then the dx elements will be bigger, and when i'm closer.. how to fix this?
  15. this is the code(not the full code): function markerbelepkocsival() if isPedInVehicle ( localPlayer ) then local playerVehicle = getPlayerOccupiedVehicle ( localPlayer ) addEventHandler("onClientRender", root, paynspray1) addEventHandler("onClientRender", root, paynspray2) addEventHandler("onClientRender", root, paynspray4) guiSetVisible(GUIEditor.button[1], true) guiSetVisible(GUIEditor.button[2], true) guiSetVisible(GUIEditor.button[3], true) setElementFrozen ( playerVehicle, true ) playSound("1.mp3") showChat(false) showCursor(true) end end addEventHandler ( "onClientMarkerHit", merker1, markerbelepkocsival ) when i hit the marker, the panel will appear to everyone.. how to fix this? :c
  16. GTA:SA Cooperation Edition

    Hello World, having been playing a lot of different GTA games, for about 3 years on many different SAMP and MTA servers with friends. Including going through the GTA story line many times . I thought that it would be a great variety to create a possibily of two players going through the whole story line together. I searched the internet to find a solution. I came across a user NewbProgramming, who wrote on the forum that he wants to do something similar. However I do not know the progress in his project. I decided to take matters into my own hands and write such a script myself at LUA. There is a lot of work involved, but if anyone knows a tool that could help me, then please contact me on this forum, maybe there is a script that will automatically convert the singleplayer code to MTA LUA? Here is my ideas, how to match missions into two players mode: and here is a little bit changed story line: and here are my scraps of code which i wrote to this time: I hope you like it If you are interested in or want to help somehow, leave a sing
  17. What wrong with this script? Error: script.lua:1: unexpected symbol near '?' How to fix this?
  18. So i've got this little problem, when i try to hit a door (Model ID : 1535) it was opened. But, when i try to hit another door (Model ID : 3089) It was surprisingly didn't opened, it doesn't move from it's place. Is there a proper solution for this problem? maybe it have something to do with scripting, or else?
  19. Hi guys, I'm realtive new into scripting and as far as I know, I like it alot Right now I'm working on a simple but useless script that querys a MySQL Database to get a list of serials (random) then using a GUI Window with a gridList the user is able to see the table I have add a function to only make the system work for Admin Users It works like this The client side contains the GUI, when the user wants to open the panel, I added an CommandHandler that goes to a function that verify if the source is an admin, if it is, it triggers an ClientEvent that creates and display the GUI Then there is a button on the GUI that when it is clicked it triggers an Server Event that querys the Database and Triggers an Client Event to send the table with the information, then just using a for I fill the table of the grid list My Question -How secure it is ? can I get Hacked by the way my script is coded? -Any recomendation of how can I make it better? Thanks! Here is the code Client.lua --Function to create the GUI function createGUI() --Create the window window = guiCreateWindow(374, 221, 1181, 647, "Script", false) guiWindowSetSizable(window, false) Grid = guiCreateGridList(12, 52, 257, 408, false, window) QueryB = guiCreateButton(12, 465, 257, 37, "QUERY", false, window) Colum = guiGridListAddColumn( Grid, "Serial", 1.0 ) ExitB = guiCreateButton(466, 596, 249, 41, "Exit", false, Window) --Add event handler when the exit button is presed addEventHandler("onClientGUIClick", ExitB, closeGUI, false ) --Add event handler when the query button is presed addEventHandler("onClientGUIClick", QueryB, function() triggerServerEvent("sendMeTheData",resourceRoot) --This triggers the server Event that triggers a client event with the table end , false ) end --Function to start the GUI function startGUI() --Create GUI createGUI() --If everything is fime then set it to visible if (window ~= nil) then guiSetVisible(window, true) else outputChatBox("error") end --show cursor showCursor(true) guiSetInputEnabled(true) end --Function to close GUI function closeGUI() --hide the GUI guiSetVisible(Window, false) showCursor(false) guiSetInputEnabled(false) end --Function to fill the grid list row function fillRow(table) guiGridListClear(Grid) --clear the grid list --using for, fill the grid with the table for k, data in ipairs(table) do local row = guiGridListAddRow ( Grid ) guiGridListSetItemText ( Grid, row, Colum, data.serial , false , false ) --add item to row end end --Events and Event Handler addEvent("fillData",true) addEventHandler("fillData",getRootElement(),fillRow) addEvent("showGUI",true) addEventHandler("showGUI",getRootElement(),startGUI) Server.lua --MySQL data local host = "x.x.x.x" local user = "user" local password = "password" local database = "database" --Connect to mysql server local conexion = dbConnect( "mysql", "dbname="..database..";host=",user,password, "share=1") --Function to show the GUI function showPanel(player,cmd) --see if the player is admin if (isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))) then --trigger client event to open the GUI triggerClientEvent(player,"showGUI",player) else outputChatBox("Sorry, you are not admin!",source) end end --Function to query mysql database and trigger client function to send table function getOnlyRow(tipo) local query = dbQuery(conexion,"SELECT * FROM log") local table = dbPoll(query,-1) --Trigger client event to fill grid list triggerClientEvent(client,"fillData",client,table) end --Event and event handler addEvent("sendMeTheData",true) addEventHandler("sendMeTheData",getResourceRootElement(),getTable) addCommandHandler("panel",showPanel)
  20. [HELP] Time spent in scoreboard

    so hello so i tried adding days and weeks but all i got was error and i can't figure way how to make days from hours and then weeks from days code: exports.scoreboard:addScoreboardColumn('time') local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "time", tostring( hour )..'h '..tostring( min )..'min.' ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'time' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "time-hour", tostring(hour) ) setAccountData ( playeraccount, "time-min", tostring(min) ) setAccountData ( playeraccount, "time-sec", tostring(sec) ) setAccountData ( playeraccount, "time", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "time" ) local hou = getAccountData ( playeraccount, "time-hour") local min = getAccountData ( playeraccount, "time-min") local sec = getAccountData ( playeraccount, "time-sec") if ( time ) then setElementData ( source, "time", time ) t[ source ]["hour"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "time",0 ) setAccountData ( playeraccount, "time",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin )
  21. I want create a help panel, with html, but i don't know how to make this.. Anyone can help?
  22. i want save grid list rows to xml, and load from xml.. but how to make this?
  23. i want make a joinquit script, but i want the join, disconnect..etc messages show in right side, like killmessages, it is possible? if yes, how??
  24. ..this is not the full code from my nametag: when i press 'T', the chaticon appear on everybody.. how to fix this? i want, when a player, or me press 'T', the ballon show just on the player, or on me, not on everyplayers... sorry for my terrible english .. :c
  25. Necesito ayuda por favor! Hola gente, soy algo nuevo en esto de crear scripts, y estoy intentando crear un script de zombies, mediante slothbot, y a esos "zombies" o bots, quiero cambiarles las animaciones al caminar. A ver si me explico mejor, estoy intentando crear bots mediante slothbot, los cuales deben estar destinados a seguir a los jugadores. Hasta ahí todo bien, no es algo tan complejo. Mi problema es el siguiente: ¿Cómo puedo hacer para cambiar la forma en la que caminan dichos bots? ¿Hay alguna forma de cambiar su animación al atacar/caminar? Gracias por su tiempo gente, un saludo grande!