Jump to content

[RESOLVED]Command to Show/Hide certain blips


ManeXi

Recommended Posts

I tried to add a command to show/hide blips, didn't work cuz i'm noob, help me please

function showBaseBlips () 
createBlip ( 1972.5458984375, -1113.5166015625, 25.628751754761, 59,2,0,0,0, 255,0, 99999) 
end 
addCommandHandler(baseblips, showBaseBlips, false, true) 

if anyone could tell me the way to fix it.

Edited by Guest
Link to comment
function baseblip(player) 
local bliper = getElementData(player,"bliper") or 0 
if bliper == true then 
blip = createBlip ( 1972.5458984375, -1113.5166015625, 25.628751754761, 59,2,0,0,0, 255,0, 99999) 
outputChatBox ("blip added!", player,0,0,255) 
setElementData(player,"bliper",false) 
else 
if not getElementData(player,"bliper") == true then 
destroyElement(blip) 
outputChatBox ("blip removed!", player,0,0,255) 
setElementData(player,"bliper",true) 
end 
end 
end 
addCommandHandler("baseblips",baseblip) 

it get hide/show in the same command

should work :)

Link to comment

Why are u using element data while u can do this cuz blip is global defined

function baseblip(player) 
       if (not blip) then 
            blip = createBlip ( 1972.5458984375, -1113.5166015625, 25.628751754761, 59,2,0,0,0, 255,0, 99999) 
       else 
             destroyElement(blip) 
       end 
addCommandHandler("baseblips",baseblip) 

that's simple -_-

Link to comment
Why are u using element data while u can do this cuz blip is global defined
function baseblip(player) 
       if (not blip) then 
            blip = createBlip ( 1972.5458984375, -1113.5166015625, 25.628751754761, 59,2,0,0,0, 255,0, 99999) 
       else 
             destroyElement(blip) 
       end 
addCommandHandler("baseblips",baseblip) 

that's simple -_-

what ever

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...