Jump to content

Atton

Members
  • Posts

    211
  • Joined

  • Last visited

Everything posted by Atton

  1. Sometimes it doesn't even fit in the chatbox. Well in that case you can always output it in a GUI memo rather than a text file. There's always a slightly better solution. I was thinking about making a gui for it but to be honest it was not really worth it.I might make one later on however maybe some time in the next few days. --[[ This script was made by Atton in 2014. [MTA COMMUNITY] Users are free to modify this script as long as it is for personal use only. No assurances and or warranties will be provided use at your own risk. Please do not distribute this code in a modified form without giving credit. ]]-- local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 591, 401 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 troot = guiCreateWindow(left, top, windowWidth, windowHeight, "Tea GUI", false) guiWindowSetSizable(troot, false) guiSetVisible(troot, false) codeE = guiCreateMemo(440, 75, 131, 31, "[Your Code Here]", false, troot) guiSetVisible(troot, false) encodeB = guiCreateButton(440, 165, 111, 41, "Encode", false, troot) decodeB = guiCreateButton(440, 215, 111, 41, "Decode", false, troot) wbB = guiCreateButton(440, 265, 111, 41, "Clear All Boxes", false, troot) closeB = guiCreateButton(440, 315, 111, 41, "Close", false, troot) outputl = guiCreateLabel(20, 185, 91, 31, "Output", false, troot) guiLabelSetHorizontalAlign(outputl, "left", false) guiLabelSetVerticalAlign(outputl, "center") guiSetVisible(troot, false) inputF = guiCreateLabel(20, 15, 91, 31, "Input", false, troot) guiLabelSetHorizontalAlign(inputF, "left", false) guiLabelSetVerticalAlign(inputF, "center") guiSetVisible(troot, false) Codel = guiCreateLabel(440, 45, 91, 21, "Code", false, troot) guiLabelSetHorizontalAlign(Codel, "left", false) guiLabelSetVerticalAlign(Codel, "center") inputBox = guiCreateMemo(20, 45, 361, 131, "", false, troot) outputBox = guiCreateMemo(20, 215, 361, 131, "", false, troot) guiSetVisible(troot, false) function enCodef () local Key = guiGetText(codeE) local cdata = guiGetText(inputBox) local Code = teaEncode(tostring(cdata),tostring(Key)) guiSetText(outputBox,tostring(Code)) end addEventHandler("onClientGUIClick",encodeB ,enCodef) function deCodef () local Key = guiGetText(codeE) local cdata = guiGetText(inputBox) local Code = teaDecode(tostring(cdata),tostring(Key)) guiSetText(outputBox,tostring(Code)) end addEventHandler("onClientGUIClick",decodeB ,deCodef) function dtf () guiSetText(outputBox,"") guiSetText(inputBox,"") guiSetText(codeE,"") end addEventHandler("onClientGUIClick",wbB ,dtf) function closef() guiSetVisible(troot, false) showCursor(false) end addEventHandler("onClientGUIClick",closeB ,closef) function Aguif() if (guiGetVisible(troot)) then guiSetVisible(troot, false) showCursor(false) else guiSetVisible(troot, true) showCursor(true) end end addCommandHandler("tea", Aguif) I might upload it to the mta community later.
  2. Play with run code and try things like outputChatBox. For exmaple srun outputChatBox("Tuna")
  3. The code uses 2 text files outPut.txt and inPut.txt you will need to make them. Put say your name into the inPut then do enCode or /enCode then it will be stored in the outPut. It might be a good idea to change the code at [Key =] it might be helpful. Key = 5453487089 function decCode () local outPut = fileOpen("outPut.txt") local inPut = fileOpen("inPut.txt") local size1 = fileGetSize(outPut) local size2 = fileGetSize(inPut) local data = fileRead(inPut,size2) local Code = teaDecode(tostring(data),tostring(Key)) fileWrite(outPut,tostring(Code)) fileClose(outPut) fileClose(inPut) end addCommandHandler("deCode",decCode) function enCode () local outPut = fileOpen("outPut.txt") local inPut = fileOpen("inPut.txt") local size1 = fileGetSize(outPut) local size2 = fileGetSize(inPut) local data = fileRead(inPut,size2) local Code = teaEncode(tostring(data),tostring(Key)) fileWrite(outPut,tostring(Code)) fileClose(outPut) fileClose(inPut) end addCommandHandler("enCode",enCode) --Try to decode this --You will need to use the default code for this. VvYrt0ECvfYzNfmAsYF2CTBdE/gOqrOTKYjGrbL44PZMyEt6OwPbmLT+2+ilqDagnKOMmm0rANkgHzRKiEoJf2v+C4YsUqK/ https://wiki.multitheftauto.com/wiki/TeaEncode https://wiki.multitheftauto.com/wiki/TeaDecode
  4. Atton

    .xml markers

    I have been playing around with .xml files to try to inject positions to make markers. I have not had a lot of luck and I am wondering if someone has a working example of this. I have a cluster of code that I have been playing with, to get this to work but I have not had a lot of luck.
  5. Atton

    PNS

    Had to make some changes but it works thanks.
  6. Atton

    PNS

    I was working on a bit of code for a pay and spray there seems to be having some issues. I keep getting bad arguments on these. local vehicle = getPedOccupiedVehicle(thePlayer) local money = getPlayerMoney(thePlayer) --pasMarkersT [Table removed to keep things easy] function Markers () for a,b in pairs(pasMarkersT) do PAS = createMarker(b["x"], b["y"], b["z"]-1,"cylinder",5) createBlip(b["x"], b["y"], b["z"]-1,63) addEventHandler("onMarkerHit",PAS,Logic) end end setTimer(Markers,50,1) price = 100 function Logic (hitElement, matchingDimension,thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) local money = getPlayerMoney(thePlayer) local elementType = getElementType(hitElement) if (elementType == "vehicle") then if (money >= price) then if getElementHealth(vehicle) < 1000 then takePlayerMoney(player, price) fixVehicle(vehicle) outputChatBox("Thank you for using pay and spray have a nice day.",plr,0,255,0) else outputChatBox("Get Lost!",player,255,0,0) end end end end
  7. Atton

    Lol csg turned gay

    The server got aids.
  8. http://csgmta.net/ The title says it all.
  9. Awesome stuff plz add sticky wheels.
  10. Unless you pay for all of the hosting and give donations from the community to the dev then it is not going to happen.
  11. So far nothing from the devs.
  12. Atton

    Radio Player

    Tried it but it causes tons of errors and the script wont even load I am pretty sure the code above is missing ends and stuff Made some edits seems to work but got to fix some stuff.
  13. Atton

    Radio Player

    There are issues with it stopping and starting and not working with links.
  14. That might be helpful to you. function allvehiclesaredoomed() vehicles = getElementsByType("vehicle") for i,v in ipairs(vehicles) do destroyElement(v) end end setTimer(allvehiclesaredoomed, 3600000, 0) or function DMGf (plr) local DM = getPedOccupiedVehicle(plr) if (isPedInVehicle(plr)) then if (not DM) then return end if isVehicleDamageProof(DM) == false then setVehicleDamageProof(DM,true) outputChatBox("Damage proof on.",plr) else setVehicleDamageProof(DM,false) outputChatBox("Damage proof off.",plr) end end end addCommandHandler("Cargodmode",DMGf)
  15. Atton

    Radio Player

    I tried to use a bit of code that I found to try to make a link based audio player , It seems not to work that well. addEventHandler("onClientResourceStart", getRootElement(getThisResource()), function () local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 552, 476 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 Agui = guiCreateWindow(left, top, windowWidth, windowHeight, "Fuck Around Panel v1.0", false) guiWindowSetSizable(Agui, false) guiSetVisible(Agui, false) playb = guiCreateButton(420, 315, 101, 51, "Play/Stop", false, Agui) stopb = guiCreateButton(420, 375, 101, 51, "Stop", false, Agui) TBDEV = guiCreateEdit(10, 335, 113, 21, "URL", false, Agui) guiEditSetMaxLength(TBDEV, 32767) --The Code of the player. if guiGetText(TBDEV) then addEventHandler("onClientGUIClick", playb, function() if sound ~= nil then stopSound(sound) end sound = playSound(""..guiGetText(TBDEV).."") end) addEventHandler("onClientGUIClick", stopb, function() if sound ~= nil then stopSound(sound) end end) end end )
  16. From what I know about code lua is needed for mysql to work in mta so learn lua.
  17. Atton

    Murder Command

    Thanks I will try to study the code to get an idea of how I can apply get and set element data thanks for your help.
  18. Atton

    Murder Command

    I have been trying to use get and set element data for this murder command. Can anyone help. setElementData ( player, "Mode.murder", true ) function rapef (player,command,tpName,source) local tp = getPlayerFromName(tpName) if getElementData( player, "Mode.murder" ) then setElementData ( player, "Mode.murder", false ) killPed(tp) setTimer(YCRN,40000,1) outputChatBox("You murdered: ".. tostring(tp)) else outputChatBox("Hold up there mate",player) end end addCommandHandler("murder",murderf) --if tp then function YCRN () setElementData ( player, "Mode.murder", true ) end
×
×
  • Create New...