akvorok.ego
Участник
- Сообщения
- 314
- Реакции
- 186
ОффтопТут вообще-то КТ хотели бомбу передать)
PHP:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
public OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_Touch, Touch);
}
public Touch(ent1, ent2)
{
if(IsClientConnected(ent1) && IsClientInGame(ent1) && IsPlayerAlive(ent1) && GetClientTeam(ent1) == CS_TEAM_CT)
{
decl String:name[50];
GetEdictClassname(ent2, name, 50);
if(StrContains(name, "weapon_c4") != -1)
{
SetEntProp(ent1, Prop_Send, "m_iTeamNum", 2);
RemoveEdict(ent2);
GivePlayerItem(ent1, "weapon_c4");
SetEntProp(ent1, Prop_Send, "m_iTeamNum", 3);
}
}
}
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:broadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
new String:weapon[32];
GetEdictClassname(client, weapon, 32);
if (IsClientInGame(attacker) && IsPlayerAlive(attacker) && GetClientTeam(attacker) == 3 && FindEntityByClassname(MaxClients+1, "planted_c4") == -1 && strcmp(weapon, "weapon_c4") == 0)
{
GivePlayerItem(attacker, "weapon_c4");
}
}
public Action:CS_OnCSWeaponDrop(client, weapon)
{
if(IsClientInGame(client) && 0 < GetClientHealth(client))
{
decl String:classname[11];
GetEdictClassname(weapon, classname, 11);
if(strcmp(classname, "weapon_c4") == 0)
{
PrintToChat(client, "Облом... Бомба сбросу не подлежит!");
return Plugin_Handled;
}
}
return Plugin_Continue;
}
Последнее редактирование: