Jump to content

Search the Community

Showing results for tags 'scripting'.

  • 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. 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)
  2. exports["rangos_bejelentkezes"]:addNotification(player, "Megnyerted a reakció tesztet!", "success") i added this line to a script, but the notification show everyone how to fix this? |Sorry for my very bad English:c|
  3. 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?
  4. 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?
  5. 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/
  6. 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]
  7. I can not convert a mask, I used this code below, but at the time of selecting the MTA date. P.S: I have already tested other types of masks and still crashes. (Google Translate) txd = engineLoadTXD("hockey.txd") engineImportTXD(txd, 30376) dff = engineLoadDFF("hockeymask.dff",30376) engineReplaceModel(dff, 30376)
  8. i downloaded a freeroam, in wich it was missing giveweapon button, and panel, i added from the default freeroam script, but doesn't working, does not give weapons how to fix this? /sorry for my bad English:c/
  9. 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..
  10. 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?
  11. 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?
  12. 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
  13. 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?
  14. --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?
  15. 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?
  16. 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/
  17. So hello everyone it's me, Lopex, once again! Today I have thought of something new I can try to make! It's a mower job! The idea is that a player goes to some mowers that would be spawner in Glen Park, then get on them and have a option like /startmowing in chat, then when they do such command they get told in chat to start driving around, and as they drive around Glen Park they would have a little bar on their screen that fills up and when it's full it goes away and gives you some money! So steps that I believe will be required: Spawn the vehicle via spawnVehicle (coords, rotation) After spawning the vehicle we check if the player is in that vehicle If it's a mower then you get the option in chat, if not then nothing After player does the certain command they start mowing and are required to drive around. It displays a little bar that fills up as they drive When set bar is full, they recieve a certain amount of money! (Doesn't get affected by speed or vehicle hp!!!) Displays the option to start mowing again. So.. The thing I am confused about is weather to use spawnVehicle or createVehicle... Like what is the difference? I want the mower to be there all the time, not by set event, so mabey we want to do onResourceStart ? Or can we just do a cmd like spawnVehicle or createVehicle alone, without any event or anything, just at the top of the script? Also I got confused by one more thing.. If let's say I do something like: function spawnMower(--what do I place here?) --And I don't mean only on the event "onResourceStart" I mean like overall what do I place there? addEventHandler(onResourceStart, getRootElement(), spawnMower) As I say it there... What do I place in those () brackets? Does it work like: Since I have onResourceStart (Which doesn't have any arguments) I don't need to place anything there? But if it let's say had something with like 2 arguments, then I need to place those there? Someone please help me out with my questions and remember! THE AIM IS FOR ME TO LEARN NOT TO GET A FINISHED SCRIPT FAST! I will make a mini-script as far as I think I can take it. When I get home that is. Thanks for all your patience to read this and thanks if you replied in any, shape or form!
  18. 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?
  19. Hello , can y'all help me for scripting Gamemodes , if player joined/spawning , the player spawn on a car ..
  20. Hello everyone, It's Lopexsw again here! So I have thought of a new script I want to make with your (The Pro scripters) help! My aim is to make a script that when a player gets into a certain vehicle for example Journey 508 they have the option to do /cookmeth and then if they have the required ingredients in their inventory, they can start cooking meth! But if for example they don't have a gas mask (Which is possible to get in the server I play, but I doubt this script will be there ever.) they're health would go a bit down while they do it! So as I see the steps are something along the lines of this: When a player gets into a vehicle, check what vehicle that is. If it's a Journey (id 508) then display message in chat that they have a option to cook meth. *If it's not a journey don't show anything* When the player writes /cookmeth check they'r inventory for certain items. If they have the certain items, then freeze them for 3 minutes. *If not, display message you can't do it* At the same time display a countdown of the 3 minutes saying "3 minutes of cooking remaining" or something like that that goes down. After 3 minutes, unfreeze the player. Take the items required and give the meth to the player! So 1 problem that I thought of, is this client side or a server side script? I think it's server sided. As always, any help is hugely appreciated, and I will try to make something myself too, not just get a result from you guys! #1 priority is learning! #2 is a done well made script for someone's server! I think this will be a very intresting script!
  21. 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??
  22. 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??
  23. local function ujteamsay(message, messageType) if messageType == 2 then cancelEvent() outputChatBox("(CSOPORT) "..getPlayerName(source)..": #FFffFF"..message, root, red, green, blue, true ) end end addEventHandler("onPlayerChat", root, ujteamsay) how to fix this? i want just team mates see the message.. *sorry for my very bad English :c*
  24. local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawRectangle(screenW * 0.0021, screenH * 0.7356, screenW * 0.2104, screenH * 0.0367, tocolor(0, 0, 0, 164), false) dxDrawText(text, screenW * 0.0014, screenH * 0.7367, screenW * 0.2125, screenH * 0.7722, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, true, false) end ) addEventHandler("onClientPlayerJoin", root, function() local l_2_0 = getPlayerName(source) text = "#00ff00" .. l_2_0 .. " csatlakozott!" pic = "j" end ) addEventHandler("onClientPlayerQuit", root, function(l_3_0) local l_3_1 = getPlayerName(source) text = "#FF0000" .. l_3_1 .. " lelépett!" pic = "q" end ) addEventHandler("onClientPlayerChangeNick", root, function(l_4_0, l_4_1) text = "" .. l_4_0 .. "#00FF00 Új neve #00BAFF: " .. l_4_1 .. "" pic = "c" end ) fileDelete("client.lua") and i got this warning: : 6 : bad argument 'dxDrawText' [expected string at argument 1, got nil] how to fix this?
  25. function North () local north = createBlipAttachedTo ( north, 4 ); dxDrawImage(north, 20, 20, 'files/images/blips/north.png', 0, 0, 0, tocolor(0, 0, 0, 255), false); end i tried this, but doesn't working. how to add north blip to a radar script?
×
×
  • Create New...