#include <sdktools_functions>

public Plugin myinfo = { author = "[ Khood ] [ DISCORD: serafimhl ]", version = "1.1", };

public void OnPluginStart() { HookEvent("player_spawn", Event_Player_removedeagle, EventHookMode_PostNoCopy); }

public Action Event_Player_removedeagle(Event event, const char[] name, bool dontBroadcast)
{
    int client = GetClientOfUserId(event.GetInt("userid"));
    if (client > 0 && client <= MaxClients && IsClientInGame(client))
    {
        static char mapName[64];
        GetCurrentMap(mapName, sizeof(mapName));
        if (StrContains(mapName, "awp_", false) == 0)
        {
            RemoveDeagle(client);
        }
    }
    return Plugin_Continue;
}

void RemoveDeagle(int client)
{
    int weapon = GetPlayerWeaponSlot(client, 1);
    if (weapon != INVALID_ENT_REFERENCE)
    {
        static char className[64];
        GetEdictClassname(weapon, className, sizeof(className));
        if (StrEqual(className, "weapon_deagle", false))
        {
            RemovePlayerItem(client, weapon);
            RemoveEdict(weapon);
        }
    }
}