well i found this but can some1 help me make it do this... it reads not only the steam id but after it a number and if it as number 14 it will do
Code:
#define MAX_LEVELS 14
and etc.. for the other numbers... like make an if statement if possible?
Code:
#include <amxmodx>
#define MULTIPLE_USERS
#if defined MULTIPLE_USERS
#define MAX_USERS 100
#define USER_LIST_LOCATION "addons/amxmodx/configs/myuserlist.txt"
new userList[MAX_USERS][32];
public plugin_cfg()
{
loadUsers();
}
loadUsers()
{
new fileHandle = fopen(USER_LIST_LOCATION, "r");
if(!fileHandle)
{
return;
}
new lineBuffer[64], userCount;
while(!feof(fileHandle) && userCount < MAX_USERS)
{
fgets(fileHandle, lineBuffer, charsmax(lineBuffer));
if(equal("STEAM_", lineBuffer, strlen("STEAM_")))
{
copyc(userList[userCount++], charsmax(userList[]), lineBuffer, ' ');
}
}
fclose(fileHandle);
}
bool:hasAccess(userSteamID[])
{
for(new i; i < MAX_USERS; i++)
{
if(equal(userList[i], userSteamID))
{
return true;
}
}
return false;
}
#else
#define PRIVELEGED_USER "STEAM_0:0:17"
#endif
public plugin_init()
{
register_clcmd("amx_mycommand", "myCommand");
}
public myCommand(id)
{
new userSteamID[32];
get_user_authid(id, userSteamID, charsmax(userSteamID));
#if defined MULTIPLE_USERS
if(!hasAccess(userSteamID))
{
client_print(id, print_console, "You have no access to that command");
return PLUGIN_HANDLED;
}
#else
if(!equal(userSteamID, PRIVELEGED_USER))
{
client_print(id, print_console, "You have no access to that command");
return PLUGIN_HANDLED;
}
#endif
//command goes here
return PLUGIN_HANDLED;
}