Jump to content

Update the stat problem


Recommended Posts

Posted

hey guys i made a gridlist with players ok ? when i select my my self and my serial show up into a label

but when i choose a new player i find the same serial just like the serial was freezed on me only

here's my code

     function onClick () 
      
    selectedRow, selectedCol = guiGridListGetSelectedItem( GUIEditor_Grid[1]) 
    hisName = guiGridListGetItemText( GUIEditor_Grid[1], selectedRow, selectedCol ) 
    hisSerial = getPlayerSerial( GUIEditor_Grid[1], selectedRow, selectedCol ) 
    hisMoney = getPlayerMoney( GUIEditor_Grid[1], selectedRow, selectedCol ) 
    hisPing = getPlayerPing( GUIEditor_Grid[1], selectedRow, selectedCol ) 
  
     
    guiSetText ( GUIEditor_Label[7], tostring(hisName)) 
    guiSetText ( GUIEditor_Label[9], tostring(hisSerial)) 
    guiSetText ( GUIEditor_Label[12], tostring(hisMoney)) 
    guiSetText ( GUIEditor_Label[12], tostring(hisPing)) 
    end 
      
    addEventHandler( "onClientGUIClick", GUIEditor_Grid[1], onClick) 

F4MZM4.gif

Posted

The main reason is that getPlayerSerial client side just returns the local player, it doesn't has a player argument.

Same as money, also there you're trying to get it from a GUI-element, not a player?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
  
hisName = guiGridListGetItemText( GUIEditor_Grid[1], selectedRow, selectedCol ) 
local pl = getPlayerFromName(hisName) 
    hisSerial = getPlayerSerial( pl ) 
    hisMoney = getPlayerMoney( pl ) 
    hisPing = getPlayerPing( pl ) 
  

3677124c9d4d768da64a55d5bebf578e.png
Posted

Just wondering, did you even read Castillo's post?

He clearly said that getPlayerSerial and getPlayerMoney have no player argument.

  
hisName = guiGridListGetItemText( GUIEditor_Grid[1], selectedRow, selectedCol ) 
local pl = getPlayerFromName(hisName) 
    hisSerial = getPlayerSerial( ) 
    hisMoney = getPlayerMoney( ) 
    hisPing = getPlayerPing( pl ) 
  

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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