#include <sdktools>
bool bAlive[MAXPLAYERS + 1] = {false, ...};
public Action OnPlayerRunCmd(int client, int &buttons)
{
if(IsPlayerAlive(client))
{
if(bAlive[client]) return Plugin_Continue;
bool run = true;
while(run)
{
if(GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon") != GetPlayerWeaponSlot(client, 0))
{
EquipPlayerWeapon(client, GetPlayerWeaponSlot(client, 0));
run = true;
}
else run = false;
}
bAlive[client] = true;
}
else
{
bAlive[client] = false;
}
return Plugin_Continue;
}