Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "speedkill"
//Global variable
new g_GlobalValue = 50;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /test", "ExampleTest");
}
public ExampleTest(id){
if(is_user_alive(id)){
//Local variable
new g_LocalValue = 25;
client_print(id, 3, "%d | %d", g_GlobalValue, g_LocalValue);
}
/*
Error, variable "g_LocalValue" not exist "Error: Undefined symbol "g_LocalValue" on line 25"
client_print(id, 3, "%d | %d", g_GlobalValue, g_LocalValue);
*/
}
Global variable can be used everywhere - like Torge wrote.
Local variable can be used only in function or block, where this variable is declared.
About enum ->
https://forums.alliedmods.net/showthread.php?t=140103