Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 25/04/21 in all areas

  1. It would be pretty easy to take the keywords from that list, put them in a table and re-implement a "random nickname generator" in Lua.. There is how you can do it, @III
    1 point
  2. Você pode usar triggers para passar informações dos clientes para o servidor e vice-versa. https://wiki.multitheftauto.com/wiki/TriggerServerEvent https://wiki.multitheftauto.com/wiki/TriggerClientEvent
    1 point
  3. That's the spirit! Thank you. We've still got a strong community and the project is going well.
    1 point
  4. Thank you very much! Also thanks for the topic with tutorial. It works already. I have to learn it!
    1 point
  5. Okay, so you have 2 fields in the json. ok and result function newResult(getupdates) if getupdates then outputConsole("Start of iteration") local jsonUpdates = fromJSON(getupdates) local ok = jsonUpdates["ok"] -- is 'ok' true? if ok then -- yes it was successful, so loop trough results local result = jsonUpdates["result"] -- you can print out tables to debug console to check content, with: iprint(result) for i, v in ipairs(result) do outputConsole(i..": update_id: "..v["update_id"].." | message_id: "..v["message"]["message_id"]) end end outputConsole("End of iteration") outputConsole(getupdates) else outputDebugString("ERROR!", 3) end end fetchRemote(link, newResult) Here you can read about tables: https://forum.multitheftauto.com/topic/130181-lua-tables-as-sets-instead-of-arrays/
    1 point
  6. How the string looks like? paste it here
    1 point
  7. Hi. You have to convert JSON to Lua array with fromJSON. (probably callRemote do it automatically)
    1 point
  8. I'll make sure to drop by sometimes, it's been so long since I last RPed in MTA. Godspeed!
    1 point
  9. ---------------------- -- Setting ---------------------- local Admin = { {"King Time","15"}, {"Police","25"}, {"Moderator","35"}, {"SuperModrator","50"}, {"Admin 1","65"}, {"Admin.General","80"}, {"Admin.Lord","100"}, {"Specicl.Admin","130"}, {"Admin.senior","160"}, {"Big.Boss","180"}, {"Admin Crown","200"}, {"King Of The Server","240"}, {"Special.Admin","270"}, {"Head.Admin","300"}, {"Assistant.Console","350"}, {"Guided.server","400"}, {"Mentor.console","450"}, {"Micro.server","470"}, {"agent.server","500"}, {"general.manger","530"}, {"Director.Admin","600"}, {"Director.Controllir","750"}, {"Watcher.Officials","800"}, {"Microcontroller.official","900"}, {"general.Microcontroller","980"}, {"Best.Officials","1100"}, {"Lord.Officials","1250"}, {"King.Officials","1450"}, {"Team.M6.1","1650"}, {"Team.M6.2","1670"}, {"Veteran.director","1800"}, {"Splendid.admin","1950"}, {"Heroic.admin","2000"}, } ---------------------- -- Setting ---------------------- FontGrid = guiCreateFont( "Fonts/Font2.ttf", 11 ) FontLabel = guiCreateFont( "Fonts/Font2.ttf", 13 ) FontButton = guiCreateFont( "Fonts/Font2.ttf", 13 ) GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(547, 92, 418, 648, "[M.6]Rank-System[M.6]", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF08F640") guiSetVisible(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(106, 549, 214, 59, "Buy Rank", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.label[1] = guiCreateLabel(42, 29, 331, 28, "≈[M.6]≈[ مطانيخ العرب ]≈[Ksa]≈[ سعودي هجولة ]≈[M.6]≈", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.label[2] = guiCreateLabel(130, 618, 185, 30, "Programmed-By-Mo5darat", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") GUIEditor.gridlist[1] = guiCreateGridList(9, 51, 399, 488, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Group", 0.5) guiGridListAddColumn(GUIEditor.gridlist[1], "Hours", 0.5) guiSetFont(GUIEditor.gridlist[1], FontGrid ) guiSetFont(GUIEditor.label[1], FontLabel ) guiSetFont(GUIEditor.button[1], FontButton ) for k,v in ipairs ( Admin ) do row = guiGridListAddRow(GUIEditor.gridlist[1]); guiGridListSetItemText(GUIEditor.gridlist[1],row,1,v[1],false,false); guiGridListSetItemText(GUIEditor.gridlist[1],row,2,v[2],false,false); guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,math.random(0,255),math.random(0,255),math.random(0,255)) guiGridListSetItemColor(GUIEditor.gridlist[1],row,2,math.random(0,255),math.random(0,255),math.random(0,255)) end xMainFunctions_ = function ( ) local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) local Group = tostring ( guiGridListGetItemText(GUIEditor.gridlist[1],row,1 )); local Price = tostring ( guiGridListGetItemText(GUIEditor.gridlist[1],row,2 )); if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("Accept:the:request",localPlayer,Group,Price); else outputChatBox("Please Click On The Rank",math.random(0,255),math.random(0,255),math.random(0,255),true); end end addEventHandler("onClientGUIClick",GUIEditor.button[1],xMainFunctions_,false) local againStartMove = 10 local endMove = 300 addEventHandler("onClientRender",root,function() if ( guiGetVisible(GUIEditor.label[1]) == true ) then local x,y = guiGetPosition(GUIEditor.label[1],false) guiSetPosition(GUIEditor.label[1],x + 1,y,false) if ( x >= endMove ) then guiSetPosition(GUIEditor.label[1],againStartMove,y,false) end end end) addEventHandler ( "onClientResourceStart", root, function ( ) if ( isTimer ( timerColor ) ) then killTimer ( timerColor ) end timerColor = setTimer ( function ( ) guiLabelSetColor ( GUIEditor.label[1], math.random ( 255 ), math.random ( 255 ), math.random ( 255 ) ) end, 100, 0 ) end ) addEventHandler("onClientResourceStart", resourceRoot, function() setTimer(function() for _, random in ipairs(getElementsByType('gui-button',getResourceRootElement(getThisResource())) ) do guiSetProperty(random, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255))) end end, 100, 0) end) bindKey("F10", "down", function() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1], false) showCursor(false) guiSetInputEnabled(false) else if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(false) guiSetInputEnabled(true) end end end) end) لو تشوف الدي بق حق اللعبة بيكتب لك شي زي كذا تقريبا بالأحمر بمعنى إن السطر الأخير ناقصه قوس ضفنا قوس وجاء خطأ أخر إن فيه اند ناقصة وكذا
    1 point
  10. Ohh.. yeah, probably. Then he asked in wrong place. Here they are: https://github.com/multitheftauto/mtasa-blue/blob/a0410c68945b6b3d9225c8c90af2bb6b1cda5eaa/Client/core/CNickGen.cpp
    1 point
  11. Hey, I think he meant the random nicknames MTA generates when you first join the mod and haven't set a nickname yet. If I am right I don't think you can get a list of those (not 100% sure tho).
    1 point
  12. Hi. You can enable it with setPlayerNametagShowing.
    1 point
×
×
  • Create New...