View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-14-2020 , 20:08   Re: Money System [Bank | Donate | Give | Take | Time presents]
Reply With Quote #20

Right now the plugin is pretty much useless since only one player can use it at a time due to your steam ID logic. At your skill level you need to thoroughly test a plugin and be confident it works before posting it for others to use.

Just use #define MAX_PLAYERS 32 , there is no need to first check if its defined doing it this way.
Code:
#if !defined MAX_PLAYERS     const MAX_PLAYERS = 32; #endif
Global variables meant for each player to have a slot in the array should be sized using MAX_PLAYERS + 1. Currently, each time a player connects, his steam id overwrites the last player that connected.
Code:
new szPlayerAuthid[32], szPlayerName[32], //This should be defined as : new szPlayerAuthid[ MAX_PLAYERS + 1 ][32] //Then get_user_authid( id, szPlayerAuthid[ id ] , charsmax(szPlayerAuthid[]))
Why are you getting the same players auth id twice?
Code:
public client_authorized(id) {     get_user_name( id, szPlayerName, charsmax(szPlayerName))     get_user_authid( id, szPlayerAuthid, charsmax(szPlayerAuthid))     get_user_authid(id, szAuthID, charsmax(szAuthID));
A disconnected player cannot execute a menu, no need to check if connected
Code:
public BankHandler(id, iBankMenu, iItem) {     if(is_user_connected(id) && iItem != MENU_EXIT)     {
__________________
Bugsy is offline