Search the Community

Showing results for tags 'lua'.

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 195 results

  1. 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.
  2. 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?
  3. This is the code: When i type twice " /asd " the marker position does not change.. How to fix this?
  4. I want create a script, which create a marker with random position, from a table. How to make this?
  5. 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?
  6. 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)"
  7. I tried triggering, but does not working :c How to get my account name in client side?
  8. 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?
  9. What wrong with this script? Error: script.lua:1: unexpected symbol near '?' How to fix this?
  10. [HELP DGS]GUI showing all.

    Hello, why gui showing(hide also) all, and add all row???? DGS = exports.dgs function LGUI(player) if getLocalPlayer() == localPlayer then Login = DGS:dgsDxCreateEdit(0.16, 0.4, 0.20, 0.05, "", true) Pass = DGS:dgsDxCreateEdit(0.16, 0.47, 0.20, 0.05, "", true) DGS:dgsDxEditSetMasked(Pass, true ) LOGIN_BUTT = DGS:dgsDxCreateButton(0.20, 0.55, 0.1, 0.05, "Zaloguj", true) showCursor(true) showChat(false) end end addEventHandler("onClientResourceStart", root, LGUI) function Login_click() if source == LOGIN_BUTT then local TEXT_LOGIN = DGS:dgsDxGUIGetText(Login) local TEXT_PASS = DGS:dgsDxGUIGetText(Pass) triggerServerEvent("LOGIN_CLICK", root, TEXT_LOGIN, TEXT_PASS) end end addEventHandler ("onClientDgsDxMouseClick", root, Login_click) addEvent("LOGIN_TRUE", true) function Login() DGS:dgsDxGUISetVisible(Login, false) DGS:dgsDxGUISetVisible(Pass, false) DGS:dgsDxGUISetVisible(LOGIN_BUTT, false) triggerEvent("LOGGED", root) end addEventHandler("LOGIN_TRUE", root, Login) AND getSelected = 0 addEvent("LOGGED", true) function CHGUI() CH_GRID = DGS:dgsDxCreateGridList (346, 163, 433, 403, false ) CH_BUTT = DGS:dgsDxCreateButton(0.20, 0.55, 0.1, 0.05, "Wybierz postać", true) CH_GRID_CID = DGS:dgsDxGridListAddColumn(CH_GRID, "CID", 0.5 ) CH_GRID_NAME = DGS:dgsDxGridListAddColumn(CH_GRID, "Imie i nazwisko", 0.2) triggerServerEvent("GET_CH", root) end addEventHandler("LOGGED", root, CHGUI) addEvent("CH_INFO", true) function setCH(CHS,CH_CID, CH_NAME) for i,v in ipairs(CHS) do ROW_CH = DGS:dgsDxGridListAddRow(CH_GRID) SET_ROW_CID = DGS:dgsDxGridListSetItemText(CH_GRID, ROW_CH, CH_GRID_CID, CH_CID[i]) SET_ROW_NAME = DGS:dgsDxGridListSetItemText(CH_GRID, ROW_CH, CH_GRID_NAME, CH_NAME[i]) end end addEventHandler("CH_INFO", getLocalPlayer(), setCH) addEventHandler ( "onClientDgsDxMouseClick", root, function() if source == CH_GRID then Selected = DGS:dgsDxGridListGetSelectedItem(CH_GRID) getSelected = DGS:dgsDxGridListGetItemText(CH_GRID, Selected, CH_GRID_CID) end if source == CH_BUTT then if Selected == -1 or getSelected == 0 then outputChatBox("Nie wybrales postaci!") else triggerServerEvent("getCID", root, getSelected) end end end) addEvent("CH_SELECT", true) function hideCHGUI() DGS:dgsDxGUISetVisible(CH_GRID, false) DGS:dgsDxGUISetVisible(CH_BUTT, false) showCursor(false) showChat(true) end addEventHandler("CH_SELECT", root, hideCHGUI)
  11. [HELP] WarpToMe script.

    Hi! I've started learning to script LUA and i want to warp players TO me by command instead of admin panel but my currect script isn't working, some help would be appreciated. addCommandHandler( "w2m", function( sourcePlayer, command, targetPlayerName ) if targetPlayerName then -- We check if an target has been set if getPlayerFromName(targetPlayerName) then -- We get the player element instead of the player name. if not (targetPlayerName == getPlayerName(sourcePlayer)) then -- We make sure the player isn't trying to warp to himself setElementPosition( targetPlayerName, 0, 0, 3 ) else outputChatBox("[Error] You can't warp to yourself!", sourcePlayer, 255, 0, 0, false) return false end else outputChatBox("[Error] Player could not be found, maybe he/she is offline?", sourcePlayer, 255, 0, 0, false) return false end else outputChatBox("[Error] Please choose a target", sourcePlayer, 255, 0, 0, false) return false end end ) Error: Thanks in advance!
  12. I want create a help panel, with html, but i don't know how to make this.. Anyone can help?
  13. i want save grid list rows to xml, and load from xml.. but how to make this?
  14. 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??
  15. [Help] SetElementModel

    Hello everyone! I am new to this scripting stuff so I am looking for help. For the last few days I have been trying to make work SetElementModel and have no success. What I want this script to do is to change one vehicle to another while you are driving it. Any suggestions? Here is link to the site- Also here is the code I used. addCommandHandler ( "changeveh", function ( thePlayer, command, newModel ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) newModel = tonumber ( newModel ) if theVehicle and newModel then setElementModel ( theVehicle, newModel ) end end )
  16. ..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
  17. Hello everyone! I am new to this scripting stuff so I am looking for help. For the last few days I have been trying to make work SetElementModel and have no success. What I want this script to do is to change one vehicle to another while you are driving it. Any suggestions? Here is link to the site-
  18. Hello I have a nametag script. And i have a chat-icon script too. But i want add the chat-icon thing to nametag script, above the player nametag. And do not appear for me, just another players. This is possible? If yes, how? Sorry for my bad english..
  19. This is the code: function onPlayerQuit ( thePlayer) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local nametagszin = getPlayerNametagColor ( thePlayer ) setAccountData ( playeraccount, "ntszin", nametagszin ) end end end function onPlayerLogin (_, playeraccount ) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) then local nametagszin = getAccountData ( playeraccount, "ntszin" ) if ( nametagszin ) then setPlayerNametagColor ( thePlayer, r, g, b ) end end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) No error(s)/warning(s) in debugscript 3.. What wrong?
  20. Where can i download overdose effects with script for mta sa?
  21. i created a HUD with rectangles (bg rectangle, hp, armor...etc), and i want this make movable, so that move at the same time, but i don't know how to make this possible anyone can help? sorry for my bad english :c
  22. i want change the needle color if speed >= 240, but does not working how to fix this? what wrong? no error(s)/warning(s)
  23. i created a dx panel, and i created some onClientClick event for this panel. but when i hide the panel, the onClientClick events are working.. how to fix this?
  24. На проект требуется разработчик LUA. Нужно доделать работу при ведущего скриптера и при желании остаться на постоянной основе. Работу оплачиваем поэтапно - (обсуждаемо). Кратко о том что надо сделать: Надо переделать регистрацию и авторизацию сделать её на мускле. Переделать ресурсы работ, чтобы деньги за работу выдавались в таблицу аккаунтов в отдельную вкладку money в мускуле. Так же подкорректировать иные системы и совместить с Mysql. контакты
  25. I want convert Vice City map to my server, it is possible somehow?