Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. xXMADEXx

    Ban

    Just type /iban [serial] [days] [reason]
  2. xXMADEXx

    Help Image

    I'm sure there is another way, but the most simple way (that I could think of) would be to set an objects texture to the image and create the object behind the ped.
  3. xXMADEXx

    Ban

    I haven't tested it, but you can try to use this function: (I re-wrote it because I don't like fixing codes ) function banCommand ( plr, cmd, serial, days, ... ) if ( not serial or not days or not ... or not tonumber ( days ) ) then return outputChatBox ( "Syntax error. /"..tostring(cmd).." [serial] [days] [reason]", plr, 255, 0, 0 ) end local days = math.floor ( tonumber ( days ) ) if ( days <= 0 ) then return outputChatBox ( "Invalid number of days. Must be greater than 0", plr, 255, 0, 0 ) end local ip = nil local username = nil local reason = table.concat ( { ... }, " " ) local time = ( ( days * 24 ) * 60 ) * 60 -- I think the math is right -- handle the player kick for i, v in pairs ( getElementsByType ( "player" ) ) do if ( getPlayerSerial ( v ) == serial ) then ip = getPlayerIP ( v ) local acc = getPlayerAccount ( v ) if ( not isGuestAccount ( acc ) ) then username = getAccountName ( acc ) end kickPlayer ( v ) end end addBan ( ip, username, serial, plr, reason, time ) end addCommmandHandler ( "iban", banCommand )
  4. xXMADEXx

    Ban

    This code makes almost 0 since at all. An example, you have defined target to get the player serial of target (which is never defined in the first place) and then you wrote getPlayerSerial ( target ) and getPlayerName ( target ). This means, you're trying to get the serial and name of a serial?
  5. All you have to do is use guiCreateButton in onClientGUIClick
  6. As ccw said, if you do have a web server on the same host (such as a vps) you can use this script https://community.multitheftauto.com/index.php?p= ... ls&id=8249
  7. The loop in this wouldn't work. Try using this: local commands = { ['start'] = true, ['stop'] = true, ['refresh'] = true, ['banPlayer'] = true, ['delaccount'] = true } addEventHandler ( "onPlayerCommand", root, function ( cmd ) if ( commands [ cmd:lower() ] ) then cancelEvent ( ) outputChatBox ( "This command isn't allowed in the server.", source, 255, 0, 0 ) end end )
  8. You're defining time with Local. It should be local. If it still doesn't work please post your whole code, and the Execdb function along with any debug errors that are appearing. function addPlayerPunishments ( source ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then local accName = getAccountName ( account ) local serial = getPlayerSerial ( source ) local time = getRealTime ( ).timestamp local exe = exports.USCsql:Execdb ( "INSERT INTO punishlog ( account, serial, time ) VALUES ( ?, ?, ? )", tostring ( accName ), tostring ( serial ), tostring ( time ) ) return exe end return false end
  9. Are you trying to say, you want each player to only be able to create 4 objects?
  10. Change the getRootElement() in the chat box functions to the player element.
  11. Try using this, but I'm not sure if it'll work, I didn't test it. GUIEditor = { tab = {}, staticimage = {}, tabpanel = {}, button = {}, window = {} } function makeGui ( ) showCursor ( true ) GUIEditor.window[1] = guiCreateWindow(270, 100, 800, 600, "Ammunation", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.staticimage[1] = guiCreateStaticImage(130, 40, 500, 500, ":ammunation1/files/mira.png", false, GUIEditor.window[1]) GUIEditor.tabpanel[1] = guiCreateTabPanel(25, 20, 750, 565, false, GUIEditor.window[1]) guiSetAlpha(GUIEditor.tabpanel[1], 0.90) guiSetAlpha(GUIEditor.staticimage[1], 0.99) GUIEditor.tab[1] = guiCreateTab("Armas", GUIEditor.tabpanel[1]) GUIEditor.staticimage[15] = guiCreateStaticImage(50, 50, 100, 100, ":ammunation1/files/8.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[16] = guiCreateStaticImage(190, 380, 100, 100, ":ammunation1/files/2.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[17] = guiCreateStaticImage(330, 215, 100, 100, ":ammunation1/files/11.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[18] = guiCreateStaticImage(470, 50, 100, 100, ":ammunation1/files/5.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[19] = guiCreateStaticImage(610, 50, 100, 100, ":ammunation1/files/6.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[20] = guiCreateStaticImage(50, 215, 100, 100, ":ammunation1/files/9.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[21] = guiCreateStaticImage(50, 380, 100, 100, ":ammunation1/files/10.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[22] = guiCreateStaticImage(190, 50, 100, 100, ":ammunation1/files/4.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[24] = guiCreateStaticImage(190, 215, 100, 100, ":ammunation1/files/1.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[25] = guiCreateStaticImage(330, 50, 100, 100, ":ammunation1/files/12.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[26] = guiCreateStaticImage(330, 380, 100, 100, ":ammunation1/files/13.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[27] = guiCreateStaticImage(470, 215, 100, 100, ":ammunation1/files/7.png", false, GUIEditor.tab[1]) GUIEditor.staticimage[23] = guiCreateStaticImage(610, 215, 100, 100, ":ammunation1/files/3.png", false, GUIEditor.tab[1]) b1 = guiCreateButton(50, 155, 100, 50, "Pistol", false, GUIEditor.tab[1]) guiSetProperty(b1, "NormalTextColour", "FFFFFFFF") b2 = guiCreateButton(190, 155, 100, 50, "Shotgun", false, GUIEditor.tab[1]) guiSetProperty(b2, "NormalTextColour", "FFFFFFFF") b3 = guiCreateButton(330, 155, 100, 50, "Uzi", false, GUIEditor.tab[1]) guiSetProperty(b3, "NormalTextColour", "FFFFFFFF") b4 = guiCreateButton(470, 155, 100, 50, "M4", false, GUIEditor.tab[1]) guiSetProperty(b4, "NormalTextColour", "FFFFFFFF") b5 = guiCreateButton(610, 155, 100, 50, "Sniper Rifle", false, GUIEditor.tab[1]) guiSetProperty(b5, "NormalTextColour", "FFFFFFFF") b6 = guiCreateButton(50, 320, 100, 50, "Silenced Pistol", false, GUIEditor.tab[1]) guiSetProperty(b6, "NormalTextColour", "FFFFFFFF") b7 = guiCreateButton(190, 320, 100, 50, "SPAZ-12 Combat", false, GUIEditor.tab[1]) guiSetProperty(b7, "NormalTextColour", "FFFFFFFF") b8 = guiCreateButton(330, 320, 100, 50, "TEC-9", false, GUIEditor.tab[1]) guiSetProperty(b8, "NormalTextColour", "FFFFFFFF") b9 = guiCreateButton(470, 320, 100, 50, "AK-47", false, GUIEditor.tab[1]) guiSetProperty(b9, "NormalTextColour", "FFFFFFFF") b10 = guiCreateButton(610, 320, 100, 50, "Country Rifle", false, GUIEditor.tab[1]) guiSetProperty(b10, "NormalTextColour", "FFFFFFFF") b11 = guiCreateButton(50, 480, 100, 50, "Desert Eagle", false, GUIEditor.tab[1]) guiSetProperty(b11, "NormalTextColour", "FFFFFFFF") b12 = guiCreateButton(190, 480, 100, 50, "Sawn-Off", false, GUIEditor.tab[1]) guiSetProperty(b12, "NormalTextColour", "FFFFFFFF") b13 = guiCreateButton(330, 480, 100, 50, "MP5", false, GUIEditor.tab[1]) guiSetProperty(b13, "NormalTextColour", "FFFFFFFF") GUIEditor.button[15] = guiCreateButton(50, 15, 100, 35, "HandGuns", false, GUIEditor.tab[1]) guiSetProperty(GUIEditor.button[15], "NormalTextColour", "FFFFFFFF") GUIEditor.button[16] = guiCreateButton(190, 15, 100, 35, "ShotGuns", false, GUIEditor.tab[1]) guiSetProperty(GUIEditor.button[16], "NormalTextColour", "FFFFFFFF") GUIEditor.button[17] = guiCreateButton(330, 15, 100, 35, "Sub-Machine", false, GUIEditor.tab[1]) guiSetProperty(GUIEditor.button[17], "NormalTextColour", "FFFFFFFF") GUIEditor.button[18] = guiCreateButton(470, 15, 100, 35, "Assault Rifles", false, GUIEditor.tab[1]) guiSetProperty(GUIEditor.button[18], "NormalTextColour", "FFFFFFFF") GUIEditor.button[19] = guiCreateButton(610, 15, 100, 35, "Rifles", false, GUIEditor.tab[1]) guiSetProperty(GUIEditor.button[19], "NormalTextColour", "FFFFFFFF") GUIEditor.button[20] = guiCreateButton(630, 475, 100, 50, "Sair", false, GUIEditor.tab[1]) guiSetProperty(GUIEditor.button[20], "NormalTextColour", "FFFF0000") GUIEditor.tab[2] = guiCreateTab("Equipamentos", GUIEditor.tabpanel[1]) GUIEditor.staticimage[13] = guiCreateStaticImage(50, 50, 100, 100, ":ammunation1/files/colete.png", false, GUIEditor.tab[2]) GUIEditor.staticimage[14] = guiCreateStaticImage(190, 45, 110, 110, ":ammunation1/files/16.png", false, GUIEditor.tab[2]) GUIEditor.button[7] = guiCreateButton(50, 10, 100, 35, "Colete", false, GUIEditor.tab[2]) guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFFFFFFF") GUIEditor.button[8] = guiCreateButton(190, 10, 100, 35, "Paraquedas", false, GUIEditor.tab[2]) guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FFFFFFFF") GUIEditor.button[9] = guiCreateButton(50, 155, 100, 50, "Comprar", false, GUIEditor.tab[2]) guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FFFFFFFF") GUIEditor.button[10] = guiCreateButton(190, 155, 100, 50, "Comprar", false, GUIEditor.tab[2]) guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FFFFFFFF") GUIEditor.button[11] = guiCreateButton(630, 475, 100, 50, "Sair", false, GUIEditor.tab[2]) guiSetProperty(GUIEditor.button[11], "NormalTextColour", "FFFF0000") end addEventHandler("onClientRender", root, function() dxDrawRectangle(466, 207, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("", 488, 217, 488, 217, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) dxDrawRectangle(466, 207, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("", 488, 217, 488, 217, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) dxDrawRectangle(466, 207, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("", 488, 217, 488, 217, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) dxDrawRectangle(466, 207, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("", 488, 217, 488, 217, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) dxDrawRectangle(466, 207, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("", 488, 217, 488, 217, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) dxDrawRectangle(466, 207, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("", 488, 217, 488, 217, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b1 ) then triggerServerEvent("pistol",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b2 ) then triggerServerEvent("shotgun",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b3 ) then triggerServerEvent("uzi",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b4 ) then triggerServerEvent("m4",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b5 ) then triggerServerEvent("sniper",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b6 ) then triggerServerEvent("spistol",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b7 ) then triggerServerEvent("combat",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b8 ) then triggerServerEvent("tec",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b9 ) then triggerServerEvent("ak",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b10 ) then triggerServerEvent("country",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == b11 ) then triggerServerEvent("eagle",getLocalPlayer()) end end )
  12. For you, what is line 363, because it's not the same in this code. The error is basically saying the GUI element that you're trying to change the visibility of doesn't exist or hasn't been created yet. That's already defined here:
  13. Use the MTA XML functions.
  14. You're welcome, and I also uploaded 1.4.1 which has the bar resized.
  15. You could create a temporary vehicle, then use the function getVehicleHandling.
  16. Ah yes, that I ran the code I see what you mean. This is something really weird, I tried using a variable as an index in the Public array, and that works just fine. My thought would be maybe MTA removes functions so that you can't try to get server functions on the client side, or client functions on the server side. Weird. In the following code, it outputs everything for .var1 but nothing for .Test ._. addEvent("TestEvent"); CreateTest = function() local Public = {}; local Private = {}; Private.String = "Hello world!"; Public.Test = function() outputDebugString(Private.String); end Public.var1 = "Hello" HandleTest(Public); triggerEvent("TestEvent", root, Public ); return Public; end HandleTest = function(Public) Public.Test(); -- Works. end addEventHandler( "TestEvent", root, function(Public) for i, v in pairs ( Public ) do outputChatBox ( tostring ( i ) .. " -> "..tostring ( v ) .. " -> ".. type ( v ) ) end end ); Test = CreateTest(); Test.Test(); -- Works.
  17. xXMADEXx

    Internet Speed

    Mother of upload speed O___O
  18. http://lmgtfy.com/?q=Lua+syntax+for+phpbb
  19. This is just a thought, but I'm not really 100% sure. I think the reason it won't work is because when you're using the event, it's sending the Public class, but when you try to run Public.Test it's calling Private.String which would never be defined. Again, I'm not 100% sure on this.
  20. Define a variable to the old pos, and use a while loop. Inside the loop just keep generating a new pos until it's not the same as the old one.
  21. I assume that's what he is meaning Try using my community script: https://community.multitheftauto.com/index.php?p= ... ls&id=7979
×
×
  • Create New...