Castillo Posted June 12, 2010 Share Posted June 12, 2010 hey again, i have a problem genting the account name of the player selected from a grid list, before it just returned the player nick but now just outputs a warning at debug script, here is my code. server function update(client) local who = getPlayerFromName (client) local account = getAccount (client) triggerClientEvent ( "updateGuis", getRootElement(), getPlayerIP ( who ), getPlayerSerial ( who ), getAccountName ( account ), getPlayerMoney ( who ), getPlayerPing ( who ) ) end addEvent("updateGui", true) addEventHandler("updateGui", getRootElement(), update) those other stuff is working fine, just account name dosnt work. Link to comment
50p Posted June 12, 2010 Share Posted June 12, 2010 How many times do I have to tell you? Do NOT name any function parameters client if the function is called by triggerServerEvent. Link to comment
Castillo Posted June 12, 2010 Author Share Posted June 12, 2010 How many times do I have to tell you? Do NOT name any function parameters client if the function is called by triggerServerEvent. i just changed to "player" and is same, just genting the nick not the account name Link to comment
50p Posted June 12, 2010 Share Posted June 12, 2010 Are you sure that account name is not the same as player name? Usually when players register they register with their name so account name will be the same as their name. Also, you use getAccount and use player's name for username (which is the account name) and then you getAccountName (of the account that you know the name already). Use getPlayerAccount instead: local who = getPlayerFromName (client); local account = getPlayerAccount( who ); Link to comment
Castillo Posted June 12, 2010 Author Share Posted June 12, 2010 Are you sure that account name is not the same as player name? Usually when players register they register with their name so account name will be the same as their name.Also, you use getAccount and use player's name for username (which is the account name) and then you getAccountName (of the account that you know the name already). Use getPlayerAccount instead: local who = getPlayerFromName (client); local account = getPlayerAccount( who ); yea! finally works, thank you so much! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now