Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- public OnPluginStart()
- {
- RegConsoleCmd("hp", sm_health);
- }
- public Action:sm_health(int client,int args)
- {
- Menu menu = new Menu(hp2)
- menu.SetTitle("Настройка хп")
- menu.AddItem("1HP", "1 ХП");
- AddMenuItem(menu, "50HP", "50 ХП");
- AddMenuItem(menu, "9999HP", "9999 ХП");
- menu.ExitButton = true;
- menu.Display(client, 20);
- return Plugin_Handled;
- }
- public int hp2(Menu menu, MenuAction action, int param1, int param2)
- {
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- return;
- }
- if(action == MenuAction_Select) {
- decl String:iItem[32]
- GetMenuItem(menu, param2, iItem, sizeof(iItem));
- if(strcmp(iItem,"1HP") == 0 )
- {
- SetEntityHealth(param1, 1)
- }
- else if(strcmp(iItem,"5HP") == 0 )
- {
- SetEntityHealth(param1, 50)
- }
- else if(strcmp(iItem,"9999HP") == 0 )
- {
- SetEntityHealth(param1, 9999)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement