WeSTMan
А вот тут текст!
- Сообщения
- 833
- Реакции
- 521
PHP:
#pragma semicolon 1
#include <sdkhooks>
#include <sourcemod>
#include <cstrike>
public OnPluginStart()
{
RegConsoleCmd("vipmenu", Vip_Command);
}
public Action:OnDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
if (attacker > 0 && attacker < MaxClients && !IsFakeClient(attacker))
{
damage += 50;
return Plugin_Changed;
}
return Plugin_Continue;
}
public Action:OnDamageStandart(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
if (attacker > 0 && attacker < MaxClients && !IsFakeClient(attacker))
{
damage += 0;
return Plugin_Changed;
}
return Plugin_Continue;
}
public Action:Vip_Command(client, args)
{
ShowVipMenu(client);
return Plugin_Handled;
}
ShowVipMenu(client)
{
new Handle:hMenu = CreateMenu(Handle_VipMenu);
SetMenuTitle(hMenu, "Vip меню: \n \n");
AddMenuItem(hMenu, NULL_STRING, "Меню урока");
DisplayMenu(hMenu, client, MENU_TIME_FOREVER);
}
public Handle_VipMenu(Handle:hMenu, MenuAction:action, client, iSlot )
{
if ( action == MenuAction_Select )
{
if ( iSlot == 0 )
{
ShowVipDamage(client);
}
}
else if ( action == MenuAction_End )
{
CloseHandle(hMenu);
}
}
ShowVipDamage(client)
{
new Handle:hMenu = CreateMenu(Handle_VipDamageMenu);
SetMenuTitle(hMenu, "Меню урона: \n \n");
AddMenuItem(hMenu, NULL_STRING, "Стандартный урон");
AddMenuItem(hMenu, NULL_STRING, "Увеличенный на 50ДМГ");
DisplayMenu(hMenu, client, MENU_TIME_FOREVER);
}
public Handle_VipDamageMenu(Handle:hMenu, MenuAction:action, client, iSlot )
{
if ( action == MenuAction_Select )
{
if ( iSlot == 0 )
{
SDKHook(client, SDKHook_OnTakeDamage, OnDamageStandart);
}
else if ( iSlot == 1 )
{
SDKHook(client, SDKHook_OnTakeDamage, OnDamage);
}
}
else if ( action == MenuAction_End )
{
CloseHandle(hMenu);
}
}