Jump to content

Search the Community

Showing results for tags 'code'.

  • 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
    • 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


Last Updated

  • Start


Filter by number of...


  • Start



About Me

Member Title





Found 18 results

  1. سلام عليكم شباب اتمني تكونو بأحسن حال حاولت اسوي رتبة ادمن جديدة غير الرتب المعروفة في باك اب اول جيمنج حاولت اسوي رتبة Server founder وهذه اسماء الملفات اللي عدلت عليها integration --> functions_s if string.find(forumPerms, SERVERFOUNDER) then return exports.anticheat:changeProtectedElementDataEx(thePlayer, "admin_level", 8, true) end integration --> g_configs --MAXIME mysql = exports.mysql TESTER = 25 SCRIPTER = 32 LEADSCRIPTER = 79 COMMUNITYLEADER = 14 TRIALADMIN = 18 ADMIN = 17 SENIORADMIN = 64 SERVERFOUNDER = 88 -- رقم السماح بكتابة الاوامر في قاعدة البيانات LEADADMIN = 15 SUPPORTER = 30 VEHICLE_CONSULTATION_TEAM_LEADER = 39 VEHICLE_CONSULTATION_TEAM_MEMBER = 43 MAPPING_TEAM_LEADER = 44 MAPPING_TEAM_MEMBER = 28 STAFF_MEMBER = {32, 14, 18, 17, 64, 15, 30, 39, 43, 44, 28, 88} AUXILIARY_GROUPS = {32, 39, 43, 44, 28, 88} ADMIN_GROUPS = {14, 18, 17, 64, 15, 88} staffTitles = { [1] = { [0] = "Player", [1] = "Trial Administrator", [2] = "Administrator", [3] = "Senior Administrator", [4] = "Lead Administrator", [5] = "Server Managment", [6] = "-", [7] = "Vice Founder", [8] = "Server Founder", -- الفاوندر }, integration --> g_staff function isPlayerServerFounder(player) if not player or not isElement(player) or not getElementType(player) == "player" then return false end local adminLevel = getElementData(player, "admin_level") or 0 return (adminLevel >= 8) -- اللفل حق الادمن end admin-system --> Player --> s_player_commands حاولت اخلي الفاوندر بس هو اللي يسوي امر givemoney وهذا التغيير موجود في admin-system --> Player --> s_player_commands والامر اهو function giveMoney(thePlayer, commandName, target, money, ...) if exports["integration"]:isPlayerServerFounder(thePlayer) then if not (target) or not money or not (...) then outputChatBox("SYNTAX: /" .. commandName .. " [Partial Player Nick] [Money] [Reason]", thePlayer, 255, 194, 14) else local username = getPlayerName(thePlayer) local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, target) if targetPlayer then money = tonumber(money) or 0 if money and money > 500000 then outputChatBox("For security reason, you're only allowed to give a player less than $500,000 at once.", thePlayer, 255, 0, 0) return false end if not exports.global:giveMoney(targetPlayer, money) then outputChatBox("Could not give player that amount.", thePlayer, 255, 0, 0) return false end هذه التغييرات فقط اللي سويتها وما سويت شئ غيرها وهذا الخطأ اللي يظهرلي في debugscript ساعدوني رجاءً ملاحظة : SERVERFOUNDER عشان الكود دا function getAdminGroups() -- this is used in c_adminstats to correspond levels to forum usergroups return { SUPPORTER, TRIALADMIN, ADMIN, SENIORADMIN, LEADADMIN, SERVERFOUNDER } end
  2. executeSQLQuery("CREATE TABLE IF NOT EXISTS `player_stats` (`username` TEXT, `Thirst` INT, `Hunger` INT)") addEventHandler("onPlayerQuit", function (Player) local atsh = getElementData(source, "Thirst") local hungry = getElementData(source, "Hunger") local username = getAccountName(getPlayerAccount(thePlayer)) local result = executeSQLQuery("SELECT * FROM player_stats WHERE `username` = ?", username) if (#result > 1) then executeSQLQuery("UPDATE `player_stats` SET `Hunger` = ?, `Thirst` = ? WHERE `username` = ?", hungry, atsh, username) else executeSQLQuery("INSERT INTO health (username, Thirst, Hunger) VALUES (?, ?, ?)", username, atsh, hungry) end end) addEventHandler("onPlayerLogin", root, function(_, account) local accountName = getAccountName(account) local result = executeSQLQuery("SELECT * FROM player_stats WHERE username = ?", accountName) if (#result > 1) then setElementData(source, "Thirst", result[1].Thirst) setElementData(source, "Hunger", result[1].Hunger) end end) it isn't working please help
  3. I'm trying to make a resource that obtain the name of a player like this line: local who = getPlayerName(playerSource), playerSource(who) but i got this GetPlayerName [expected element at argument 1, got nil] lua:13: attempt to call global 'playerSource' (a nil value) I need help :'c the script is of the type server
  4. Author and editor of Ilnaz Isangulov DxCreateDiagram Client-only function Draws an diargam on the screen for a single frame. In order for the diagram to stay visible continuously, you need to call this function with the same parameters on each frame update (see onClientRender). Syntax bool dxCreateDiagram (float N, float posX, float posY, float cleanWidth, int color = tocolor(255,255,255,255), float scaleXY = 1, bool postGUI = false) Required Arguments N: changing parameter, for example speed posX: the absolute X coordinate of the top left corner of the image posY: the absolute Y coordinate of the top left corner of the image cleanWidth: the width at which it will be cleaned and updated Optional Arguments color: Tints the image with a value produced by tocolor or hexadecimal number in format: 0xAARRGGBB (RR = red, GG = green, BB = blue, AA = alpha). postGUI: A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI). Example Example of a pendulum swinging from the top of the screen, made using dxDrawImage. local screenWidth,screenHeight = guiGetScreenSize() -- Get screen resolution. function renderDisplay ( ) dxCreateDiagram ( math.random ( 0, 200 ), 0, screenHeight / , , tocolor ( 255, 0, 255, 255 ) , 1, false ) end addEventHandler("onClientRender", root, renderDisplay) -- Keep everything visible with onClientRender. Author and editor of Ilnaz Isangulov This is required in the code! local dataTable = {} local zOld = 0 function dxCreateDiagram(N,x,y,cleanSize,color,size,gui) local _,h = guiGetScreenSize() local x = x or 0 local y = y or h/2 local N = N or 0 local cleanSize = cleanSize or h/2 local color = color or tocolor(255, 255, 255, 255) local size = size or 1 local gui = gui or false local izmen = (N-zOld) table.insert( dataTable, izmen) for i, z in pairs(dataTable) do local x3 = dataTable[i+1] or 1 local x2 = dataTable[i] or 1 if i >= cleanSize then for f,_ in pairs(dataTable) do table.remove(dataTable, f) end end dxDrawLine(x+(i-1), y+1-x2, x+i, y+1-x3, color,size,gui) end end Author and editor of Ilnaz Isangulov
  5. How can i add more than one ACL on this code if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Polis")) then
  6. hello all im trying to make this script work but im getting error ------client function top(data) for i,theKey in pairs(data) do local row = guiGridListAddRow(top10gridlist) guiGridListSetItemText(top10gridlist, row, top10column1, theKey[i][1], false, false ) guiGridListSetItemText(top10gridlist, row, top10column2, theKey[i][2], false, false ) guiGridListSetItemText(top10gridlist, row, top10column3, theKey[i][3], false, false ) end end errors : attempt to index field'?'[a number value] at line 5 guigridlistsetitemtext ... whats the reason?
  7. Guys,may be who has the code of rotate the camera on one axis, around the car? Very necessary!Please Sorry for my english.
  8. Hangya


    So hello I want to create a PUBG mod server, but I don't know how to create the gamemode. I want to create a lobby for players to play together. I also want to do the circle, you know, if you are not in the circle u will die or lost hp, i want to display it in the map, and after minutes it will be smaller and the end itt freeze. Can somebody help me?
  9. This is the code: When i type twice " /asd " the marker position does not change.. How to fix this?
  10. I'm really new at scripting, i may wanted to know how to create a vip system like: check time remaining, command to add vip to a player by his name and to remove
  11. So, yesterday i started to learn how to code in lua and i tried to find some plugin in sublime text 3 to auto complete my code (snippets) but i didn't found nothing so i decided start create a plugin for it so if you wanna help, here's the github of the project Mta snippets Here's the Mta classes Hope you can help
  12. I'm using guieditor 3.1.3. When I try to do Main Menu > Output after loading GUI code, the Output window doesn't open.
  13. السلام عليكم ورحمة الله وبركاته ... يرجى اتباع التالي قبل نشر محتوى خاص بك في هذا القسم عند نشر كود معين استخدم التاج لتحديد نوع هذا الكود كيف تقوم بتحديد التاج للغة ؟ الشرح اولاً قم بتحديد الكود ثم اضفط على هذه العلامة <> كما هو موضح في الصورة بعد ذلك قم بتحديد اللغة انظر الشكل التالي لتعرف كيف ثم اضفط على كلمة Insert into post -- Ex مثال عند انشاء كود من لغة جافا قبل التاج تكون بهذا الشكل // Hello.java import javax.swing.JApplet; import java.awt.Graphics; public class Hello extends JApplet { public void paintComponent(final Graphics g) { g.drawString("Hello, world!", 65, 95); } } اما بعد التاج تكون بهذا الشكل // Hello.java import javax.swing.JApplet; import java.awt.Graphics; public class Hello extends JApplet { public void paintComponent(final Graphics g) { g.drawString("Hello, world!", 65, 95); } } آخر تحديث 21/3/2017
  14. 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?
  15. 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
  16. السلام عليكم ورحمة الله وبركاتة الكثير كان يبحث عن برنامج الـ MTA Editor اللي كان يدعمة ويبرمجة @50p لكنة الان توقف عن دعم البرنامج بسبب الاخطاء والمشاكل اللي واجهها فية هذا البرنامج اللي اسمة Sublime Text 3 نفس الـ Notepad+ لكن 50p مسوي اضافة عليه بحيث ضايف جميع وظائف الام تي اي في الـ LUA وان ماكانت جميعها فـ اغلبها طريقة التثبيت : قم بتحميل Sublime Text 3 من هنا : https://www.sublimetext.com/3 وبعد تحميل البرنامج وتثبيتة اتبع هذه الارشادات للتثبيت اضافة لغه LUA + MTA Functions : https://dl.dropboxusercontent.com/u/4370616/mtatools/SublimeText/50pMTAEditor.zip قم بتحميل الملف التالي بعد تثبيت البرنامج السابق : بعد تحميل الملف اذهب الى المسار التالي : C:\Users\\AppData\Roaming\Sublime Text 3\Packages\User\ 50pMTAEditor قم بانشاء مجلد جديد باسم 50pMTAEditor.zip استخرج محتويات هذا الملف في المجلد الذي قمت بانشائة في الخطوة السابقة قم بتشغيل برنامج Sublime Text 3 قم بانشاء ملف جديد File > New هذه الخطوة ضرورية بعد استخراج محتويات المجلد المضغوط للتحقق من عمل الصيغه والوظائف مع البرنامج بعد ذلك اذهب الى الاعلى في الخيارات واتبع الاتي view > syntax > LUA(MTA:SA) لتحديد الالوان الخاصة بالوظائف مثل الكلنت سايد والسيرفر سايد والمشتركة اتبع الآتي Preferences > Color Scheme > User > 50pMTAEditor > Monokai-MTA-Edit وهنا تكون انتهيت من تثبيت البرنامج والساينتكس الخاصة بلغة لوا ووظائف ام تي اي --------------------------------------------------------------------------------------- تنبية ** NOTE : قد يكون هناك مشكلة في مسار الملف التالي : C:\Users\\AppData\Roaming\Sublime Text 3\Packages\User\ لذلك عندما تذهب للمسار قد لايكون هناك المجلد User اذا لم تجد المجلد قم بانشاء مجلد جديد بالاسم User وقم بانشاء المجلد الذي في الخطوة رقم 3 داخل المجلد الجديد الذي انشئتة وهو User --------------------------------------------------------------------------------------- ماهي الفائدة من عمل هذه الطريقة؟ هذه الطريقة استعملها شخصياً في برمجة المودات وكتابة السكربتات والاكواد تسهل عملية كتابة الكود والوظائف تضع لك الوظائف بالارقمنت الخاص بها عند كتابة اول حرف ستظهر لك الوظائف بشكل مرتب وتدريجي في الايديتور اتمنى للجميع التوفيق واللي تحصل معه مشكلة يطرحها وبساعدة في تثبيت البرنامج واضافة 50p جميع حقوق الاضافة تعود لـ 50p والسلام عليكم ورحمة الله وبركاتة
  17. Hey, is there a function or something to remove the color code of me, and change RGB?
  18. function giveWeaponsOnSpawn0 ( ) giveWeapon ( source, 31, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 20 ) else outputChatBox("You do not have enough money.", source, 255, 0, 0, false) end addEvent( "giveweaponm4", true ) addEventHandler( "giveweaponm4", root, giveWeaponsOnSpawn0 ) what wrong in this?
  • Create New...