R1KO
fuck society
- Сообщения
- 9,457
- Реакции
- 7,786
- Команда форума
- #21
tanya kovsky,
PHP:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools_functions>
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_WeaponCanUse, OnWeaponCanUse);
}
public Action:OnWeaponCanUse(client, weapon)
{
if(!IsClientInGame(client))
return Plugin_Continue;
if(GetClientTeam(client) <= 1)
return Plugin_Continue;
if (IsClientInGame(client) && IsPlayerAlive(client))
{
decl String:ClassName[30];
new WeaponIndex = GetEntPropEnt(spec, Prop_Send, "m_hActiveWeapon");
//GetEdictClassname(WeaponIndex, ClassName, sizeof(ClassName)); это пока не нужно
new m_iPrimaryAmmoType = -1;
if ((m_iPrimaryAmmoType = GetEntProp(WeaponIndex, Prop_Send, "m_iPrimaryAmmoType")) != -1)
{
SetEntProp(WeaponIndex , Prop_Send, "m_iClip1", 15);
SetEntProp(client, Prop_Send, "m_iAmmo", 50, _, m_iPrimaryAmmoType);
}
}
return Plugin_Handled;
}