Jump to content

[HELP]Create panel.


Recommended Posts

Hello!

I have a server of DayZ MTA and would like to add a panel of gender selection. It should only appear before you create an account, then, even if you die, it does not appear anymore.

Preview:

selectgender_zps5c2abd20.png

I do not know to create resources ... so if anyone can help me ...

Male = Skin 73 and Female = Skin 287

Link to comment
you need that images for create like it !

Ok: Link of images:

Background: http://i293.photobucket.com/albums/mm45 ... 0a5568.png

Window: http://i293.photobucket.com/albums/mm45 ... e978c9.png

Charecters:

Male Skin: http://i293.photobucket.com/albums/mm45 ... 344d48.png

Female Skin: http://i293.photobucket.com/albums/mm45 ... fb9073.png

*SELECT YOUR GENDER, Male and Female he's just a text.

ID and name of skins:

Male skin= 73 (standart.txd and standart.dff)

Female Skin= 287 (female.txd and female.dff)

Link to comment

Try this:

client.lua

  
function chooseG() 
    background = guiCreateStaticImage(0, 0, 1, 1, "background.png", true) 
    window = guiCreateStaticImage(0.2, 0.125, 0.6, 0.75, "window.png", true,background) 
    male = guiCreateStaticImage(0.1, 0.125, 0.2, 0.6, "male.png", true,window) 
    female = guiCreateStaticImage(0.7, 0.125, 0.6, 0.75, "female.png", true,window) 
     
    addEventHandler("onClientGUIClick", male, playerChosen) 
end 
function playerChosen() 
    if(source==male)then 
        triggerServerEvent("gender:setGender",localPlayer,1) 
    elseif(source==female)then 
        triggerServerEvent("gender:setGender",localPlayer,0) 
    end 
    destroyElement(background) 
end 
addEvent("gender:chooseGender",true) 
addEventHandler("gender:chooseGender",root,chooseG) 
  

server.lua

  
function login(oldacc,acc) 
    local gender = getAccountData(acc,"gender") 
    if(gender~=0 and gender~=1)then 
        triggerClientEvent(source,"gender:chooseGender",source) 
    end 
end 
addEventHandler('onPlayerLogin', root, login) 
  
function setG(gender) -- 1 = male, 0 = female 
    local acc = getPlayerAccount(source) 
    if(acc)then 
        setAccountData(acc,"gender",gender) 
    end 
end 
addEvent("gender:setGender",true) 
addEventHandler("gender:setGender",root,setG) 
  

meta.xml

  
<meta> 
    <script src="server.lua "type="server"/> 
    <script src="client.lua "type="client"/> 
     
    <file src="background.png"/> 
    <file src="window.png"/> 
    <file src="male.png"/> 
    <file src="female.png"/> 
</meta> 
  

Name your images as:

background.png

window.png

male.png

female.png

I didnt test it, so I am not sure if it works.

Link to comment
Well yea, it only lets you choose the first time you login with your account. When should it appear?

It doesnt change the skins. If you want it to change skins, tell me the skin ID's for males and females.

Ok:

1- I enter in the server

2- The login panel appears

3- I create a account

4- The gender panel appears

5- If I click on the male image, I start with the male skin (ID 73 and name standart.txd and standart.dff)

If I click on the female image, I start with the female skin (ID 11 and name female.txd and female.dff)

6- If i die, the panel do not appears, only if create a account.

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