Raised This Month: $ Target: $400
 0% 

Solved Enum's


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-31-2019 , 02:13   Enum's
Reply With Quote #1

Hi,
why would this have errors ? :
PHP Code:
#include <amxmodx>

enum _:PlayerInfo
{
    
Player_Name[32] ,
    
Player_Authid[35]
}

new 
g_PlayerData33 ] [ 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_PlayerData33 ] [ 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_PlayerData33 ] [ PlayerInfo 

Last edited by LearninG; 08-31-2019 at 04:10. Reason: solved
LearninG is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode