Jump to content

createBlipAttachedTo not working for me


Guest Pengo

Recommended Posts

Hi, I tried to create a simple blip attached to a player but it doesn't work.

  
function spawn() 
    if (spawnPlayer(source, 0, 0, 5)) then 
        fadeCamera(source, true) 
        createBlipAttachedTo(source, 0, 2, 255, 0, 0, 255) 
        createBlip(0, 0, 0, 0, 2, 0, 255, 0, 255) 
    end 
end 
  
addEventHandler("onPlayerJoin", getRootElement(), spawn) 
  

The static green blip is showing but the "attached" red blip isn't. How come? I use the same values for both blips (icon = 0, size = 2). Both server- and clientside creation of attached blips in this form doesn't work for me.

Link to comment

I know. I just wanted to see if the static blip wasn't showing either but it is. The "attached" blip doesn't show at all when I use icon = 0. And when I use icon = 1 with the exact same setting (size = 2, r = 255, g = 0, b = 0) all I get is a big attached white blip instead of a attached size 2 red blip.

Link to comment

Try this (ServerSide)

function spawn ( source ) 
    local s = spawnPlayer ( source, 0, 0, 5 ) 
    if ( s ) then 
    createBlipAttachedTo( source, 0, 2, 255, 0, 0, 255 ) 
    fadeCamera( source,true )     
    end 
end 
   
addEventHandler("onPlayerJoin", getRootElement(), spawn) 

Link to comment

But now I have another question. How can I destroy blips? Somehow the blips remain visible when a player leaves. Even when I make the blips nil they won't disappear and destroyElement keeps telling me blip is a bad argument. I could make them invisible to any root child, but I want to remove them entirely from memory.

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