Jump to content

Need Help, Account thing.


Panda

Recommended Posts

Posted

Hello everyone,

Well first of all i tried to do when i open my panel it appears ACC NAME : "My Account name".

I really can't do it since i can't use getplayeraccount in Client side so this is a part of my script that is related to acc name thing:

 account = guiCreateLabel(56, 138, 65, 16, "ACC NAME :", false, GUIEditor.window[1]) 
        guiSetFont(account, "default-bold-small") 
        account1 = guiCreateLabel(127, 128, 160, 32, "", false, GUIEditor.window[1]) 

In account1, My account name should appear over there. I want it to appear thanks for helping. This is what i tried to do, stupid thing but i have nothing to do:

guiSetText(account1,"I want a player's account name appear here.") 

Thanks everyone.

Posted
triggerClientEvent 

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

Seriously? wow I really didn't notice. (sarcasm)

on the server side:

  
getPlayerAccount 
getAccountName 
triggerClientEvent 
  

Client side:

  
guiSetText 
  

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted
  
function onJoin () 
    local account = getPlayerAccount (source) 
    local accountName = getAccountName (account) 
    triggerClientEvent ('handleSetGUIText',source,accountName) 
end 
  

If you can write two lines of code, you can complete this.

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

Yeah i did that and what about client side ? i should add a new function like this?

function hi() 
    guiSetText(account1,"What should i type here?") 
    end 
    addEvent("handleSetGUIText",true) 
    addEventHandler("handleSetGUIText",root,hi) 

Posted
  
function handleSetText (accountName) 
    guiSetText (account1,accountName) 
end 
addEvent("handleSetGUIText",true) 
addEventHandler("handleSetGUIText",root,handleSetText ) 
  

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

--Client Side.

function handleSetText (accountName) 
    guiSetText (account1,accountName) 
end 
addEvent("handleSetGUIText",true) 
addEventHandler("handleSetGUIText",root,handleSetText ) 

--Server Side.

function onJoin () 
    local account = getPlayerAccount (source) 
    local accountName = getAccountName (account) 
    triggerClientEvent ('handleSetGUIText',source,accountName) 
end 

Not working bro :/

Posted

replace your serverside file with this one

    function onJoin () 
        local account = getPlayerAccount (source) 
        local accountName = getAccountName (account) 
        triggerClientEvent ('handleSetGUIText',source,source,accountName) 
    end 
addEventHandler("onPlayerJoin",root,onJoin) 

If you find my post useful or if it helped you, please like my post :)
Ingame name: ZoeN

560x95_FFFFFF_FF9900_000000_000000.png

Posted

http://codepad.org/5j6TjHwY

I tried to give you a chance to use your brain cells.

Just un-comment the guiSetText.

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

Mate.. It doesn't work Too D:.. Look at this pic, let me show u!

http://i.imgur.com/ZWz19o2.png

It doesn't appear!

Server Side

addEventHandler ('onPlayerLogin',root, 
    function (_, Account) 
        local accountName = getAccountName( Account ) 
        triggerClientEvent ('handleClient',source,accountName) 
    end 
) 

Client Side

    addEvent ('handleClient',true) 
addEventHandler ('handleClient',root, 
    function (accountName) 
        if tostring (accountName) then 
            guiSetText (account1,'Your account name is '..accountName) 
            outputChatbox (accountName) 
        end 
    end 
) 

Posted

The text will change once you login.. using /login command

Do /debugscript 3 and post the errors here.

You can change the server side to:

  
addCommandHandler ("acc", 
function (p) 
local account = getPlayerAccount (p) 
local accountName = getAccountName (account) 
triggerClientEvent ('handleClient',source,accountName) 
end 
) 
  

After you change it, have the GUI opened, and do /acc it should work, if it didn't, post /debugscript 3

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

Nope not working!

Error : "WARNING: Test/server.lua:58 Bad Argument @ 'triggerClientEvent'[Expected Element at argument 2, got nil]"

Posted

Oh done! I changed the source with P ;P Thanks mate it's working but now i need to edit something D: i mean i want it to appear when i open the panel not when i press the command

Posted

Events, mate.

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

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