Narutimmy Posted July 11, 2013 Posted July 11, 2013 Hola tengo este Error en el debug --[[***************************************************************************** * * PROJECT: PlayerBlips * LICENSE: GNU GPLv3 * FILE: :PlayerBlips/cPlayerBlips.lua * PURPOSE: Player blips. * DEVELOPERS: John_Michael * ********************************************************************************]] 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 = getTeamColor(getPlayerTeam(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 = getTeamColor(getPlayerTeam(player)) local blip = createBlipAttachedTo(player, 0, 2, r, g, b, 255, 1) setElementParent(blip, playerBlipRoot) setTimer(updateBlipColor, 1000, 0, 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) == source if player then local r, g, b = getTeamColor(getPlayerTeam(player)) setBlipColor(blip, r, g, b, 255) end end
Alexs Posted July 11, 2013 Posted July 11, 2013 No defines 'player' en la función 'playerJoin', intenta usar 'source'.
Narutimmy Posted July 11, 2013 Author Posted July 11, 2013 No defines 'player' en la función 'playerJoin', intenta usar 'source'. Listo pero aun sale :I
Narutimmy Posted July 11, 2013 Author Posted July 11, 2013 Podría ser causado por jugadores sin 'Team'. Ohh, cierto.. gracias
Alexs Posted July 12, 2013 Posted July 12, 2013 Revisa tu linea 47: local player = getElementAttachedTo(blip) == source Eso convierte a 'player' en un 'boolean', elimina la comparación y prueba.
Narutimmy Posted July 12, 2013 Author Posted July 12, 2013 Revisa tu linea 47: local player = getElementAttachedTo(blip) == source Eso convierte a 'player' en un 'boolean', elimina la comparación y prueba. Listo gracias
Recommended Posts