Skip to content

Instantly share code, notes, and snippets.

@webdestroya
Last active December 16, 2015 20:29
Show Gist options
  • Save webdestroya/5492706 to your computer and use it in GitHub Desktop.
Save webdestroya/5492706 to your computer and use it in GitHub Desktop.
#include <sourcemod>
public Plugin:myinfo =
{
name = "killjoy",
author = "WebDestroya",
description = "Does something for killjoy",
version = "1.0",
url = "http://www.mitchdb.com/"
};
public OnPluginStart() {
RegConsoleCmd("sm_check", Command_Check, "Checks if you are a member or not");
}
public Action:Command_Check(client, args) {
// find the adminID of the calling user
new AdminId:adminId = GetUserAdmin(client);
// they arent even an admin, so they wont have the flag anyway
if(adminId == INVALID_ADMIN_ID) {
PrintToConsole(client, "You are not a member");
return Plugin_Handled;
}
// check to see if they have the flag
if(GetAdminFlag(adminId, AdminFlag:Admin_Custom6)) {
PrintToConsole(client, "You are a member");
} else {
PrintToConsole(client, "You are not a member");
}
// finished
return Plugin_Handled;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment