Jump to content

nametags gui


A3kri

Recommended Posts

Hello,

how to make a gui window

with some nametags inside

and when the player choose one and press select the name tag appears on his head

like

Nametags v1

- the hero

- the cop

- the punisher

- the lover

etc ..

[select]

when he chooses one then press select it appears on his head and the gui window appears everything he logs in like the login panel

Link to comment
I would recommend using DirectX functions, rather than CEGUI. It's a lot smoother, for dynamic stuff such as nametags.

thanks man , ill try =)

You'll need a combination of GUI and DX functions, GUI to create the interface to select nametag, and DX to draw the nametag itself.

http://wiki.multitheftauto.com/wiki/Cli ... _functions

dxDrawImage 
dxDrawText 

that's what I heard, I'll try to do that .. thanks =)

--- EDIT

after I made the gui .. in the grid list what do I make a text ? or buttons ..

and after I made them .. using the DX how do I let the option the user chose will be on his head ?

Link to comment

all u need is ur gui with 1 gridlist containing ur text to show above the player and the select button,

when u click select, get the selected info from the gridlist and store it to a table for that player.

in ur dx function all u need is to check if the player has any stored data in the table, if so.. draw it.

post back if u need more help.

Link to comment

thanks guys ..

I've done it using the guieditor in the community main page ..

this what I made

  
  
addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Grid = {} 
  
        GUIEditor_Window[1] = guiCreateWindow(518,226,192,295,"Name tags",false) 
        GUIEditor_Grid[1] = guiCreateGridList(9,29,174,226,false,GUIEditor_Window[1]) 
        guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
        guiGridListAddColumn(GUIEditor_Grid[1],"Tags",0.2) 
  
        for i = 1, 2 do 
            guiGridListAddRow(GUIEditor_Grid[1]) 
end 
  
        guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Love") 
  
        guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Hate") 
        GUIEditor_Button[1] = guiCreateButton(12,261,171,25,"Select",false,GUIEditor_Window[1]) 
    end 
) 
  
  

now how do I make when the player chooses the name tag he wants it set on his head ?

Link to comment
thanks guys ..

I've done it using the guieditor in the community main page ..

this what I made

  
  
addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Grid = {} 
  
        GUIEditor_Window[1] = guiCreateWindow(518,226,192,295,"Name tags",false) 
        GUIEditor_Grid[1] = guiCreateGridList(9,29,174,226,false,GUIEditor_Window[1]) 
        guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
        guiGridListAddColumn(GUIEditor_Grid[1],"Tags",0.2) 
  
        for i = 1, 2 do 
            guiGridListAddRow(GUIEditor_Grid[1]) 
end 
  
        guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Love") 
  
        guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Hate") 
        GUIEditor_Button[1] = guiCreateButton(12,261,171,25,"Select",false,GUIEditor_Window[1]) 
    end 
) 
  
  

now how do I make when the player chooses the name tag he wants it set on his head ?

http://wiki.multitheftauto.com/wiki/OnClientGUIClick

http://wiki.multitheftauto.com/wiki/DxDrawText

http://wiki.multitheftauto.com/wiki/Gui ... lectedItem

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