#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
public OnPluginStart()
HookEvent("bomb_planted", EventBombPlanted);
public EventBombPlanted(Handle:event, const String:name[],bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
SetEntityHealth(client, 100);
}
#pragma semicolon 1
#include <sourcemod>
#include <sdktools_functions>
public OnPluginStart()
HookEvent("bomb_planted", EventBombPlanted);
public EventBombPlanted(Handle:event, const String:name[],bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
SetEntityHealth(client, 100);
SetEntProp(client, Prop_Send, "m_ArmorValue", 100, 1);
}
R1KO, И с каким нибудь не большим текстовым сопровождением игроку в чате, типа:
"Пополнение XP за установку бомбы" если конечно не трудно :)
#pragma semicolon 1
#include <sourcemod>
#include <sdktools_functions>
public OnPluginStart()
HookEvent("bomb_planted", EventBombPlanted);
public EventBombPlanted(Handle:event, const String:name[],bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
SetEntityHealth(client, 100);
SetEntProp(client, Prop_Send, "m_ArmorValue", 100, 1);
PrintToChat(client, "Вам пополнено XP за установку бомбы");
}
#include <sourcemod>
#define HEALTH 100
#define ARMOR 100
new hHealth = -1,
hArmor = -1;
public OnPluginStart()
{
hHealth = FindSendPropOffs("CSSPlayer", "m_iHealth");
hArmor = FindSendPropOffs("CSSPlayer", "m_ArmorValue");
HookEvent("bomb_planted", Event_OnBombPlanted);
}
public Event_OnBombPlanted(Handle:event, const String:name[], bool:silent)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client > 0)
{
decl String:message[100];
new bool:check = false;
new hp = GetEntData(client, hHealth, 4);
if (hp < HEALTH)
{
SetEntData(client, hHealth, HEALTH, 4, true);
Format(message, sizeof(message), "%d Здоровья. ", HEALTH - hp);
check = true;
}
new am = GetEntData(client, hArmor, 4);
if (am < ARMOR)
{
SetEntData(client, hArmor, ARMOR, 4, true);
Format(message, sizeof(message), "%s%d Брони", message, ARMOR - am);
if (!check)
{
check = true;
}
}
if (check)
{
PrintToChat(client, "За установку бомбы вам добавлен бонус. Добавлено: %s", message);
}
}
}
#include <sourcemod>
public OnPluginStart()
{
HookEvent("bomb_planted", Event_BombPlanted);
}
public Event_BombPlanted(Handle:event, const String:name[], bool:silent)
{
new iClient = GetClientOfUserId(GetEventInt(event, "userid"));
decl String:szMessage[128];
new bool:bHealth = false, bool:bArmor = false;
new iHealth = GetClientHealth(iClient);
if ( iHealth < 100 )
{
SetEntProp(iClient, Prop_Send, "m_iHealth", 100);
bHealth = true;
Format(szMessage, sizeof(szMessage) - 1, "%d здоровья", 100 - iHealth);
}
new iArmor = GetClientArmor(iClient);
if ( iArmor < 100 )
{
SetEntProp(iClient, Prop_Send, "m_ArmorValue", 100);
bArmor = true;
if ( bHealth )
{
Format(szMessage, sizeof(szMessage) - 1, "%s, %d брони", szMessage, 100 - iArmor);
}
else
{
Format(szMessage, sizeof(szMessage) - 1, "%d брони", 100 - iArmor);
}
}
if ( bHealth || bArmor )
{
PrintToChat(iClient, "\x03За установку бомбы \x04добавлено\x03: %s", szMessage);
}
}