Raised This Month: $32 Target: $400
 8% 

Solved Menu item that will make hp of players to full (100)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 12-03-2017 , 17:28   Menu item that will make hp of players to full (100)
Reply With Quote #1

Hey coders,

on making some basic menu, i still dont know how to make item, that will after click make all player healt to 100..

Somebody knows? Thanks.

Last edited by Javierko; 12-05-2017 at 16:45.
Javierko is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 12-03-2017 , 18:20   Re: Menu item that will make hp of players to full (100)
Reply With Quote #2

I did it, but there is another problem and i dont know how to fix it..

I use CS_TEAM_T, and when my friend he have only bcdj, it works for him, but when iam in T team and his press this function my hp is still on the same.. And i have z flag... Somebody knows?
Javierko is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-03-2017 , 19:47   Re: Menu item that will make hp of players to full (100)
Reply With Quote #3

nobody can help you if you don't show us your codes
__________________
8guawong is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 12-04-2017 , 00:06   Re: Menu item that will make hp of players to full (100)
Reply With Quote #4

No code = No help
ESK0 is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 12-04-2017 , 10:52   Re: Menu item that will make hp of players to full (100)
Reply With Quote #5

Sorry guys, i forgot it.

PHP Code:
#define DEBUG

#define PLUGIN_NAME           "Menu"
#define PLUGIN_AUTHOR         "Javierko"
#define PLUGIN_DESCRIPTION    "Menu"
#define PLUGIN_VERSION        "1.0"
#define PLUGIN_URL            "hexmania.eu"

#define ITEMDRAW_DISABLED        (1<<0)

#include <sourcemod>
#include <cstrike>

public Plugin:myinfo =
{
    
name PLUGIN_NAME,
    
author PLUGIN_AUTHOR,
    
description PLUGIN_DESCRIPTION,
    
version PLUGIN_VERSION,
    
url PLUGIN_URL
};

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_menu"Command_Menu);
}

public 
Action:Command_Menu(clientargs)
{
  
Menu menu = new Menu(m_themenu);
  
menu.SetTitle("Menu");
    
menu.AddItem("item_1""Set player HP on 100");
  
//menu.ExitButton = true; //This is true by default
  
menu.ExitBackButton false//You need this only if you want to add the "cancel" button to get to the previus menu
  
menu.Display(clientMENU_TIME_FOREVER);
}

public 
int m_themenu(Menu menuMenuAction actionint clientint index)
{
  if(
action == MenuAction_Select)
  {
    
char szItem[12];
    
menu.GetItem(indexszItemsizeof(szItem));
    if(
StrEqual(szItem"item_1"false))
    {
      
SetEntityHealth(CS_TEAM_T100);
    }
  }
  else if(
action == MenuAction_Cancel)
  {
    
//Here you should display the old menu if exist
  
}
  else if(
action == MenuAction_End)
  {
    
delete menu;
  }
  
//You dont to check for this action: MenuCancel_ExitBack

Javierko is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 12-04-2017 , 11:18   Re: Menu item that will make hp of players to full (100)
Reply With Quote #6

Alrighty.

Spoiler
__________________
xines is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 12-04-2017 , 11:29   Re: Menu item that will make hp of players to full (100)
Reply With Quote #7

Ok i will try, thanks
Javierko is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 12-05-2017 , 16:44   Re: Menu item that will make hp of players to full (100)
Reply With Quote #8

Works perfectly, thank you..

Solved
Javierko is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode