Jump to content

Nice_x #Scripting;

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Nice_x #Scripting;

  1. Alguem poderia me dar um exemplo, de como eu poderia fazer um timer que iniciaria por minutos exemplo: /timer 1 -- Iniciaria um tempo de 1 minuto e não /timer 60000 Alguem pode me dizer como posso fazer essa conversão?
  2. Só mudar as coordenadas, testa ai.. local time = getRealTime() local dia = time.monthday local mes = time.month local ano = time.year local formattedTime = string.format("%04d-%02d-%02d %02d:%02d:%02d", dia, mes + 1, ano) dxDrawText (formattedTime, x, y , x, y , tocolor(255, 255, 255, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false)
  3. Na própria wiki tem o código, só você usar do jeito que quiser. function showtime () local time = getRealTime() local hours = time.hour local minutes = time.minute local seconds = time.second local monthday = time.monthday local month = time.month local year = time.year local formattedTime = string.format("%04d-%02d-%02d %02d:%02d:%02d", year, month + 1, monthday, hours, minutes, seconds) outputChatBox ( "Local Time: ".. formattedTime ) end addCommandHandler("showtime", showtime)
  4. Aperta P, clica em você dps vai em Stats e seta tudo para 1000.
  5. Bugou meu cérebro, primeiro coloque os end's na função, use /debugscript 3 para localizar erros.
  6. Tente isso: não testei. function onSetTime() for _, v in pairs(getElementsByType("player")) do if ( getElementData(rRoot,""..getPlayerSerial(v).."-j") or ( getElementData(v, "preso") ) ) then local starlevel = getPlayerWantedLevel (v) if starlevel >= 1 then setPlayerWantedLevel(v, tonumber(starlevel)-1) end if starlevel == 0 then Liberar(v) end end end end setTimer(onSetTime, 30000, 0)
  7. Use isto, altere o nome da função ali em baixo ;D addEventHandler ("onClientClick", root, funcao)
  8. Teste desse jeito, substitua o seu por esse, ainda não testado, mas me fala ai se deu certo function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function algemar_jogador ( thePlayer, _, id ) if(id) then local playerID = tonumber(id) if(playerID) then local Player2 = getPlayerID(playerID) local cx,cy,cz = getElementPosition(Player2) local x,y,z = getElementPosition(thePlayer) local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz) if(Player2) then if dist <= 5 then local accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user."..accountname, aclGetGroup("PM")) and dist <= 5 then setElementData(Player2,"algemado", Player2) setPedAnimation( Player2, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) setElementFrozen( Player2, true ) toggleControl(Player2, "fire", false) outputChatBox("#000000[#4286f4PSP#000000]#ffffff #ff0000"..getPlayerName(Player2).."#ffffff foi algemado pelo #4286f4Agente "..getPlayerName(thePlayer).."", root, 255, 255, 255, true) outputChatBox("#000000[#4286f4PSP#000000]#ffffff Tu foste #ff0000algemado#ffffff! ", Player2, 255, 255, 255, true) else outputChatBox("#000000[#4286f4PSP#000000]#ffffff Tu #ff0000não tens permissão#ffffff para usar este comando!", thePlayer, 255, 255, 255, true) end else outputChatBox("#000000[#4286f4PSP#000000]#ffffff Chega #ff0000mais perto#ffffff do jogador para usar o comando!", thePlayer, 255, 255, 255, true) end end end end end addCommandHandler("algemar", algemar_jogador)
  9. Vai precisar do resource bone_attach function roubarbank (thePlayer) local x, y, z = getElementPosition (thePlayer) setPedAnimation (thePlayer, "ROB_BANK", "CAT_Safe_Rob", -1, true, false, false) local sacomoney = createObject (1550, x, y, z) setTimer (function (thePlayer) setPedAnimation (thePlayer, nil) exports.bone_attach:attachElementToBone (sacomoney, thePlayer, 4, -0.3, 0.2, 0, -125, 0, 0) end, 1000, 1, thePlayer) end addCommandHandler ("roubar", roubarbank)
  10. Eu fiz isso mas ficou assim para mim: http://prntscr.com/n8tzgc E pro meu amigo ficou assim: http://prntscr.com/n8u280 O que eu faço? ;-;
  11. Olá, tenho uma dúvida, como faz para um painel dx não bugar em todas resoluções exemplo Na resolução 1280x768 fica certinho o painel mas na 1366x768 fica tudo torto e etc..
  12. Eu configuro tudo certinho o anti flood e mesmo assim da erro, eu envio a mensagem, não aparece a mensagem mas aparece a mensagem do anti flood dizendo "Você tem que esperar 5 segundos para digitar novamente!" Você pode ver nessa imagem: http://prntscr.com/n8k9vw Meu código é esse: ComandoDoChatGlobal = "twitter" local timerTempo = {} local timerChamar = 5000 function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if timerTempo[thePlayer] and timerTempo[thePlayer] + timerChamar > getTickCount() then outputChatBox ( "Aguarde 5 segundos para digitar novamente!", thePlayer, 255, 0, 0) return else timerTempo[thePlayer] = getTickCount() end local ID = getElementData(player, "ID") or "N/A" if getElementData (thePlayer, "Staff") then outputChatBox("#00BFFF[#00BFFFTwitter#00BFFF] #26539d*Staff -#ffffff "..getPlayerName(thePlayer).."["..ID.."]#ffffff:#ffffff "..message, player, 255, 255, 255, true) elseif not getElementData (thePlayer, "Staff") then outputChatBox("#00BFFF[#00BFFFTwitter#00BFFF]#ffffff "..getPlayerName(thePlayer).."["..ID.."]#ffffff:#ffffff "..message, player, 255, 255, 255, true) end end end end end addCommandHandler ( ComandoDoChatGlobal, adminchat )
×
×
  • Create New...