Jump to content

ice_brasil

Members
  • Posts

    127
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ice_brasil's Achievements

Poot-butt

Poot-butt (14/54)

0

Reputation

  1. I want my panel to selession skin, only open once per account, or just when registering, I already tried to use several codes, I could not, can do that part for me? Client: femaleSkins = {9, 31, 38, 190, 218} maleSkins = {0, 1, 21, 29, 19} --------**-------- -------//\\------- ------// \\------ -----// \\----- ----// \\---- ---// \\--- --// \\-- --\\ Settings //-- local defaultSex = "male" -- Set the default sex (Can be "male" or "female") -- Please note that any of the timers below are in milliseconds (ms) local skinCamTimer = 100 -- Timer to switch the camera to the selected skin (Change to a higher value if the camera doesn't switch to the Ped Selection Screen) local playerCamTimer = 100 -- Timer to switch the camera back to the player (Change to a higher value if the camera doesn't switch back to the player) local setSkinTimer = 50 -- Timer to override any skin change done by other scripts (Change to a higher value if the player's skin doesn't change) -- Scroll settings local autoScrollStart = 200 -- Set the time it takes in ms to enable auto scroll when holding down your arrow keys (cannot be lower than 50) local autoScrollSpeed = 80 -- Set the time it takes in ms to switch between skins when holding down your arrow keys (cannot be lower than 50) --// \\-- --\\ //-- ---\\ //--- ----\\ //---- -----\\ //----- ------\\ //------ -------\\//------- --------**-------- local sWidth,sHeight = guiGetScreenSize() local origWidth,origHeight = 1280,960 local isScreenVisible = false local skinRequested = false function text(text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, x/origWidth*sWidth+1.5, y/origHeight*sHeight+1.5, w/origWidth*sWidth+1.5, h/origHeight*sHeight+1.5, tocolor(0,0,0,255), scale/origWidth*sWidth, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, x/origWidth*sWidth, y/origHeight*sHeight, w/origWidth*sWidth, h/origHeight*sHeight, color, scale/origWidth*sWidth, font, alignX, alignY, clip, wordBreak, postGUI) end function image(x, y, w, h, image, rotation, rotationCenterOffsetX, rotationCenterOffsetY, color, postGUI) dxDrawImage(x/origWidth*sWidth, y/origHeight*sHeight, w/origWidth*sWidth, h/origHeight*sHeight, image, rotation, rotationCenterOffsetX, rotationCenterOffsetY, color, postGUI) end function mainScreen() dxDrawImage(0,0,sWidth,sHeight,"img/bg.png",0,0,0,tocolor(255,255,255,255),true) text("Skin: "..selectedSkin.."/"..totalSkins, 290, 198, 440, 249, tocolor(255, 255, 255, 255), 2.50, "default", "left", "top", false, false, true, false, false) text("Pressione [enter] para escolher sua skin.", 322, 837, 1042, 875, tocolor(255, 255, 255, 255), 2.00, "default", "center", "center", false, false, true, false, false) image(473, 419, 96, 140, "img/arrow.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) image(767.75, 419, 96, 140, "img/arrow.png", 180, 0, 0, tocolor(255, 255, 255, 255), true) image(72, 207, 130, 131, "img/male.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) image(55, 380, 130, 131, "img/female.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end function prevArrowBlink() image(473, 419, 96, 140, "img/arrow-blink.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end function nextArrowBlink() image(767.75, 419, 96, 140, "img/arrow-blink.png", 180, 0, 0, tocolor(255, 255, 255, 255), true) end function maleActivated() image(54, 187, 169, 174, "img/male-active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end function femaleActivated() image(45, 363, 155, 170, "img/female-active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end local prevButtonClickable = guiCreateStaticImage(0.36, 0.44, 0.08, 0.15, "img/transparent.png", true) local nextButtonClickable = guiCreateStaticImage(0.62, 0.44, 0.07, 0.15, "img/transparent.png", true) local maleButtonClickable = guiCreateStaticImage(0.06, 0.21, 0.10, 0.14, "img/transparent.png", true) local femaleButtonClickable = guiCreateStaticImage(0.06, 0.40, 0.07, 0.14, "img/transparent.png", true) function showClickables(isScreenVisible) guiSetVisible(prevButtonClickable,isScreenVisible) guiSetVisible(nextButtonClickable,isScreenVisible) guiSetVisible(maleButtonClickable,isScreenVisible) guiSetVisible(femaleButtonClickable,isScreenVisible) end showClickables(isScreenVisible) function toggleScreen() if isScreenVisible then closeScreen() else addEventHandler("onClientRender",root,mainScreen) if defaultSex == "male" then addEventHandler("onClientRender",root,maleActivated) elseif defaultSex == "female" then addEventHandler("onClientRender",root,femaleActivated) end isScreenVisible = true showClickables(isScreenVisible) showCursor(true) setTimer(function()showChat(false)end,200,1) setPlayerHudComponentVisible("all",false) bindKey("enter","down",changePlayerSkin) end end function closeScreen() skinRequested = false firstTime = false setTimer(function()setCameraTarget(localPlayer)end,playerCamTimer,1) triggerServerEvent("setElemDimen",localPlayer,localPlayer,0) removeEventHandler("onClientRender",root,mainScreen) removeEventHandler("onClientRender",root,femaleActivated) removeEventHandler("onClientRender",root,maleActivated) isScreenVisible = false showClickables(isScreenVisible) showCursor(false) setTimer(function()showChat(true)end,200,1) setPlayerHudComponentVisible("all",true) unbindKey("enter","down",changePlayerSkin) end function onSpawn(firstTime) if skinRequested == true or firstTime == true then toggleScreen() triggerServerEvent("setElemDimen",localPlayer,localPlayer,2) triggerServerEvent("setElemFrozen",localPlayer,localPlayer,true) setTimer(function()setCameraMatrix(955.8608, -1265.3856, 21.5138, 956.1688, -1265.3699, 21.5041)end,skinCamTimer,1) elseif firstTime == true then addEventHandler("onClientPlayerSpawn",localPlayer,onSpawn) end firstTime = false end addEvent("onRegister",true) addEventHandler("onRegister",root,onSpawn) function changePlayerSkin() toggleScreen() setPlayerTheirSkin() skinChosen = true triggerServerEvent("setElemFrozen",localPlayer,localPlayer,false) removeEventHandler("onClientPlayerSpawn",localPlayer,onSpawn) end function setChosenSkinOnSpawn() if skinChosen == true then setTimer(function()setPlayerTheirSkin()end,50,1) end end addEventHandler("onClientPlayerSpawn",localPlayer,setChosenSkinOnSpawn) local ped = createPed(0,960.05999755859, -1265.2800292969, 21.440000534058,90.0041198) setElementDimension(ped,2) local tune = playSFX3D("radio","Ambience",11,960.05999755859, -1265.2800292969, 21.440000534058,true) setSoundVolume(tune,1) setSoundMaxDistance(tune,50) setElementDimension(tune,2) function getSelectedSkinID() local ID = skinTable[selectedSkin] return ID end function setMenuPedSkin() local ID = getSelectedSkinID() setElementModel(ped,ID) end function changeSex(sex) if source == maleButtonClickable or sex == "male" then defaultSex = "male" setPedAnimation(ped,"DANCING","dnce_M_c",_,_,false,false,_) skinTable = maleSkins totalSkins = #skinTable selectedSkin = 1 setMenuPedSkin() if isScreenVisible then removeEventHandler("onClientRender",root,femaleActivated) addEventHandler("onClientRender",root,maleActivated) end elseif source == femaleButtonClickable or sex == "female" then defaultSex = "female" setPedAnimation(ped,"STRIP","STR_Loop_A",_,_,false,false,_) skinTable = femaleSkins totalSkins = #skinTable selectedSkin = 1 setMenuPedSkin() if isScreenVisible then removeEventHandler("onClientRender",root,maleActivated) addEventHandler("onClientRender",root,femaleActivated) end end end addEventHandler("onClientGUIClick",resourceRoot,changeSex) changeSex(defaultSex) function selectNextSkin() if selectedSkin == totalSkins then selectedSkin = 1 else selectedSkin = selectedSkin+1 end end function selectPrevSkin() if selectedSkin == 1 then selectedSkin = totalSkins else selectedSkin = selectedSkin-1 end end function setPlayerTheirSkin() local ID = getSelectedSkinID() setTimer(function()triggerServerEvent("changePlayerSkin",localPlayer,ID,selectedSkin)end,setSkinTimer,1) end -- Button prev < local renderprev = true function prevPedButton() if isScreenVisible then playSound("scroll.mp3") if renderprev == true then addEventHandler("onClientRender",root,prevArrowBlink) renderprev = false end setTimer(function()removeEventHandler("onClientRender",root,prevArrowBlink) renderprev = true end,50,1) selectPrevSkin() setMenuPedSkin() end end addEventHandler("onClientGUIClick",prevButtonClickable,prevPedButton,false) bindKey("arrow_l","down",prevPedButton) -- Button next > local rendernext = true function nextPedButton() if isScreenVisible then playSound("scroll.mp3") if rendernext == true then addEventHandler("onClientRender",root,nextArrowBlink) rendernext = false end setTimer(function()removeEventHandler("onClientRender",root,nextArrowBlink) rendernext = true end,50,1) selectNextSkin() setMenuPedSkin() end end addEventHandler("onClientGUIClick",nextButtonClickable,nextPedButton,false) bindKey("arrow_r","down",nextPedButton) -- Scroll functions function nextPed_scroll() timernext = setTimer( function() timernext2 = setTimer( function() nextPedButton() end ,autoScrollSpeed,0) end ,autoScrollStart,1) end bindKey("arrow_r","down",nextPed_scroll) function prevPed_scroll() timerprev = setTimer( function() timerprev2 = setTimer( function() prevPedButton() end ,autoScrollSpeed,0) end ,autoScrollStart,1) end bindKey("arrow_l","down",prevPed_scroll) function killAutoScroll_next() if isTimer(timerprev) then killTimer(timerprev) elseif isTimer(timerprev2) then killTimer(timerprev2) end end bindKey("arrow_l","up",killAutoScroll_next) function killAutoScroll_prev() if isTimer(timernext) then killTimer(timernext) elseif isTimer(timernext2) then killTimer(timernext2) end end bindKey("arrow_r","up",killAutoScroll_prev) ServeR:: function changePlayerSkin(ID,selectedSkin) setElementModel(source,ID) end addEvent("changePlayerSkin",true) addEventHandler("changePlayerSkin",root,changePlayerSkin) function setElemDimen(source,ID) setElementDimension(source,ID) end addEvent("setElemDimen",true) addEventHandler("setElemDimen",root,setElemDimen) function setElemFrozen(source,bool) setElementFrozen(source,bool) end addEvent("setElemFrozen",true) addEventHandler("setElemFrozen",root,setElemFrozen) firstTime = true function onSpawnFirstTime() triggerClientEvent(source,"onRegister",source,firstTime) end addEventHandler("onPlayerLogin",root,onSpawnFirstTime)
  2. I wonder if anti-cheat will work on any hack so I do not know. therefore possess no hack I want that when a player is with 200 life he is banned. function antiCheat ( theCheater ) if getElementHealth( theCheater ) >= 200 then banPlayer ( theCheater, "Cheater" ) end end addEventHandler("onPlayerSpawn",root, function () setTimer( antiCheat, 2500, 1, source ) end ) addEventHandler("onPlayerTarget",root, function () antiCheat( source ) end ) addCommandHandler( "clean", function ( ) for k, i in ipairs ( getElementsByType( "player" ) ) do antiCheat( i ) end end )
  3. I'm using globalchat for dayz. I want to put an anti-flood for the players not to be doing flood. I was able to make a more unique chat on mta. But for global chat I could not somebody help me? Client: --\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -- GlobalChat MTA:DayZ addon 1.1.1 -- Made by -ffs-Sniper -- You are free to edit this addon --/////////////////////////////////// --Define your desired chat key GlobalChatKey = "u" addEventHandler( "onClientResourceStart", getResourceRootElement ( ), function ( ) bindKey ( GlobalChatKey, "down", "chatbox", "globalchat" ) outputChatBox ( "Aperte " .. string.upper ( GlobalChatKey ) .. " para usar o chat global." , 255, 255, 255, true ) end ) Server: colorCodesDefault = { } colorCodesDefault.colorcode1 = "#AD505C" colorCodesDefault.colorcode3 = "#AD505C" colorCodesDefault.colorcode2 = "#DBD7D7" colorCodes = { } colorCodes.colorcode1 = get ( "colorcode1" ) or colorCodesDefault.colorcode1 colorCodes.colorcode2 = get ( "colorcode2" ) or colorCodesDefault.colorcode2 colorCodes.colorcode3 = get ( "colorcode3" ) or colorCodesDefault.colorcode3 --Check color code on start for i, v in pairs ( colorCodes ) do if not getColorFromString ( v ) then colorCodes[i] = colorCodesDefault[i] --if the admin fails to enter a valid hex color code outputChatBox ( "Bad " .. i .. " specified at GlobalChat addon (format: #FFFFFF)", root, 255, 0, 0, false) outputDebugString ( "Bad " .. i .. " specified at GlobalChat addon (format: #FFFFFF)", 2 ) end end outputLimit = 128 --character limit for chatbox outputs (do not change this) messagePrefix = get ( "prefix" ) or "[GLOBAL]" --prefix for the outputs onlyLatinCharacters = get ( "latinchars" ) == "true" and true or false timeBetweenMessages = tonumber ( get ( "messagedelay" ) ) or 1000 --time to wait between chat messages playerTickTable = { } --create a table with tick counts of the most recent chat message --The message output function playeGlobalChat ( playersource, cmd, ... ) if cmd == "globalchat" then --Check whether the player is muted first if isPlayerMuted ( playersource ) then outputChatBox ("Você foi mutado!", playersource, 255, 128, 22, true) return end local msg = table.concat ( {...} , " " ) --concat the arguments from table to a string seperated by spaces local msg = string.gsub ( msg, '#%x%x%x%x%x%x', '' ) --remove color-codes --Anti-spam checks local onlyLettersMsg = string.gsub ( msg , "%A", "" ) --extract letters only if onlyLettersMsg == string.upper ( onlyLettersMsg ) and #onlyLettersMsg > 6 then --check if there are more than 6 uppercase letters without any lowercase letters outputChatBox ( "Desligue o CAPS LOCK!", playersource, 255, 0, 0 ) return end if string.find ( msg, "http://" ) then --disallow links outputChatBox ( "Não faça spam no chat com links. Utilize uma mensagem privada ao invés!", playersource, 255, 0, 0 ) return end if onlyLatinCharacters then local noSpacesMsg = string.gsub ( msg, " ", "" ) local onlySpecCharMsg = string.gsub( noSpacesMsg, "[%a%d]", "") --extract special chars only if #onlySpecCharMsg > 10 then --check if there are more than 10 non-latin characters used (including russian, chinese, etc. characters) outputChatBox ( "Não faça spam no chat com caracteres especiais (linguagem)!", playersource, 255, 0, 0 ) return end end local var, spacesCount = string.gsub( msg, " ", "") --get the count of spaces if ( #msg / spacesCount ) > 20 and #msg > 20 then --check if there is at least one space per 20 or less characters outputChatBox ( "Não faça spam no chat com palavras longas!", playersource, 255, 0, 0 ) return end if playerTickTable[playersource] then --check if a table entry for the player exists local tick = getTickCount ( ) --get the current tick count in ms local timePassed = tick - playerTickTable[playersource] --calculate the time that passed between two messages if timePassed <= timeBetweenMessages then setPlayerMuted(victim, true) outputChatBox ( "Por favor, abster-se de bate-papo de spam!", playersource, 255, 0, 0 ) return end else playerTickTable[playersource] = getTickCount ( ) end --End of anti-spam checks --Chat logging outputServerLog ( messagePrefix .. getPlayerName ( playersource ) .. " : " .. msg ) local message = messagePrefix .. colorCodes.colorcode2 .. string.gsub ( ( getPlayerName ( playersource ) .. " : " ), '#%x%x%x%x%x%x', '' ) .. colorCodes.colorcode3 .. msg --precreate the message string local message = string.sub ( message, 1, outputLimit ) --since the chatbox won't display messages with more than 128 characters we just drop the ones at the end local r, g, b = getColorFromString ( colorCodes.colorcode1 ) outputChatBox ( message, root, r, g, b, true ) playerTickTable[playersource] = getTickCount ( ) end end addCommandHandler ( "globalchat", playeGlobalChat ) --Admin panel resource settings checks addEventHandler ( "onSettingChange", root, function ( setting, oldValue, newValue ) local setting = gettok ( setting, 2, string.byte ( "." ) ) if setting == "colorcode1" or setting == "colorcode2" or setting == "colorcode3" then if getColorFromString ( fromJSON( newValue ) ) then --if the admin fails to enter a valid hex color code colorCodes[setting] = fromJSON( newValue ) else colorCodes[setting] = colorCodesDefault[setting] outputChatBox ( "Bad " .. setting .. " specified at GlobalChat addon (format: #FFFFFF)", root, 255, 0, 0, false) outputDebugString ( "Bad " .. setting .. " specified at GlobalChat addon (format: #FFFFFF)", 2 ) end end if setting == "messagedelay" then --update message delay when changed if tonumber ( fromJSON( newValue ) ) then timeBetweenMessages = tonumber ( fromJSON( newValue ) ) or 1000 --maximum securtiy is usually best end end if setting == "prefix" then --update message prefix when changed if fromJSON( newValue ) then messagePrefix = fromJSON ( newValue ) or "[GLOBAL]" --maximum securtiy is usually best end end if setting == "latinchars" then --update onlyLatinCharacters setting when changed onlyLatinCharacters = fromJSON ( newValue ) == "true" and true or false end end ) addEventHandler ( "onPlayerQuit", root, function ( ) playerTickTable[source] = nil --remove a leaving player from our cached table end )
  4. I want a player only possar use the button "t" 5 in 5 seconds If he tries to use the button nothing happens, it would be for the player not being able to chat only every 5 seconds function () setTimer(function(player) bindKey(player, "t", "down", ) end,5000, 1,source) What did this wrong?
  5. I want to put reserved slots on my server, for when you are 60/60 the player can come with slots reserved. How do I make this happen?
  6. I want to put a more current gamemode on my server DayZ but do not want to lose the accounts or items of What do players need to save?
  7. That I do not know, the image is not being created within the label.
  8. I want to for when a player clicks a button an image is created within the "label" I tried to use it: function showClientImage() myImage = guiCreateStaticImage(212, 48, 783, 460, ":site/home.png", false, GUIEditor.label[1]) end addEventHandler('onClientGUIClick',GUIEditor.button[1],showClientImage, false)
  9. Yes I created a map and want to add items in it
  10. I made a map to my server DayZ want for items such as weapons, food and etc. ...most do not know that someone could teach me?
  11. I made a panel gui, I let him in the same position in all resolutions What do I need for this?
  12. Mr.Pres[T]ege you have skype? add my: icee_l pickture:reggae
  13. Giving this did not work for flooding buttons
  14. I want a single player can only use one button every 1 minute.I've done everything and nothing I've asked for some help scripters and it was not possible they do. I have 5 buttons I want a player can only use each button 1 in 1 minute. My buttons: GUIEditor.button[1] = guiCreateButton(164, 51, 96, 28, "Reparar Veículo", false, GUIEditor.gridlist[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFFFF") GUIEditor.button[2] = guiCreateButton(29, 89, 96, 29, "Armas-1", false, GUIEditor.gridlist[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFFFFFF") GUIEditor.button[3] = guiCreateButton(29, 127, 96, 29, "Armas-2", false, GUIEditor.gridlist[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFFFFFF") GUIEditor.button[4] = guiCreateButton(164, 89, 96, 29, "Armas-3", false, GUIEditor.gridlist[1]) guiSetFont(GUIEditor.button[4], "default-bold-small") guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFFFFFF") GUIEditor.button[5] = guiCreateButton(164, 127, 97, 28, "Armas-4", false, GUIEditor.gridlist[1]) guiSetFont(GUIEditor.button[5], "default-bold-small") guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFFFFFFF") GUIEditor.button[6] = guiCreateButton(30, 51, 95, 29, "Skin Colaborador", false, GUIEditor.gridlist[1]) guiSetFont(GUIEditor.button[6], "default-bold-small") guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFFFFFFF") Functions I use the buttons: addEventHandler('onClientGUIClick',GUIEditor.button[2],arma,false) addEventHandler('onClientGUIClick',GUIEditor.button[3],arma2,false) addEventHandler('onClientGUIClick',GUIEditor.button[4],arma3,false) addEventHandler('onClientGUIClick',GUIEditor.button[5],arma4,false) addEventHandler('onClientGUIClick',GUIEditor.button[6],skin,false) addEventHandler('onClientGUIClick',GUIEditor.button[1],fix,false) Functions for each click: function arma ( ) triggerServerEvent('LoadServer',localPlayer) guiSetVisible (GUIEditor.window[1], false) showCursor (false) outputChatBox("Você pegou o kit de armas-1!") end function arma2 ( ) triggerServerEvent('LoadServer2',localPlayer) guiSetVisible (GUIEditor.window[1], false) showCursor (false) outputChatBox("Você pegou o kit de armas-2!") end function arma3 ( ) triggerServerEvent('LoadServer3',localPlayer) guiSetVisible (GUIEditor.window[1], false) showCursor (false) outputChatBox("Você pegou o kit de armas-3!") end function arma4 ( ) triggerServerEvent('LoadServer4',localPlayer) guiSetVisible (GUIEditor.window[1], false) showCursor (false) outputChatBox("Você pegou o kit de armas-4!") end function skin ( ) triggerServerEvent('LoadServer5',localPlayer) guiSetVisible (GUIEditor.window[1], false) showCursor (false) outputChatBox("Agora você esta usando a skin de colaborador!") end function fix ( ) if ( isPedInVehicle ( localPlayer ) ) then local theVehicle = getPedOccupiedVehicle ( localPlayer) local succes = fixVehicle ( theVehicle ) if ( succes ) then outputChatBox (" Veículo reparado. " ) else outputChatBox ( "Falha ao reparar seu veículo.") end else outputChatBox ( "Você precisa estar em um veículo!" ) end end What do I have to add that this is possible?
×
×
  • Create New...