Correct code.
Code:
#include < amxmodx >
#define MAX_PLAYERS 33
new g_iStoreCash[ MAX_PLAYERS ] ;
public client_disconnect( id ) {
new PlayerName[ 33 ], CurrentCash;
get_user_name( id, PlayerName, charsmax( PlayerName ) )
CurrentCash = cs_get_user_money( id )
g_iStoreCash[ id ] = CurrentCash
}
Your Mistake ( Highlighted ) :
Quote:
Originally Posted by CreativeTR
Example
Code:
new p_Cash[33]
public client_disconnect(id) {
new p_name[33]
get_user_name(id, p_name, 33) // It should be 32 because 33 - 1 = 32 (last character in a string must be ^0)
p_Cash[p_name] = current_cash
}
|
You should always use Charsmax instead of doing it manually.
__________________