Jump to content

Help me with this please wont load


Dentos

Recommended Posts

So i been trying load this resource for player blip but as much as try it wont load here it is

playerblips.lua

local pBlips = { } 
  
addEventHandler("onResourceStart", resourceRoot, 
    function() 
        for index, player in ipairs(getElementsByType("player")) do 
            addTeamBlip(player) 
        end 
    end 
) 
  
function addTeamBlip(player) 
    if ( pBlips[player] ) then return false end -- Adding a prevention of duplicate blips 
    local pAccount = getPlayerAccount(player) 
    local theGang = ( pAccount and isGuestAccount(pAccount) and false ) or exports["gang_system"]:getAccountGang(pAccount) 
    if ( theGang ) then 
        local r, g, b = getPlayerNametagColor( player ) 
        local theBlip = createBlipAttachedTo( player, 0, 2, r, g, b ) 
        -- Change visibility to only the team members 
        setElementVisibleTo( theBlip, root, false ) 
        for index, value in ipairs ( exports["gang_system"]:getGangMembers(theGang) ) do 
            setElementVisibleTo( theBlip, value, true ) 
        end 
        pBlips[player] = theBlip 
    end 
end 
  
function destroyBlip(element) 
    local theElement = source or element 
    if ( theElement ) then 
        destroyElement(pBlips[theElement]) 
        pBlips[theElement] = nil -- Just in-case... 
    end 
end 
  
-- Events 
addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) -- onPlayerSpawn will now add a teamBlip 
addEventHandler ( "onPlayerQuit", root, destroyBlip ) 
addEventHandler ( "onPlayerWasted", root, destroyBlip )] 

meta.xml

  

Ive tried doing refresh on console and everything but server wont load it please help other resources load just fine

Link to comment
  
local pBlips = { } 
  
addEventHandler("onResourceStart", resourceRoot, 
    function() 
        for index, player in ipairs(getElementsByType("player")) do 
            addTeamBlip(player) 
        end 
    end 
) 
  
function addTeamBlip(player) 
    if ( pBlips[player] ) then return false end -- Adding a prevention of duplicate blips 
    local pAccount = getPlayerAccount(player) 
    local theGang = ( pAccount and isGuestAccount(pAccount) == false ) or exports["gang_system"]:getAccountGang(pAccount) 
    if ( theGang ) then 
        local r, g, b = getPlayerNametagColor( player ) 
        local theBlip = createBlipAttachedTo( player, 0, 2, r, g, b ) 
        -- Change visibility to only the team members 
        setElementVisibleTo( theBlip, root, false ) 
        for index, value in ipairs ( exports["gang_system"]:getGangMembers(theGang) ) do 
            setElementVisibleTo( theBlip, value, true ) 
        end 
        pBlips[player] = theBlip 
    end 
end 
  
function destroyBlip(element) 
    local theElement = source or element 
    if ( theElement ) then 
        destroyElement(pBlips[theElement]) 
        pBlips[theElement] = nil -- Just in-case... 
    end 
end 
  
-- Events 
addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) -- onPlayerSpawn will now add a teamBlip 
addEventHandler ( "onPlayerQuit", root, destroyBlip ) 
addEventHandler ( "onPlayerWasted", root, destroyBlip ) 
  

@Dakilla: Read his script properly and see the last line. An ] and one more thing he did at line 14

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