Jump to content

SpecT

Members
  • Posts

    656
  • Joined

  • Days Won

    9

Everything posted by SpecT

  1. I just found a kinda useless resource in the community. On its picture there is a text "ADMIN PLEASE UN BAN ME GLOBAL BAN". Also this guy posted a topic in the resources forum where he sells modified multigamemode which was made by Sigmar. He just edited its interface and now he sells it ... lel. Hope you will take a look on it. Here is the url of the resource I meantioned: https://community.multitheftauto.com/in ... s&id=11635 DONE
  2. Lel guys ... It would be better if the MTA Dev team make a new event for example onPlayerPaste which will be triggered when the client presses ctrl + v and get the client's clipboard. I don't want to get their clipboard without their permission. I just wanted to make DX editbox and make it possible to paste stuff in it (example: urls).
  3. You used "for id,player in ipairs(getElementsByType("player")) do" which means it will set the car color/lights to everyone. When you trigger the event from client-side put localPlayer, and add it in the server side. So it will change just the client's car color/lights but not everyone's.
  4. Insert in the client side: showChat(true) or write in your Console: showchat
  5. I don't think that if someone have it he will give it to you. This section (Scripting) is to help the people who have problems with their code or if they have any questions related to scripting, but not to make or give resources.
  6. try to use my code I found my mistake ... Thanks again guys, especially Walid for the spent time.
  7. I tried something similar but I get errors "table expected, got userdata". And when I check for the type of the table that was sent from the server it says it's userdata.
  8. Pfff I can't now insert all the data in the gridlist ... I have never worked with the GUI and now .. Could you just show me how to insert the values from the table in the gridlist and columns ?
  9. Ow ... that's exactly what I needed! Thanks mate ;3 If I have any problems I will write again here so I won't mark it as solved.
  10. Yeah, but that won't help me. I don't want just to get the accounts... Please read what I wrote. I will get all the accounts but how to make it show the data I mentioned above on the same row?
  11. Hello guys! So I'm working on an account management panel. I have made the interface with GUI - window,gridlist,buttons. The problem is that that I don't get it how I should make the table of accounts which has to have exp, cash and IP address. It is a big window with a gridlist - 4x columns - account name, exp, cash, ip address. I should collect the data (accounts, exp, cash and ip address) into a table and send it to the client but I have no idea how to make that ... So could you guys help me? Here is what I have done: CLIENT accountMng = { accountList = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() accountMng.window[1] = guiCreateWindow(0.22, 0.20, 0.55, 0.62, "Account Management", true) guiWindowSetMovable(accountMng.window[1], false) guiWindowSetSizable(accountMng.window[1], false) guiSetAlpha(accountMng.window[1], 1.00) accountMng.accountList[1] = guiCreateGridList(44, 45, 961, 515, false, accountMng.window[1]) guiGridListAddColumn(accountMng.accountList[1], "Account name", 0.3) guiGridListAddColumn(accountMng.accountList[1], "EXP", 0.2) guiGridListAddColumn(accountMng.accountList[1], "Cash", 0.2) guiGridListAddColumn(accountMng.accountList[1], "IP", 0.2) accountMng.button[2] = guiCreateButton(443, 591, 169, 43, "Delete account", false, accountMng.window[1]) guiSetProperty(accountMng.button[2], "NormalTextColour", "FFAAAAAA") accountMng.button[3] = guiCreateButton(942, 623, 103, 35, "Close", false, accountMng.window[1]) guiSetProperty(accountMng.button[2], "NormalTextColour", "FFAAAAAA") showCursor(true) end )
  12. SpecT

    help dxdraw

    You're welcome!
  13. SpecT

    help dxdraw

    local isOpened = false function drawInterface() dxDrawRectangle(289, 214, 471, 295, tocolor(255, 0, 0, 132), false) dxDrawRectangle(342, 265, 132, 42, tocolor(72, 1, 253, 168), false) dxDrawRectangle(556, 265, 132, 42, tocolor(72, 1, 253, 168), false) dxDrawRectangle(556, 380, 132, 42, tocolor(72, 1, 253, 168), false) dxDrawRectangle(342, 380, 132, 42, tocolor(72, 1, 253, 168), false) dxDrawRectangle(462, 465, 104, 34, tocolor(6, 215, 247, 168), false) dxDrawText("Close", 461, 464, 566, 499, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Health And Armour", 343, 263, 474, 307, tocolor(255, 255, 255, 255), 1.20, "default", "center", "center", false, false, false, false, false) dxDrawText("GodMod", 557, 263, 688, 307, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Player Visible", 557, 378, 688, 422, tocolor(255, 255, 255, 255), 1.40, "default", "center", "center", false, false, false, false, false) dxDrawText("Vehucle GodMod", 343, 378, 474, 422, tocolor(255, 255, 255, 255), 1.20, "default", "center", "center", false, false, false, false, false) end function toggleInterface() if isOpened then removeEventHandler("onClientRender",getRootElement(),drawInterface) isOpened = false else addEventHandler("onClientRender",getRootElement(),drawInterface) isOpened = true end end bindKey("f3","down",toggleInterface) And don't forget to use relative position if you want it to fit in any resolution - sx,sy = guiGetScreenSize()
  14. SpecT

    Not oppening

    Wtf dude I haven't made anything
  15. SpecT

    Not oppening

    Any errors in debugscript 3 ? If yes then post them here. If there are no erros post your meta.xml
  16. Yes you can try to use sth like this: local Commands = { ["login"] = true, -- login command } local SerialAccess = { [""] = true, -- maybe you can add your serial here only you will be able to use it } function noAccessCommands(command) if (Commands[command]) then local serial = getPlayerSerial(source) if (not SerialAccess[serial]) then cancelEvent() outputChatBox("You can't use this Command ("..command..")", source, 255, 0, 0) return end end end addEventHandler("onPlayerCommand", root, noAccessCommands) Finally I got time to test it. It works perfectly! Thanks dude!
  17. Lel, why don't you use the getPlayerFromNamePart function ? function doAction(thePlayer, cmd, actionId, playername) if actionId then local actionId = tonumber(actionId) --forgot this line local player = getPlayerFromNamePart(playername) if hasObjectPermissionTo(thePlayer, "function.setPlayerMuted", false) then if actionId == 1 then local duration = (1000 * 1800) setPlayerMuted(player, true) outputChatBox(getPlayerName(player).." #FF0000has been muted by #FFFFFF"..name.."#FF0000.#FFFFFF [RULE #1:Only English in Main Chat(mute)] #FF0000Length #FFFFFF[30 mins].", root, 255, 255, 255, true) local timer = setTimer ( unmute, duration, 1, player ) elseif actionId == 2 then local duration = (1000 * 1800) setPlayerMuted(player, true) outputChatBox(getPlayerName(player).." #FF0000has been muted by #FFFFFF"..name.."#FF0000.#FFFFFF [RULE #2:No insulting people (mute)] #FF0000Length #FFFFFF[30 mins].", root, 255, 255, 255, true) local timer = setTimer ( unmute, duration, 1, player ) elseif actionId == 3 then local duration = (1000 * 1800) setPlayerMuted(player, true) outputChatBox(getPlayerName(player).." #FF0000has been muted by #FFFFFF"..name.."#FF0000.#FFFFFF [RULE #3:No annoying people (mute)] #FF0000Length #FFFFFF[30 mins].", root, 255, 255, 255, true) local timer = setTimer ( unmute, duration, 1, player ) elseif actionId == 4 then local duration = (1000 * 1800) setPlayerMuted(player, true) outputChatBox(getPlayerName(player).." #FF0000has been muted by #FFFFFF"..name.."#FF0000.#FFFFFF [RULE #4:No advertising other servers (mute)] #FF0000Length #FFFFFF[30 mins].", root, 255, 255, 255, true) local timer = setTimer ( unmute, duration, 1, player ) elseif actionId == 5 then local duration = (1000 * 1800) setPlayerMuted(player, true) outputChatBox(getPlayerName(player).." #FF0000has been muted by #FFFFFF"..name.."#FF0000.#FFFFFF [RULE #5:No spamming (mute)] #FF0000Length #FFFFFF[30 mins].", root, 255, 255, 255, true) local timer = setTimer ( unmute, duration, 1, player ) elseif actionId == 6 then local duration = (1000 * 1800) setPlayerMuted(player, true) outputChatBox(getPlayerName(player).." #FF0000has been muted by #FFFFFF"..name.."#FF0000.#FFFFFF [RULE #6:No asking for staff (mute)] #FF0000Length #FFFFFF[30 mins]", root, 255, 255, 255, true) local timer = setTimer ( unmute, duration, 1, player ) elseif actionId == 7 then local reason = "[RULE #7:No killing/annoying working or busy staff (kick)]" outputChatBox(getPlayerName(player).." #FF0000has been kicked by #FFFFFF"..name.."#FF0000.#FFFFFF [RULE #7:No killing/annoying working or busy staff (kick)]", root, 255, 255, 255, true) kickPlayer(player, thePlayer, reason) elseif actionId == 8 then local duration = (24 * 3600) local reason = "[RULE #8:No impersonating (ban)]" outputChatBox(getPlayerName(player).." #FF0000has been banned by #FFFFFF"..name.."#FF0000.#FFFFFF [RULE #8:No impersonating (ban)]", root, 255, 255, 255, true) banPlayer(player, true, true, true, thePlayer, reason, duration) elseif actionId == 9 then local duration = (24 * 3600) local reason = "[RULE #9:No hacking/abusing the bugs (ban)]" outputChatBox(getPlayerName(player).." #FF0000has been banned by #FFFFFF"..name.."#FF0000.#FFFFFF [RULE #9:No hacking/abusing the bugs (ban)]", root, 255, 255, 255, true) banPlayer(player, true, true, true, thePlayer, reason, duration) end end end end addCommandHandler ("action",doAction) function unmutePlayer(player,command,victimName) if victimName then local victim = getPlayerFromNamePart(victimName or "") if victim then if ( isPlayerMuted(victim) ) then setPlayerMuted(victim, false) end end end end addCommandHandler("unmute",unmutePlayer) function onJoin () local serial = getPlayerSerial(source) local muted = serialMute [ serial ] if ( type ( muted ) == "table" ) then if ( muted [ 1 ] ) then setPlayerMuted ( source, true ) local timer = setTimer ( unMute, muted [ 1 ], 1, source ) serialMute [ serial ] [ 2 ] = timer return end end setPlayerMuted ( source, false ) end addEventHandler ( "onPlayerJoin", getRootElement(), onJoin ) addEventHandler ( "onPlayerQuit", root, function ( ) local serial = getPlayerSerial ( source ) local muted = serialMute [ serial ] if ( type ( muted ) == "table" ) then if isTimer ( muted [ 2 ] ) then local timeLeft = getTimerDetails ( muted [ 2 ] ) killTimer ( muted [ 2 ] ) serialMute [ serial ] [ 1 ] = timeLeft end end end ) function unmute ( thePlayer ) if isElement ( thePlayer ) then setPlayerMuted ( thePlayer, false ) serialMute [ getPlayerSerial ( thePlayer ) ] = nil outputChatBox ( "You have been unmuted.", thePlayer, 0, 100, 0 ) end end function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end This should work.
  18. I made something similar to Walid's code month ago for the "aexec" command and it worked. function banCommand(command) if command == "aexec" then if not getPlayerSerial(source) == "HIDDEN" then cancelEvent() end end if command =="login" then if not getPlayerSerial(source) == "HIDDEN" then cancelEvent() end end if command =="register" then if not getPlayerSerial(source) == "HIDDEN" then cancelEvent() end end end addEventHandler("onPlayerCommand",getRootElement(),banCommand) Or maybe i should use "elseif" .. lel I gotta try that later, because now I dont have time
  19. Hmm, yeah but it doesn't cancel the event even when the cmd is register (from the admin panel).
  20. Hello! Is it possible and if yes how can I block the login command. I remember that the register command is in the Admin panel, but is it possible to block the /login ? I tried to cancel the event onPlayerCommand when the command is login but didn't work. Thanks!
  21. SpecT

    Text stuff

    Thanks dude! It worked like a charm
  22. SpecT

    Text stuff

    Hello folks! Could you guys tell me how to show a too long text with "..." ? Here is an example: "Asd asd asd asd asd asd long text asd" to "Asd asd asd asd ..." Thanks in advance!
  23. Sorry for the Off-topic but ... If it's a simple script then what's the problem to let the others see how the problem was solved ? You don't deserve to get helped anymore!
  24. Use the X and Y in the first 4 arguments to set the position of the elements. Example: x*0.3, y*0.5, x*0,6, y*0.5
  25. lol it's outputChatBox not ouputChatBox function gowmo() local team = getPlayerTeam(source) local r,g, b = getTeamColor(team) local hex = RGBToHex (r, g, b) outputChatBox("dead"..hex..""..getPlayerName(source), 255, 255, 255, true) end addEventHandler("onClientPlayerWasted",getLocalPlayer(), gowmo) Lol, didn't see that
×
×
  • Create New...