Narutimmy Posted July 11, 2013 Share 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 Link to comment
Alexs Posted July 11, 2013 Share Posted July 11, 2013 No defines 'player' en la función 'playerJoin', intenta usar 'source'. Link to comment
Narutimmy Posted July 11, 2013 Author Share Posted July 11, 2013 No defines 'player' en la función 'playerJoin', intenta usar 'source'. Listo pero aun sale :I Link to comment
Alexs Posted July 11, 2013 Share Posted July 11, 2013 Podría ser causado por jugadores sin 'Team'. Link to comment
Narutimmy Posted July 11, 2013 Author Share Posted July 11, 2013 Podría ser causado por jugadores sin 'Team'. Ohh, cierto.. gracias Link to comment
Narutimmy Posted July 12, 2013 Author Share Posted July 12, 2013 Ahora me tira este error Link to comment
Alexs Posted July 12, 2013 Share 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. Link to comment
Narutimmy Posted July 12, 2013 Author Share 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 Link to comment
Recommended Posts