Jump to content

Search the Community

Showing results for tags 'Lua'.

  • 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

  1. function fvalt( prevSlot, newSlot ) if getElementData (target, "greenzone") then setPedWeaponSlot(source,0) end end addEventHandler ( "onClientPlayerWeaponSwitch", localPlayer, fvalt ) i added this to a greenzones script, but this doesn't working, why?
  2. I want create a nametag script,but i don't know, how. How to place the dxdrawrectangle on my head?
  3. I want create a last login script, what output to the chatbox my last login, with date, and hours, when i login. But how to create?
  4. if AdminGate then destroyElement(AdminGate) end local AdminGate = createObject ( 1560, 1346.78, -1759.83630, 12.5, 0, 0, 0 ) local state = 0 function move() if state == 0 then moveObject ( AdminGate, 2500, 1348.68652, -1759.83630, 12.5) state = state + 1 elseif state == 1 then moveObject ( AdminGate, 2500, 1346.78, -1759.83630, 12.5) state = state - 1 end end addCommandHandler("coopajto", move ) fileDelete("c.lua") when i type the command, the door move just for me how to fix this?
  5. function countdownFin() removeEventHandler("onClientRender", root, eventszamlalas) end local countdown = setTimer(countdownFin, 5000, 1) local screenW, screenH = guiGetScreenSize() function eventszamlalas() local x = getTimerDetails(countdown) local timeLeft = math.ceil(x/1000) dxDrawLine((screenW * 0.4111) - 1, (screenH * 0.1244) - 1, (screenW * 0.4111) - 1, screenH * 0.1589, tocolor(254, 254, 254, 255), 1, false) dxDrawLine(screenW * 0.6118, (screenH * 0.1244) - 1, (screenW * 0.4111) - 1, (screenH * 0.1244) - 1, tocolor(254, 254, 254, 255), 1, false) dxDrawLine((screenW * 0.4111) - 1, screenH * 0.1589, screenW * 0.6118, screenH * 0.1589, tocolor(254, 254, 254, 255), 1, false) dxDrawLine(screenW * 0.6118, screenH * 0.1589, screenW * 0.6118, (screenH * 0.1244) - 1, tocolor(254, 254, 254, 255), 1, false) dxDrawRectangle(screenW * 0.4111, screenH * 0.1244, screenW * 0.2007, screenH * 0.0344, tocolor(0, 0, 0, 161), false) dxDrawText("Az event elkezdődött! Vége: "..convertSecondsToMinutes(timeLeft), screenW * 0.4118, screenH * 0.1244, screenW * 0.6118, screenH * 0.1589, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end function eventstart() addEventHandler("onClientRender", root, eventszamlalas) end addCommandHandler("asd", eventstart) function convertSecondsToMinutes(sec) local temp = sec/60 local temp2 = (math.floor(temp)) local temp3 = sec-(temp2*60) if string.len(temp3) < 2 then temp3 = "0"..tostring(temp3) end return tostring(temp2)..":"..tostring(temp3) end i created a command, which displays the dx elements, and the timer, but the timer starts with the script, and when it expires, the command doesn't working.. i want, when i type command, show dx elements to everyone, and start timer, how to fix this ? sorry for my very bad English..:|
  6. can anyone learn me how to use the SmoothMoveCamera code? cause i've a small login screen and set the camera on "setCameraMatrix(2565.2, 136.3, 48.8, 2531, 93, 26.8)" but i need it to be moved
  7. rablashelye = createMarker ( 252.3,-54.6,0.9, "cylinder", 1, 255, 255, 255, 170 ) function beleallas(thePlayer) outputChatBox("test",thePlayer,r,g,b,true) setPedAnimation ( thePlayer, "DANCING", "dnce_m_b") end addEventHandler( "onMarkerHit", rablashelye, beleallas ) setTimer( function(thePlayer) setPedAnimation(thePlayer,false) end,1000,0)
  8. Hello! There was such question: it is possible to make a window with buttons and pictures by means of html / css and to make a bind on the button? Something like a GUI window, just made with html. I am hope for your help!
  9. x,y = guiGetScreenSize() image = guiCreateStaticImage( x*0.05, y*0.1, x*0.9, y*0.7, "border.png", false) local browser = guiCreateBrowser(x*0.113, y*0.045, x*0.673, y*0.605, false, false, false, image) guiSetVisible ( image, false ) local theBrowser = guiGetBrowser(browser) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(source, "http://tinyurl.com/lysqs6y") end ) function funct() if guiGetVisible ( image ) == false then showCursor ( true ) guiSetVisible ( image, true) else showCursor ( false) guiSetVisible ( image, false) end end addCommandHandler("honfoglalo", funct) why not working? when i change the URL to "http://youtube.com" the YT is working, but this why not?
  10. function dependent(player) local accountName = getAccountName ( getPlayerAccount ( player ) ) local hour = getAccountData ( playeraccount, "Játszott idő-hours") if hour = 30 then aclGroupAddObject (aclGetGroup("Dependent"), "user."..accountName) end end i got this error: [22:44:11] ERROR: Loading script failed: jatszottido\ji.lua:86: 'then' expected near '=' how to fix this?
  11. i downloaded this script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11102 and added to my server, but some player doesn't want to raise, and i want create a /antigg script, that they could not lift players, but i don't know how. anyone can help? /sorry for my bad English/
  12. function autostat(thePlayer) setPlayerStat(thePlayer, 24, 1000) setElementHealth(thePlayer, 255) end addEventHandler("onResourceStart", resourceRoot, autostat) i got this warnings: [22:09:28] WARNING: autostat\autostat.lua:2: Bad argument @ 'setPlayerStat' [Expected element at argument 1, got resource-data] [22:09:34] WARNING: autostat\autostat.lua:3: Bad argument @ 'setElementHealth' [Expected element at argument 1, got resource-data]
  13. In 1440x900 resolution, the dx elements they are in the right place, but in 1920x1080 the dx elements move up, and in 1366x768 the dx elements move down.. Why? how to fix this? the guigetscreensize is added with the correct coordinates..
  14. function payScript(player,cmd,other,amount) local money = getPlayerMoney(player) local otherPlayer = getPlayerFromName(other) if not other or not amount then outputChatBox("#00BAFF[Play] #FFffFFHelyes használat: #0088FF/pay <név> <összeg>!",player,0,255,255, true) end if ((money - amount) < 0) then outputChatBox("#00BAFF[Play] #FFffFFNincs elegendő #0088FFpénzed!",player,0,255,255, true) return else setPlayerMoney(otherPlayer,getPlayerMoney(otherPlayer) + amount) setPlayerMoney(player,money - amount) outputChatBox("#00bAFF[Play] #0088FF"..amount.."Ft-ot #FFffFFküldtél neki: #0088FF"..other.."!",player,0,255,255, true) outputChatBox("#00BAFF[Play] #FFffFFKaptál #0088FF"..amount.."Ft-ot #FFffFFtőle: #0088FF"..getPlayerName(player).."!",otherPlayer,0,255,255,true) end end addCommandHandler("pay",payScript) and i got this error: xy.lua:11: attempt to perform arithmetic on a boolean value how to fix this?
  15. function aAction ( type, action, admin, player, data, more ) if ( aLogMessages[type] ) then function aStripString ( string ) string = tostring ( string ) string = string.gsub ( string, "$admin", getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) string = string.gsub ( string, "$by_admin_4all", isAnonAdmin4All( admin ) and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) string = string.gsub ( string, "$by_admin_4plr", isAnonAdmin4Victim( admin ) and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) string = string.gsub ( string, "$data2", more or "" ) if ( player ) then string = string.gsub ( string, "$player", getPlayerName ( player ) ) string = string:gsub("#%x%x%x%x%x%x","") end return tostring ( string.gsub ( string, "$data", data or "" ) ) end local node = aLogMessages[type][action] if ( node ) then local r, g, b = node["r"], node["g"], node["b"] if ( node["all"] ) then outputChatBox ( aStripString ( node["all"] ), _root, r, g, b ) end if ( node["admin"] ) and ( admin ~= player ) then outputChatBox ( aStripString ( node["admin"] ), admin, r, g, b ) end if ( node["player"] ) then outputChatBox ( aStripString ( node["player"] ), player, r, g, b ) end if ( node["log"] ) then outputServerLog ( aStripString ( node["log"] ) ) end end end end i added this lines to 'admin_server.lua', but doesn't working the script i got a lot of errors from 'admin_sync.lua':194: attempt to index global 'aPlayers' (a nil value) and rom 'admin serverjoiner.lua':48: attempt to call global 'checkClient' (a nil value) but when i add the original 'aActions' function, the errors will disappear. why? how to fix this?
  16. addEventHandler("onPlayerLogin", getRootElement(), function () local name = getPlayerName ( source ) name:gsub("#%x%x%x%x%x%x", "") if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then exports[getResourceName(resource)]:addNotification(root, name.." tulajdonos szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Moderator")) then exports[getResourceName(resource)]:addNotification(root, name.." moderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("SuperModerator")) then exports[getResourceName(resource)]:addNotification(root, name.." szupermoderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Modi")) then exports[getResourceName(resource)]:addNotification(root, name.." moderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Operator")) then exports[getResourceName(resource)]:addNotification(root, name.." operátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("zuker")) then exports[getResourceName(resource)]:addNotification(root, name.." moderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Adminseged")) then exports[getResourceName(resource)]:addNotification(root, name.." adminsegéd szolgálatba lépett!", "warning") end end ) i added 'gsub' but the color code not disappear
  17. Hello guys!How can i use the variables bannedBy, and accountID outside of this code block? local bannedBy local accountID for _, row in ipairs(query) local bannedBy = row["bannedBy"] local accountID = row["accountID"] end
  18. addEventHandler ( "onElementModelChange", root, function ( oldModel, newModel ) local account = getPlayerAccount ( source ) local accountName = getAccountName ( account ) if ( newModel == 60 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then outputChatBox ( "Bocsi, de ez admin skin. Te nem használhatod! :(", source, r, g, b ) setElementData ( source, oldModel ) end end ) outputChatBox is working fine, but the player can change his skin to 60 no errors/warnings in debugscript How to fix this?
  19. --server-- function kivesz() local accountName = getPlayerAccount(source) if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" )) then aclGroupRemoveObject(aclGetGroup("Admin"), "user."..accountName) end end addCommandHandler("rangki", kivesz) function betesz() local accountName = getPlayerAccount(source) if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" )) then aclGroupAddObject (aclGetGroup("Admin1"), "user."..accountName) end end addCommandHandler("rangbe", betesz) and i got this errors and warnings: http://imgur.com/a/tI7mJ how to fix this?
  20. local acl = getPlayerAcls(thePlayer) dxDrawColorText ("#00BAFF" .. getPlayerName(player) .. " " .. state .. "" .. " (" .. tostring(acl) .. ")", sx-w, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), player ~= g_Me and textscale*NAMETAG_TEXTSIZE or (textscale*NAMETAG_TEXTSIZE)/1.5, srfont, "center", "bottom", false, false, false ) local drawX = sx - NAMETAG_WIDTH*scale/2 how to fix this?
  21. i want to add afk check to my nametag, but i dont know how i tried this, but doesn't working --server function checkAFKPlayers() for index, thePlayer in ipairs(getElementsByType("player")) do if (getPlayerIdleTime(thePlayer) > 300000) then AFKCheck = "AFK" end end end setTimer(checkAFKPlayers, 30000, 0) --client (only the two line) local AFKCheck = {} dxDrawColorText ("#00BAFF" .. getPlayerName(player) .. " (" .. AFKState .. ")", sx-w, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), player ~= g_Me and textscale*NAMETAG_TEXTSIZE or (textscale*NAMETAG_TEXTSIZE)/1.5, srfont, "center", "bottom", false, false, false ) how to make this working? /sorry for my bad english:c/
  22. i added this lines to my admintag script, but...doesn't working. no errors/warnings in debugscript 3 :'s settings = { ['antiswear'] = { ['enabled'] = true, ['swears'] = { ['asshole'] = '*******', [':O'] = '****', ['slut'] = '****', ['bitch'] = '*****', [':O'] = '****', ['whore'] = '*****', ['pussy'] = '*****', [':O'] = '***', ['perro'] = '*****', ['puta'] = '****', ['joder'] = '*****' } } } if settings['antiswear']['enabled'] then for i, v in pairs(settings['swearFilter']['swears']) do while msg:lower():find(i:lower(),1,true) do local start, end_ = msg:lower():find(i:lower(),1,true) local found = msg:sub(start,end_) msg = msg:gsub(found,v) end end end what wrong? how to fix this?
  23. I've edited bonsai's script wrapper and using it, it looks like this: local env = {} local _createObject = createObject local _setTimer = setTimer local _addEventHandler = addEventHandler outputChatBox = function() end triggerServerEvent = function() end createObject = function(...) local object = _createObject(...) setElementDimension(object, dimension) table.insert(wrapper.objects, object) return object end function newClientEnvironment() env = table.copy(_G, true) local metatable = { __index = function(self, index) return rawget(_G, index) end, __newindex = function(_G, index, value) rawset(_G, index, value) end } setmetatable(env, metatable) _outputChatBox('created new Environment') end and this is how a script is loaded: function loadScript(scriptData) local loaded = loadstring(scriptData) setfenv(loaded, env) local ex = pcall(loaded) end The problem is the functions re-defined above interfere with my main script that is using this wrapper. i can just use this wrapper as a separate script but then i'll have to reload two scripts rather than 1, and i dont want that. any ideas? and thank you for reading
  24. local blockedTags = { "[VIP]", "[UltraVIP]", "[A]", "[M]", "[SM]" }; addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), function () for i, p in ipairs ( getElementsByType ( "player" ) ) do local tempName = getPlayerName ( p ); for x = 1, #blockedTags do if ( string.find ( tempName, blockedTags [ i ], 1, true ) ~= nil ) then kickPlayer ( source, "Rang tag nem lehet a nevedben! Szedd le! Köszikee :D" ); end end end end ); addEventHandler ( "onPlayerJoin", root, function () local name = getPlayerName ( source ); for i = 1, #blockedTags do if ( string.find ( name, blockedTags [ i ], 1, true ) ~= nil ) then kickPlayer ( source, "Rang tag nem lehet a nevedben! Szedd le! Köszikee :D" ); end end end ); addEventHandler ( "onPlayerChangeNick", root, function ( _, newNick ) for i = 1, #blockedTags do if ( string.find ( newNick, blockedTags [ i ], 1, true ) ~= nil ) then kickPlayer ( source, "Rang tag nem lehet a nevedben! Szedd le! Köszikee :D" ); end end end ); server.lua:9: bad argument #2 to 'find' (string expected, got nil) why??
×
×
  • Create New...