Jump to content

Set Blip attached to Clan member


knightscript

Recommended Posts

Hello, im using Al3grab (https://community.multitheftauto.com/in ... ls&id=6911)

It doesn´t have a clan blip system, and I want to add id, so i have this code:

  
 function gps() 
 local group = getElementData(source,"Group") 
        if group == "N/A" then return end 
        local name = getPlayerName(source) 
        thePlayer = getPlayerFromName ( name ) 
            for k,v in ipairs ( getElementsByType("player") ) do 
                local g = getElementData(v,"Group") 
                if g == group then 
                    local myBlip = createBlipAttachedTo (thePlayer, 52) 
                     player_blips[source] = blip 
                    --setElementVisibleTo (myBlip, v, true ) 
                end 
            end 
        end 
 addEventHandler ("onPlayerLogin", getRootElement(),gps) 

And I want the blip to:

1.) Only be visible to clan members

2.) Disappear when player quits

I have tried many ways, but each time i get different erros, so I give up haha :roll: , Thanks.

Link to comment
function createGroupBlips() 
    for k, v in ipairs(getElementsByType("player")) do 
        if getElementData(v, "Group") == getElementData(localPlayer,"Group") then 
            GroupBlip = createBlipAttachedTo(v, 41) 
            setElementData(GroupBlip, "GroupBlips","True") 
        end 
    end 
end 
  

This in server side make function and dont forget identfier sides of this Function

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