#include <sourcemod>
#include <sdktools>
#include <csgo_colors>
public Plugin:myinfo =
{
name = "Scout",
author = "AlmazON",
version = "0.1.0",
url = "http://hlmod.ru/"
};
new bool:DraxtenVichSsg[MAXPLAYERS+1];
public OnPluginStart()
{
RegConsoleCmd("sm_scout", Command_Scout);
HookEvent("round_start", OnRoundStart, EventHookMode_PostNoCopy);
}
public OnRoundStart(Handle:event, String:name[], bool:dontBroadcast)
{
for (new i = 1; i <= MaxClients; ++i) DraxtenVichSsg[i] = true;
}
public Action:Command_Scout(client, args)
{
if (DraxtenVichSsg[client])
{
if (IsPlayerAlive(client))
{
if (GetPlayerWeaponSlot(client, 0) == -1)
{
DraxtenVichSsg[client] = false;
new ent = GivePlayerItem(client, "weapon_ssg08", 0);
SetEntProp(ent, Prop_Send, "m_iClip1", 0);
SetEntProp(ent, Prop_Send, "m_iPrimaryReserveAmmoCount", 0);
CGOPrintToChatAll("{GREEN}Игрок %N {BLUE}получил скаут! 1/1", client);
}
}
}
return Plugin_Handled;
}
public Action:CS_OnCSWeaponDrop(client, weaponIndex)
{
if (IsValidEntity(weaponIndex))
{
decl String:class[14];
GetEntityClassname(weaponIndex, class, sizeof(class));
if (strcmp(class, "weapon_ssg08") == 0) AcceptEntityInput(weaponIndex, "Kill");
}
return Plugin_Continue;
}