#include <amxmodx>
#include <reapi>
// https://dev-cs.ru/resources/73/update/1899/
#if REAPI_VERSION < 59177
#define ATYPE_BOOL ATYPE_INTEGER
#endif
stock const SOUND__ERROR[] = "sound/buttons/button2.wav"
new bool:g_bSteam[MAX_PLAYERS + 1]
public plugin_init() {
register_plugin("No AWP for Non-Steam", "1.0", "mx?!")
RegisterHookChain(RG_CBasePlayer_HasRestrictItem, "CBasePlayer_HasRestrictItem_Pre")
}
public client_putinserver(pPlayer) {
g_bSteam[pPlayer] = is_user_steam(pPlayer)
}
public CBasePlayer_HasRestrictItem_Pre(pPlayer, ItemID:iItem, ItemRestType:iRestType) {
if(iItem == ITEM_AWP && !g_bSteam[pPlayer] && iRestType != ITEM_TYPE_EQUIPPED) {
if(iRestType == ITEM_TYPE_BUYING) {
rg_send_audio(pPlayer, SOUND__ERROR)
client_print(pPlayer, print_center, "This weapon is for STEAM players only!")
}
SetHookChainReturn(ATYPE_BOOL, true) // ATYPE_INTEGER
return HC_SUPERCEDE
}
return HC_CONTINUE
}
new mapname[32];
get_mapname(mapname, charsmax(mapname));
static maps[][] = { "35hp", "awp", "aim", "fun", "fy", "gg", "knife", "scout", "zp", "zm", "ze" };
for(new i; i < sizeof maps; i++){
if(containi(mapname, maps[i]) != -1){
pause("ad");
return;
}
}