meh Posted April 12, 2012 Share Posted April 12, 2012 hi there. today i'm having some hard times with this reasource: https://community.multitheftauto.com/index.php?p= ... ls&id=3207 don't get me wrong, it works, and works nice, but the problem is that players's blips or icons or whatever don't disappear from the radar after a player dies. and this is kind of a bummer in my opinon. i've contacted the author of this script already, but he didn't respond, so i guess he's not really interested in improving his own resource. so, guys your my only hope. please help me out. here's the script's code itself: --[[***************************************************************************** * * PROJECT: PlayerBlips * LICENSE: GNU GPLv3 * FILE: :PlayerBlips/cPlayerBlips.lua * PURPOSE: Player blips. * DEVELOPERS: John_Michael <[email protected]> * ********************************************************************************]] local playerBlipRoot = createElement("playerBlipRoot", "playerBlipRoot") --This function creates blips for all players when the resource starts. local function resourceStart() for _, player in ipairs(getElementsByType("player")) do if player ~= localPlayer then local r, g, b = getPlayerNametagColor(player) local blip = createBlipAttachedTo(player, 0, 2, r, g, b, 255, 1) setElementParent(blip, playerBlipRoot) end end end addEventHandler("onClientResourceStart", root, resourceStart) --This function creates a blip for new players when they join. local function playerJoin() local r, g, b = getPlayerNametagColor(source) local blip = createBlipAttachedTo(source, 0, 2, r, g, b, 255, 1) setElementParent(blip, playerBlipRoot) setTimer(updateBlipColor, 5000, 1, blip) --Upadate in 5 seconds, in case the server sets the color. end addEventHandler("onClientPlayerJoin", root, playerJoin) --This function destroys a players blip when they quit. local function playerQuit() for _, blip in ipairs(getElementChildren(playerBlipRoot)) do if getElementAttachedTo(blip) == source then destroyElement(blip) end end end addEventHandler("onClientPlayerQuit", root, playerQuit) --This function updates a blip's color, ensuring the blip colors always match. function updateBlipColor(blip) local player = getElementAttachedTo(blip) if player then local r, g, b = getPlayerNametagColor(player) setBlipColor(blip, r, g, b, 255) end end Link to comment
Guest Guest4401 Posted April 12, 2012 Share Posted April 12, 2012 local function playerWasted() for _, blip in ipairs(getElementChildren(playerBlipRoot)) do if getElementAttachedTo(blip) == source then destroyElement(blip) end end end addEventHandler("onClientPlayerWasted", root, playerWasted) Link to comment
meh Posted April 12, 2012 Author Share Posted April 12, 2012 lol u saved my ass again. thank you one more time. i think i love you (not in a gay way) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now