BorderLine Posted April 25, 2012 Share Posted April 25, 2012 i was making with a friend a gui to show some players stats but i have some problems. clientside function setStats ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) local thePlayer = getPlayerFromName ( playername ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local location = getZoneName ( x, y, z ) local id = getElementModel( thePlayer ) local tm1 = getPlayerTeam( thePlayer ) local tm2 = getTeamName( tm1 ) triggerServerEvent( "getUn", thePlayer) -- triggers i dont know if are wrong or i need getLocalPlayer() triggerServerEvent( "getMon", thePlayer) triggerServerEvent( "getSer", thePlayer) guiSetText ( GUIEditor_Label[1], "Nickname : ".. playername ) guiSetText ( GUIEditor_Label[2], "Location : ".. location ) guiSetText ( GUIEditor_Label[3], "Money : ".. money ) guiSetText ( GUIEditor_Label[4], "Skin : ".. id ) guiSetText ( GUIEditor_Label[5], "Serial : ".. theSerial ) guiSetText ( GUIEditor_Label[6], "Team : ".. tm2 ) guiSetText ( GUIEditor_Label[7], "Username : ".. un ) end end end end addEventHandler ( "onClientGUIDoubleClick", root, setStats ) serverside function getUN() local un = getAccountName ( source ) end addEvent("getUN", true) addEventHandler("getUN", getRootElement(), getUN) function getMon() local money = getPlayerMoney(source) end addEvent("getMon", true) addEventHandler("getMon", getRootElement(), getMon) function getSer() local theSerial = getPlayerSerial( source ) end addEvent("getSer", true) addEventHandler("getSer", getRootElement(), getSer) i hope you can understand me and thanks for your time and oh. debugscript dont show message Link to comment
Absence2 Posted April 25, 2012 Share Posted April 25, 2012 player argument "thePlayer" is serverside only. use localPlayer Link to comment
abu5lf Posted April 25, 2012 Share Posted April 25, 2012 triggerServerEvent("getUn",getLocalPlayer()) --Error triggerServerEvent( "getUn", thePlayer) Link to comment
Kenix Posted April 25, 2012 Share Posted April 25, 2012 player argument "thePlayer" is serverside only. use localPlayer Maybe better read wiki? He get player element via function getPlayerFromName Yakuza.Real Not defined Variables: money, theSerial, un. You should trigger to server -> get serial, money, ... -> trigger this data to client -> guiSetText Link to comment
BorderLine Posted April 25, 2012 Author Share Posted April 25, 2012 sounds dificult , well thanks kenix, ill see what i can do Link to comment
Booo Posted April 25, 2012 Share Posted April 25, 2012 If you want to fix your code send all client code 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