Author
|
Message
|
AlliedModders Donor
|
02-01-2019
, 05:26
Animated CS_SetClientClanTag for ADMFLAG
|
#1
|
Hello
I'd like to request a simple plugin. CS_SetClientClanTag with CreateTimer for ADMFLAG_ROOT
Code:
CS_SetClientClanTag(client, "A") - 1st timer
CS_SetClientClanTag(client, "AD") - 2nd timer
CS_SetClientClanTag(client, "ADM") - 3rd timer
CS_SetClientClanTag(client, "ADMI") - 4th timer
CS_SetClientClanTag(client, "ADMIN") - 5th timer
plugin
Spoiler
Code:
#include <sourcemod>
#include <cstrike>
#include <store>
#pragma semicolon 1
public Plugin myinfo = {
name = "Store VIP Tag",
author = "Totenfluch",
version = "1.1",
description = "*VIP* Tag is bought + Admin Tags",
url = "https://totenfluch.de"
};
public void OnPluginStart() {
Store_RegisterHandler("viptag", "", viptag_OnMapStart, viptag_Reset, viptag_Config, viptag_Equip, viptag_Remove, true);
HookEvent("player_spawn", eventPlayerSpawn);
}
public void viptag_OnMapStart() { }
public void viptag_Reset() { }
public bool viptag_Config(Handle kv, int itemid) {
Store_SetDataIndex(itemid, 0);
return true;
}
public int viptag_Equip(int client, int id) {
NameCheck(client);
return -1;
}
public void viptag_Remove(int client, int id) {
NameCheck(client);
}
public Action eventPlayerSpawn(Handle event, const char[] name, bool dontBroadcast) {
int userid = GetEventInt(event, "userid");
int client = GetClientOfUserId(userid);
if (isValidClient(client)) {
NameCheck(client);
}
}
public void NameCheck(int client) {
int m_iEquipped = Store_GetEquippedItem(client, "viptag");
if (m_iEquipped < 0) {
CS_SetClientClanTag(client, "");
return;
}
CS_SetClientClanTag(client, GetClientClientAdminStatus(client));
}
char[] GetClientClientAdminStatus(int client) {
bool admin = CheckCommandAccess(client, "sm_ccommand", ADMFLAG_CUSTOM4, true);
bool root = CheckCommandAccess(client, "sm_ccommand", ADMFLAG_ROOT, true);
char stuff[20];
if (root) {
Format(stuff, sizeof(stuff), "ROOT");
} else if (admin) {
Format(stuff, sizeof(stuff), "Game Admin");
} else {
Format(stuff, sizeof(stuff), "PLAYER");
}
return stuff;
}
stock bool isValidClient(int client) {
return (1 <= client <= MaxClients && IsClientInGame(client));
}
Last edited by Sw33T3R; 06-10-2019 at 00:56.
|
|
|
|