Jump to content

Ghost Mode


xJ4ckk

Recommended Posts

function GhostMode(player)
local account = getPlayerAccount(player) 
if (not account or isGuestAccount(account)) then return end 
local accountName = getAccountName(account) 
if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Moderator" ) ) or isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) then
if getElementAlpha(player) == 255 then
setElementAlpha(player,0)
setPlayerNametagShowing(player,false)
setPedWeaponSlot(player,0)
outputChatBox("#ffffff[GHOSTMODE] #379bffYou have enabled the Ghost Mode.",player,255,255,255,true)
else
setElementAlpha(player,255)
setPlayerNametagShowing(player,true)
outputChatBox("#ffffff[GHOSTMODE] #379bffYou have disabled the Ghost Mode.",player,255,255,255,true)
    end
  end
end
addCommandHandler("ghostmode",GhostMode)

Can please someone help me to hide the blip when a player enable the Ghost Mode, and show the blip again when the player disable the Ghost Mode.

Please guys need your help!

Link to comment
  • 11 months later...
4 minutes ago, alonemta said:

Destroy element( player blips) is not working I tested pls help how to fix this ? 

@khadeer143 @AEB help how to fix this 

post your final code. Maybe it´s not working because you created a new function to the blip

 

Edited by <~KaMiKaZe~>
Link to comment
function GhostMode(player)
local account = getPlayerAccount(player) 
if (not account or isGuestAccount(account)) then return end 
local accountName = getAccountName(account) 
if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Moderator" ) ) or isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) then
if getElementAlpha(player) == 255 then
setElementAlpha(player,0)
setPlayerNametagShowing(player,false)
setPedWeaponSlot(player,0)
outputChatBox("#ffffff[GHOSTMODE] #379bffYou have enabled the Ghost Mode.",player,255,255,255,true)
else
setElementAlpha(player,255)
setPlayerNametagShowing(player,true)
outputChatBox("#ffffff[GHOSTMODE] #379bffYou have disabled the Ghost Mode.",player,255,255,255,true)
    end
  end
end
addCommandHandler("g",GhostMode)




function (player) 
for index, element in ipairs ( getAttachedElements ( player ) ) do 
if ( getElementType (element) == "blip" ) then 
destroyElement (element) 
        end 
    end 
end 
addCommandHandler("ghostmode",GhostMode)

Oops, i forget the name of function  :-D

Edited by <~KaMiKaZe~>
  • Thanks 1
Link to comment
-- SERVER --

local ghostmode = false

addCommandHandler("ghostmode",
function(player)
  if hasObjectPermissionTo(player,"general.adminpanel") == false then
    outputChatBox("You don't have permission to use this command.",player,255,0,0)
    return end
  for index,players in ipairs(getElementsByType("player")) do
    if ghostmode == false then
      ghostmode = true
      setElementVisibleTo(player,players,false)
      setElementAlpha(player,230)
      setPlayerNametagShowing(player,false)
      outputChatBox("Ghost Mode: #00FF00enabled",player,255,255,255,true)
    else
      ghostmode = false
      setElementVisibleTo(player,players,true)
      setElementAlpha(player,255)
      setPlayerNametagShowing(player,true)
      outputChatBox("Ghost Mode: #FF0000disabled",player,255,255,255,true)
    end
  end
end
)

 

Edited by ÆBKV
  • Like 1
Link to comment
On 1/21/2018 at 19:10, alonemta said:

Thanks all I need one more help

i want a script which is count players travel time from marker to marker. start time and end time. the time is stored somewhere and the best time (the shortest) is callable

I ask for a lot of help on this forum, but that's because I make the scripts and find a load of bugs/errors, unfortunately, I am an idiot, so I post code I HAVE MADE, so that I can get help on how to fix certain problems I have struggled with for about a week or so.

Go to YouTube and look up scripting tutorials.

And please, make a new topic.....  Press that "Start new topic" text and not the reply button, this isn't even your topic and you're asking for help on it...  Go download scripts from community, mess around with them, start small and build up your skills, then when you actually know a little about coding, come back and ask for help :)

 

THIS FORUM IS TO HELP PEOPLE WITH SCRIPTS,

WE ARE NOT A CHARITY

 

Edited by kieran
  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...