Jump to content

Show icon when somone is typing.....


DazzaJay

Recommended Posts

  • Replies 134
  • Created
  • Last Reply

Top Posters In This Topic

I've got it working on my server right now. I think I'll post the code when I get a chance, since I'm sure it's horribly inefficient right now, and I wouldn't mind a couple more eyes checking my code

Thats kinda weird, seeing as isChatBoxInputActive() does not work in DP2 :)

Are you having us on :P

*edit*

Pics or it didnt happen

Link to comment
Try http://www.fileden.com/files/2006/10/16/292619/tryme.rar. It works for me :)
Thats kinda weird, seeing as isChatBoxInputActive() does not work in DP2 :)

It works for me. Want a screen? :P

Well, i have tested yours, but there is a small bug i have found.

ok, if somone is Off screen when they start typing, and you turn to look at them, they dont have the icon above thier head.

like, it only places the icon above peoples heads when they start typing and they are seen in your screen area.

if you njeed me to go in better details, i can film a vid.

Link to comment

Dazza, ive made my own now, it supports:

- Fading the icon in and out as a player starts to chat and stops chatting

- Distance between players effects the size of the icon

- Icons are linked to your FPS, so they do not lag around.

- Icons are not displayed if the element is not on the screen.

I shall give it to you shortly, do u have MSN?

Link to comment
Thats odd, cos i changed your meta.xml from gamemode to script and it worked fine.

It would just give me a error about there being no src attribute for the file (while there is). Edit works now.

Edit (2): Try this, it should do everything AlienX's does except for the fade in and out (it just appears and disappears).

Edit (3): Changed the above again.

Edit (4): processLineOfSight doesn't really work well... or I just used it wrong -.-

Edited by Guest
Link to comment
nice! this is near perfect for me, but it is possibly that the icon don´t show through the objects and don´t show when the player are crawling?

Redownload, and replace

function updatep() 
    local players=getElementsByType("player") 
    for index,player in ipairs(players) do 
    if (timer[player]==true) then 
        local cx,cy,cz = getCameraPosition() 
        local px,py,pz = getElementPosition(player) 
        local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) 
        if (processLineOfSight ( cx, cy, cz, px, py, py, true, false, false, true, false, false, false, false, nil ) == false) then 
            if (distance<=160) then 
                if (distance <= 20) then 
                    size=1 
                else 
                        size=20/distance 
                end 
                local sx,sy = getScreenFromWorldPosition(px,py,pz+0.
                if (sx and sy) then 
                    image[player] = guiCreateStaticImage(sx,sy-(49*size),49*size,49*size,"img/icon.png",false,nil) 
                    if (image[player]) then 
                        destroyElement(image[player]) 
                    end 
                end 
            end 
        end 
    end 
    end 
end 

with

function updatep() 
    local players=getElementsByType("player") 
    for index,player in ipairs(players) do 
    if (timer[player]==true) then 
        local cx,cy,cz = getCameraPosition() 
        local px,py,pz = getElementPosition(player) 
        local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) 
        if (processLineOfSight ( cx, cy, cz, px, py, py, true, false, false, true, false, false, false, false, nil ) == false) then 
            if (isPlayerDucked(player)==false) then 
                if (distance<=160) then 
                    if (distance <= 20) then 
                        size=1 
                    else 
                            size=20/distance 
                    end 
                    local sx,sy = getScreenFromWorldPosition(px,py,pz+0.
                    if (sx and sy) then 
                        image[player] = guiCreateStaticImage(sx,sy-(49*size),49*size,49*size,"img/icon.png",false,nil) 
                        if (image[player]) then 
                            destroyElement(image[player]) 
                        end 
                    end 
                end 
            end 
        end 
    end 
    end 
end 

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