Quote:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
public void OnPluginStart()
{
HookEvent("round_start", Event_RoundStartMode, EventHookMode_PostNoCopy);
}
public Action Event_RoundStartMode(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
WeaponSlotSecondary(client);
}
public void WeaponSlotSecondary(int client)
{
if (IsValidClient(client))
{
int iTeam = GetClientTeam(client);
if (iTeam > CS_TEAM_SPECTATOR)
{
int iWeapon = GetPlayerWeaponSlot(client, 1);
if (IsValidEdict(iWeapon))
{
RemovePlayerItem(client, iWeapon);
RemoveEdict(iWeapon);
}
}
}
}
stock bool IsValidClient(int client)
{
if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) > CS_TEAM_SPECTATOR)
{
return true;
}
return false;
}
|
here is code to remove secondary weapons, you can do it on round start