I'm looking for a simple plugin that would give those with a certain admin flag a Vest at the beginning of each round. It would not give them a helmet though.
I looked for a CSS Plugin that does this so I could try it, but I couldn't find one.
admin access "sm_donator_kevlar" (flag z) (Don't give anyone, not even yourself admin flag "root", then most plugins work like should.)
plugin
PHP Code:
#include <sdktools> new bool:HasAccess[MAXPLAYERS+1];
public OnPluginStart() { HookEventEx("player_spawn", player_spawn); }
public OnClientPostAdminCheck(client) { HasAccess[client] = CheckCommandAccess(client, "sm_donator_kevlar", ADMFLAG_ROOT); }
public player_spawn(Handle:event,const String:name[],bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid")); if(HasAccess[client] && GetClientTeam(client) >= 2) { GivePlayerItem(client, "item_kevlar"); } }
admin_groups.cfg
Code:
Groups
{
/**
* Allowed properties for a group:
*
* "flags" - Flag string.
* "immunity" - Immunity level number, or a group name.
* If the group name is a number, prepend it with an
* '@' symbol similar to admins_simple.ini. Users
* will only inherit the level number if it's higher
* than their current value.
*/
"Default"
{
"immunity" "1"
}
"Full Admins"
{
/**
* You can override commands and command groups here.
* Specify a command name or group and either "allow" or "deny"
* Examples:
* ":CSDM" "allow"
* "csdm_enable" "deny"
*/
Overrides
{
}
"flags" "abcdefghiz"
/* Largish number for lots of in-between values. */
"immunity" "99"
}
"Donits"
{
Overrides
{
"sm_donator_kevlar" "allow"
}
"immunity" "1"
}
}
Overrides
{
/**
* By default, commands are registered with three pieces of information:
* 1)Command Name (for example, "csdm_enable")
* 2)Command Group Name (for example, "CSDM")
* 3)Command Level (for example, "changemap")
*
* You can override the default flags assigned to individual commands or command groups in this way.
* To override a group, use the "@" character before the name. Example:
* Examples:
* "@CSDM" "b" // Override the CSDM group to 'b' flag
* "csdm_enable" "bgi" // Override the csdm_enable command to 'bgi' flags
*
* Note that for overrides, order is important. In the above example, csdm_enable overwrites
* any setting that csdm_enable previously had.
*
* You can make a command completely public by using an empty flag string.
*/
"sm_donator_kevlar" "o"
}