Jump to content

Jonas^

Members
  • Posts

    1,016
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by Jonas^

  1. Não se faça, você tentou alterar seu serial usando algum tipo de spoofer (modificador de vários dados do seu computador) provavelmente seu banimento nunca será retirado, afinal, tentar alterar serial é algo gravissimo e não é facil como você pensava, se você esta tentando apelar pra este tipo de tentativa é sinal que você fez algo de errado, por tanto aceite sua punição.

  2. Pra fazer isso você deve checar se o jogador esta com o modo imortal ativo ou não e se tiver você pode simplesmente cancelar o evento OnClientPlayerDamage

    Exemplo:

    client-side

    local state = false 
      
    addCommandHandler ("imortal", function () 
    	state = (not state) 
    	outputChatBox ("Status do modo imortal alterado para '"..(state and "Ativado" or "Desativado").."'.") 
    end) 
      
    addEventHandler ("onClientPlayerDamage", localPlayer, function (attacker, weapon, bodypart) 
    	if (state) then 
    		cancelEvent () 
    	end 
    end)

     

  3. Talvez seja melhor fazer desta forma:

    addCommandHandler ("staffs", function (player, cmd)
    	local admins = getOnlinePlayersFromGroup ("Admin")
    	local superMods = getOnlinePlayersFromGroup ("SuperModerator")
    	if admins == "" then
    		outputChatBox ("Nenhum administrador online no momento!", player, 255, 0, 0)
    	else
    		outputChatBox ("Admins: #FFFFFF"..tostring(admins), player, 255, 0, 0, true)
    	end
    	if superMods == "" then
    		outputChatBox ("Nenhum SuperModerador online no momento!", player, 255, 0, 0)
    	else
    		outputChatBox ("SuperModeradores: #FFFFFF"..tostring(superMods), player, 51, 170, 255, true)
    	end
    end)
    
    function getOnlinePlayersFromGroup (group)
    	local t = {}
    	local players = ""
    	for k, v in ipairs (getElementsByType("player")) do
    		local acc = getPlayerAccount(v)
    		if acc and not isGuestAccount(acc) then
    			local accName = getAccountName(acc)
    			if group and aclGetGroup(tostring(group)) then
    				local g = aclGetGroup(tostring(group))
    				local isAdmin = isObjectInACLGroup ("user."..accName, g)
    				if isAdmin then
    					if players ~= "" then 
    						players = players..", " 
    					end;
    					players = players..getPlayerName(v):gsub("#%x%x%x%x%x%x", "")
    				end
    			end
    		end
    	end
    	return players
    end

     

    • Confused 1
  4. Não é necessário usar isto:

    outputChatBox(" ", source) -- DÁ UM ESPAÇO EM BRANCO NO CHAT
    outputChatBox(" ", source) -- DÁ UM ESPAÇO EM BRANCO NO CHAT
    outputChatBox(" ", source) -- DÁ UM ESPAÇO EM BRANCO NO CHAT
    outputChatBox(" ", source) -- DÁ UM ESPAÇO EM BRANCO NO CHAT
    outputChatBox(" ", source) -- DÁ UM ESPAÇO EM BRANCO NO CHAT
    outputChatBox(" ", source) -- DÁ UM ESPAÇO EM BRANCO NO CHAT
    outputChatBox(" ", source) -- DÁ UM ESPAÇO EM BRANCO NO CHAT
    outputChatBox(" ", source) -- DÁ UM ESPAÇO EM BRANCO NO CHAT

    Para limpar o chat, basta usar:

    clearChatBox (source)

    Tem muita coisa errada nesse seu código, foi você mesmo que fez?

  5. On 12/04/2021 at 14:55, KronoS Lettify said:

    Isso não seria um evento, mas sim um script.

    Abaixo está um código que simularia o quê você precisa:
     

      Hide contents
    
    
    local alvos = {}
    
    addCommandHandler('memate', 
    	function (player, cmd)
    		if (isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(player)), aclGetGroup('Admin'))) then
    			if (not alvos[player]) then
    				alvos[player] = createBlipAttachedTo(player, 0, 4, 255, 0, 0, -1, 65535)
    				print('Mate o ADMIN e ganhe recompensas!')
    			else
    				print('Você já está marcado!')
    			end
    		end
    	end
    )
    
    addEventHandler('onPlayerWasted', root, 
    	function (_, killer)
    		if (alvos[source] and killer) then
    			destroyElement(alvos[source])
    			alvos[source] = nil
    			print('O ADMIN foi morto por *killer')
    			--DÊ A RECOMPENSA AQUI!
    		end
    	end
    )

     

     

    Não esqueça que você esta lidando com o lado servidor, por tanto muita atenção, prevejo problemas nesse seu código.

    @Perigoso

    Não se acostume:

    server-side

    local eventoAtivado = false -- Variável que vai informar se o evento esta ou não ativo (atualmente desativado).
    local saveAdmin -- Variável que vai guardar o admin que ativar o evento.
    
    function eventoStart (thePlayer, cmd)
    	if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (thePlayer)), aclGetGroup ("Admin")) then -- Se o player que usar o comando for admin, então:
    		if (eventoAtivado == false) then -- Se o evento não estiver ativado, então:
    			blipEvento = createBlipAttachedTo (thePlayer, 0, 2, 0, 0, 255) -- Seta o blip no admin visível para todos (pois estamos no server então não precisa declarar visibleTo)
    			saveAdmin = thePlayer -- Salva o playerSource na variável saveAdmin para poder cancelar o evento.
    			eventoAtivado = true -- Seta a variável como true (evento ativado).
    			setElementData (saveAdmin, "adminEventoStarted", true) -- Seta a data informando se o admin esta com evento ativo.
    			clearChatBox () -- Limpa o chat pra ser bem visível para todos.
    			outputChatBox ("[INFO] #FFFFFFO(A) admin '#00FF00"..string.gsub(getPlayerName (thePlayer), "#%x%x%x%x%x%x", "").."#FFFFFF' começou o evento mate o admin.", root, 0, 255, 0, true)
    			outputChatBox ("[INFO] #FFFFFFPara ver a localização do admin aperte a tecla #00FF00'F11' #FFFFFFo ponto azul representa a localização exata do admin.", root, 0, 255, 0, true)
    			outputChatBox ("[OBS] #FFFFFFLembrando que o admin tem a opção de revidar a agressão.", root, 255, 50, 50, true)
    		else -- senão:
    			outputChatBox ("[INFO] #FFFFFFO evento já esta ativo para cancelar use #FF3232/estop", thePlayer, 255, 50, 50, true)
    		end	
    	end	
    end
    addCommandHandler ("estart", eventoStart)
    
    function eventoStop (thePlayer, cmd)
    	if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (thePlayer)), aclGetGroup ("Admin")) then -- Se o player que usar o comando for admin, então:
    		if (eventoAtivado == true) then -- Se o evento já estiver ativado, então:
    			removeElementData (saveAdmin, "adminEventoStarted") -- Remove a data informando se o admin esta com evento ativo.
    			if isElement (blipEvento) then -- Se existir o elemento blipEvento, então: 
    				destroyElement (blipEvento) -- Retira o blip do admin.
    			end 
    			saveAdmin = nil -- Seta a variável como nil ficando inexistente.
    			eventoAtivado = false -- Seta a variável como false (evento desativado).
    			clearChatBox () -- Limpa o chat pra ser bem visível para todos.
    			outputChatBox ("[INFO] #FFFFFFO(A) admin '#FF3232"..string.gsub(getPlayerName (thePlayer), "#%x%x%x%x%x%x", "").."#FFFFFF' cancelou o evento.", root, 255, 50, 50, true)  
    		else
    			outputChatBox ("[INFO] #FFFFFFO evento já esta desativado para ativar use #FF3232/estart", thePlayer, 255, 50, 50, true)
    		end    
    	end    
    end
    addCommandHandler ("estop", eventoStop)
    
    addEventHandler ("onPlayerWasted", root, function (ammo, attacker, damageType)
    	if (attacker and attacker ~= source) and getElementData (source, "adminEventoStarted") then
    		local killer = getKiller (attacker) -- Variável que chama a função que verifica se elemento é um veículo/player.
    		if killer then -- Se o jogador matou o admin, então:
    			clearChatBox () -- Limpa o chat pra ser bem visível para todos.
    			outputChatBox ("[EVENTO] #FFFFFFO(A) jogador '#FF3232"..string.gsub(getPlayerName (killer), "#%x%x%x%x%x%x", "").."#FFFFFF' matou o admin '#FF3232"..string.gsub(getPlayerName (source), "#%x%x%x%x%x%x", "").."#FFFFFF' e ganhou o evento.", root, 255, 50, 50, true)
    			clearChatBox (killer) -- Limpa o chat somente pra quem matou o admin.
    			outputChatBox ("[EVENTO] #FFFFFFVocê matou o admin '#00FF00"..string.gsub(getPlayerName (source), "#%x%x%x%x%x%x", "").."#FFFFFF' e ganhou o evento.", killer, 0, 255, 0, true)
    			removeElementData (source, "adminEventoStarted") -- Remove a data informando se o admin esta com evento ativo.
    			if isElement (blipEvento) then -- Se o elemento blipEvento existir, então:
    				destroyElement (blipEvento) -- Retira o blip do jogador.				
    			end 
    			eventoAtivado = false -- Seta a variável como false (evento desativado).
    		end
    	end
    end)
    
    addEventHandler ("onPlayerQuit", root, function ()
    	if getElementData (source, "adminEventoStarted") then -- Se o admin estiver com o evento ativo, então:
    		clearChatBox () -- Limpa o chat pra ser bem visível para todos.
    		outputChatBox ("[INFO] #FFFFFFO(A) admin '#FF3232"..string.gsub(getPlayerName (source), "#%x%x%x%x%x%x", "").."#FFFFFF' saiu do servidor e o evento foi cancelado.", root, 255, 50, 50, true)
    		removeElementData (source, "adminEventoStarted") -- Remove a data informando se o admin esta com evento ativo.
    		if isElement (blipEvento) then -- Se o elemento blipEvento existir, então:
    			destroyElement (blipEvento) -- Retira o blip do jogador. 
    		end 
    		eventoAtivado = false -- Seta a variável como false (evento desativado).
    	end
    end)
    
    addEventHandler ("onResouceStop", root, function ()
    	if getElementData (source, "adminEventoStarted") then -- Se o admin estiver com o evento ativo, então:
    		removeElementData (source, "adminEventoStarted") -- Remove a data informando se o admin esta com evento ativo.
    	end
    end)
    
    function getKiller (v)
    	local player
    	if getElementType (v) == "vehicle" then -- Se o elemento for um veículo, então:
    		player = getVehicleController (v) -- Verifica o motorista do veículo.
    	elseif getElementType(v) == "player" then -- Se o elemento for um jogador, então:
    		player = v
    	end
    	return getElementType(player) == "player" and player or false -- Validar se é um jogador e retorna-lo.
    end

     

    • Thanks 1
  6. Você quer mostrar a hora e data exatamente do inicio do PTR e do final do PTR?

    Se sim, você deve usar: GetRealTime

    Um exemplo:

    function horaReal (thePlayer, cmd)
    	local now = getRealTime() -- Recebe os dados do momento atual.
    	local hours = now.hour
    	local minutes = now.minute
    	local days = now.monthday
    	local months = now.month
    	local years = now.year
    	if (hours < 10) then -- Adiciona um 0 na frente, caso seja menor que 10.
    		hours = "0"..hours
    	end
    	if (minutes < 10) then
    		minutes = "0"..minutes
    	end
    	if (days < 10) then
    		days = "0"..days
    	end
    	if (months < 10) then
    		months = "0"..months
    	end
    	outputChatBox ("Data: "..days.."/"..months + 1 .."/"..years + 1900, thePlayer, 0, 255, 0)
    	outputChatBox ("Hora: "..hours..":"..minutes, thePlayer, 0, 255, 0)
    	outputDebugString ("Data: "..days.."/"..months + 1 .."/"..years + 1900)
    	outputDebugString ("Hora: "..hours..":"..minutes)
    end
    addCommandHandler ("hora", horaReal)

     

×
×
  • Create New...