Jump to content

Help!


WiBox

Recommended Posts

function rPBFTM(player)
    if ( isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then
        for _,players in ipairs(getElementsByType("player")) do
            if ( getElementDimension (players) == 336 ) then
                for _,blip in ipairs (getElementsByType("blip")) do 
                    icon = getBlipIcon(blip)
                    if ( icon == 0 ) then
                        if ( getBlipVisibleDistance (blip) ~= 0) then
                            outputChatBox("3", player, 255, 0, 255)
                            setBlipVisibleDistance(blip, 0.1) 
                        else
                            if (getBlipVisibleDistance(blip) == 0.1) then
                                outputChatBox("4", player, 255, 255, 255)
                                setBlipVisibleDistance(blip, 500)
                            end
                        end
                    end
                end
            end
        end
    end
end
addCommandHandler("empb", rPBFTM)

addEventHandler("onPlayerWasted", getRootElement(),
 function ()
     for _,blip in ipairs (getElementsByType("blip")) do 
         for _,players in ipairs(getElementsByType("player")) do
             if ( getElementDimension (players) == 336 ) then
                 icon = getBlipIcon(blip)
                 if ( icon == 0 ) then
                     if ( getBlipVisibleDistance(blip) == 0 ) then
                         setBlipVisibleDistance(blip, 500)
                     end
                 end
             end
         end             
     end
 end )
  
addCommandHandler("emp", 
function (player)
    blip = getElementsByType("blip")
    d = getBlipVisibleDistance(blip)
    icon = getBlipIcon(blip)
    if ( icon == 0 ) then
        outputChatBox("visible distance is "..d,player, 255, 0, 255)
    end
end)

Hello, I need help in this script.. I wanted to remove players blip from the mini-map but it's not working.. Well not all of it, when I use ( /empb ) it remove the blip from the mini-map but when I reuse ( /empb ) it doesn't back the blip, I used ( /debugscript 3 ) but it just gaved me that " disableBlip.lua:57 bad argument #1 to ipairs (table expected, got boolean) ".. now for the "onPlayerWasted" working without any problems, but about (/emp) it didn't send a message, if someone can tell me what I did wrong, I'm using type="server" on meta.xml, and thanks.

Link to comment
  • Moderators
1 minute ago, SSKE said:

I'm still a beginner at scripting, so if there a way you can at least fix or give me a way to make that script, I really would appreciate that.

Maybe I can, but: "Where did you create the player's blip?"

Link to comment
  • Moderators
2 minutes ago, SSKE said:

I didn't create it, it's already created on the mini-map, that blip ID 0, I want to remove it from mini-map and back it with same command that's all

Ohh, so.. Some resource is created blips. (example: play resource create player's blip.)

And if I type the /empb command, all blips hide only for me or if I type the /empb command all blips hide for everyone?

Edited by Patrick2562
Link to comment
  • Moderators
3 minutes ago, SSKE said:

I'm making it for events, the events dimension is 336, that why I want so the blips only disappear at the dimension 336

Ohh. I see.

Do you use RADAR resource?

Edited by Patrick2562
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...