AlvareZ_ Posted January 30, 2013 Share Posted January 30, 2013 me cree un spawn pero al momento q spawneo no me crea el blip xq? :c Link to comment
Castillo Posted January 30, 2013 Share Posted January 30, 2013 Tenes un script para que haga eso? Link to comment
AlvareZ_ Posted January 30, 2013 Author Share Posted January 30, 2013 ps no, solo esta el spawn y al spawnear no los crea Link to comment
Castillo Posted January 31, 2013 Share Posted January 31, 2013 Los blips no son automaticos, los tenes que crear vos, el MTA trae un recurso llamado "playerblips", probalo. Link to comment
AlvareZ_ Posted January 31, 2013 Author Share Posted January 31, 2013 si pero me lo crea en verde Link to comment
Castillo Posted January 31, 2013 Share Posted January 31, 2013 Podrias editar el script y agregarle para que use el color del team. Link to comment
AlvareZ_ Posted January 31, 2013 Author Share Posted January 31, 2013 tengo esto pero me lo crea en verde igual local playerBlipRoot = createElement("playerBlipRoot", "playerBlipRoot") local function resourceStart() for _, player in ipairs(getElementsByType("player")) do if player ~= localPlayer then local r, g, b = getTeamColor(playerTeam) local blip = createBlipAttachedTo(playerTeam, 0, 2, r, g, b, 255, 1) setElementParent(blip, playerBlipRoot) end end end addEventHandler("onClientResourceStart", root, resourceStart) local function playerJoin() local r, g, b = getTeamColor(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) Link to comment
Castillo Posted January 31, 2013 Share Posted January 31, 2013 Sera porque "playerTeam" no esta definido en ninguna parte? y ademas en "playerJoin" usas "source" en lugar de un team? Link to comment
AlvareZ_ Posted February 1, 2013 Author Share Posted February 1, 2013 ahora tengo esto: local playerBlipRoot = createElement("playerBlipRoot", "playerBlipRoot") local playerTeam = getPlayerTeam ( source ) --This function creates blips for all players when the resource starts. local function resourceStart() for _, player in ipairs(getElementsByType("player")) do if ( playerTeam ) then local r, g, b = getTeamColor(playerTeam) local blip = createBlipAttachedTo(playerTeam, 0, 2, r, g, b, 255, 1) setElementParent(blip, playerBlipRoot) end 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(playerTeam) local blip = createBlipAttachedTo(playerTeam, 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) Link to comment
Recommended Posts