Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.95 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. public OnPluginStart()
  5. {
  6.     RegConsoleCmd("hp", sm_health);
  7. }
  8.  
  9. public Action:sm_health(int client,int args)
  10. {
  11.     Menu menu = new Menu(hp2)
  12.     menu.SetTitle("Настройка хп")
  13.     menu.AddItem("1HP", "1 ХП");
  14.     AddMenuItem(menu, "50HP", "50 ХП");
  15.     AddMenuItem(menu, "9999HP", "9999 ХП");
  16.     menu.ExitButton = true;
  17.     menu.Display(client, 20);
  18.  
  19.     return Plugin_Handled;
  20. }
  21.  
  22. public int hp2(Menu menu, MenuAction action, int param1, int param2)
  23. {
  24.     if(action == MenuAction_End)
  25.     {
  26.         CloseHandle(menu);
  27.         return;
  28.     }
  29.    
  30.     if(action == MenuAction_Select) {  
  31.         decl String:iItem[32]
  32.         GetMenuItem(menu, param2, iItem, sizeof(iItem));
  33.  
  34.         if(strcmp(iItem,"1HP") == 0 )
  35.         {
  36.             SetEntityHealth(param1, 1)
  37.         }
  38.         else if(strcmp(iItem,"5HP") == 0 )
  39.         {
  40.             SetEntityHealth(param1, 50)
  41.         }
  42.         else if(strcmp(iItem,"9999HP") == 0 )
  43.         {
  44.             SetEntityHealth(param1, 9999)
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement