Hi,
why would this have errors ? :
PHP Code:
#include <amxmodx>
enum _:PlayerInfo
{
Player_Name[32] ,
Player_Authid[35]
}
new g_PlayerData[ 33 ] [ PlayerInfo ]
public plugin_init()
{
register_clcmd("say /test" , "test")
}
public test(id)
{
new eInfo[g_PlayerData] // difference
get_user_name(id , eInfo[Player_Name] , charsmax(eInfo[Player_Name]))
get_user_authid(id , eInfo[Player_Authid] , charsmax(eInfo[Player_Authid]))
client_print(id , print_chat , "Your name is : %s" , eInfo[Player_Name])
client_print(id , print_chat , "Your steamid is : %s" , eInfo[Player_Authid] )
}
Quote:
error 008: must be a constant expression; assumed zero
error 017: undefined symbol "eInfo"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
|
however this one compiles and works fine in game.
PHP Code:
#include <amxmodx>
enum _:PlayerInfo
{
Player_Name[32] ,
Player_Authid[35]
}
new g_PlayerData[ 33 ] [ PlayerInfo ]
public plugin_init()
{
register_clcmd("say /test" , "test")
}
public test(id)
{
new eInfo[PlayerInfo] // difference
get_user_name(id , eInfo[Player_Name] , charsmax(eInfo[Player_Name]))
get_user_authid(id , eInfo[Player_Authid] , charsmax(eInfo[Player_Authid]))
client_print(id , print_chat , "Your name is : %s" , eInfo[Player_Name])
client_print(id , print_chat , "Your steamid is : %s" , eInfo[Player_Authid] )
}
Quote:
warning 203: symbol is never used: "g_PlayerData"
Header size: 256 bytes
Code size: 404 bytes
Data size: 240 bytes
Stack/heap size: 16384 bytes
Total requirements: 17284 bytes
1 Warning.
Done.
[Finished in 0.3s]
|
so if we do not need this here , where we will need it ?
PHP Code:
new g_PlayerData[ 33 ] [ PlayerInfo ]