Cerere meniu deathrun.

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
User avatar
kabeza
Membru, skill +2
Membru, skill +2
Posts: 774
Joined: 09 Dec 2012, 19:30
Detinator Steam: Da
Has thanked: 76 times
Been thanked: 23 times

10 Dec 2012, 21:37

Am facut eu :
| Afiseaza codul
[code]#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include < hamsandwich >

#define KEYS (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<9)

new const god [ ] = "abcdefghijklmnopqrstu"

new names [ 32 ];

public plugin_init() 
{
    register_plugin("DR Menu Terro", "1.0", "Unhask")
    
    register_menucmd(register_menuid("MENU"), KEYS, "terro_menu");

    RegisterHam(Ham_Spawn, "player", "ShowMenu", 1)
}

public ShowMenu(id)
{
    if ( ! is_user_alive(id) ) 
        return 1;
    
    new Menu[1024], i;
    
    if ( cs_get_user_team(id) == CS_TEAM_T )
    {
        i = formatex(Menu, 1023, "DeathRun Menu^n^n");

        i += formatex(Menu, 1023-i, "\r1.\w M4A1 + Deagle + 250 HP^n");
        i += formatex(Menu, 1023-i, "\r2.\w AK47 + Deagle + 250 HP^n");
        i += formatex(Menu, 1023-i, "\r3.\w 5000 HP^n");
        i += formatex(Menu, 1023-i, "\r4.\w Invizibilitate 100%^n^n"); 
        i += formatex(Menu, 1023-i, "\r5.\w Arma \yGod Only ^n^n\r0. \wExit");

        show_menu(id, KEYS, Menu, -1, "MENU");
    }

    return 0;
}

public terro_menu( id, key )
{
    if ( !is_user_alive( id ) ) 
        return 1;
   
    switch( key )
    {
        case 0:
        {
      get_user_name ( id, names, 31 )
      client_print ( 0, print_chat, "[%s] a ales optiunea M4A1 + Deagle + 250 HP" );
      
      give_item(id, "weapon_m4a1");
      cs_set_user_bpammo(id, CSW_M4A1, 90);
      
      give_item(id, "weapon_deagle");
      cs_set_user_bpammo(id, CSW_DEAGLE, 35);
            
      set_user_health(id, 250);
            
      return 1;
        }
        case 1:
        {
      get_user_name ( id, names, 31 )
      client_print ( 0, print_chat, "[%s] a ales optiunea AK47 + Deagle + 250 HP" );
      give_item(id, "weapon_ak47");
      cs_set_user_bpammo(id, CSW_AK47, 90);
            
      give_item(id, "weapon_deagle");
      cs_set_user_bpammo(id, CSW_DEAGLE, 35);
      
      set_user_health(id, 250);
            
      return 1;
        }
        case 2:
        {
      get_user_name ( id, names, 31 )
      client_print ( 0, print_chat, "[%s] a ales optiunea 5000 HP" );
      set_user_health(id, 5000);
      return 1;
        }
        case 3:
        {
      get_user_name ( id, names, 31 )
      client_print ( 0, print_chat, "[%s] a ales Invizibilitate 100" );
      set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 100 )
      return 1;
        }  
        case 4: 
        { 
      new flags = read_flags(god)
            
      if(!(get_user_flags(id) & flags) )
      client_print ( id, print_chat, "Nu ai access la aceasta optiune!" );
      //  return 1;
                
      get_user_name ( id, names, 31 )
      client_print ( 0, print_chat, "[%s] a ales optiunea 5 Arma + God Only" );
      
      give_item(id, "weapon_m249");
      cs_set_user_bpammo(id, CSW_M249, 200);
            
      give_item(id, "weapon_deagle");
      cs_set_user_bpammo(id, CSW_DEAGLE, 35);
            
      set_user_health(id, 500);
   }
   }
   return 1;
}
[/code]


Ma anunti in caz ca nu functioneaza.
CLICK & JOIN!
Image
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

11 Dec 2012, 11:52

Multuesc , dar nu merge , cand aleg nu imi da nimic si nu zice nimic in chat , si cand apas 5 zice ca nu am acces , si cand apas 0 sau aleg 5 "arma god only" sa nu dispara si sa apara imediat la loc meniul sa aleg.
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

12 Dec 2012, 10:34

Uppp !!!
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

13 Dec 2012, 19:06

Up , imi mai faceti?
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
User avatar
kabeza
Membru, skill +2
Membru, skill +2
Posts: 774
Joined: 09 Dec 2012, 19:30
Detinator Steam: Da
Has thanked: 76 times
Been thanked: 23 times

13 Dec 2012, 20:14

Ti`l fac mai pe seara.
Revin cu Edit. +1 daca te`am ajutat cu ceva :*
CLICK & JOIN!
Image
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 152 times

13 Dec 2012, 20:24

| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>

new g_MaxPlayers;

const iHealth = 5000;
new const g_Flags[] = "a";

#define IsPlayer(%1) (1 <= %1 <= g_MaxPlayers)

new const g_Items[][] =
{
	"weapon_deagle",
	"weapon_m4a1",
	"weapon_ak47"
};

new g_Menu;

public plugin_init()
{
	register_plugin("T menu", "1.0", "compaq");
	RegisterHam(Ham_Spawn, "player", "fw_playerspawned", 1);

	g_MaxPlayers = get_maxplayers();
}

public fw_playerspawned(id)
{
	if (!IsPlayer(id) || !is_user_connected(id))
		return HAM_SUPERCEDE;

	set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25);

	if (cs_get_user_team(id) == CS_TEAM_T)
	{
		g_Menu = menu_create("Alege un cadou:", "MENU_HANDLER");

		menu_additem(g_Menu, "Invizibilitate", "1", 0);
		menu_additem(g_Menu, "5000 hp", "2", 0);
		menu_additem(g_Menu, "m4a1 + deagle + 250hp", "3", 0);
		menu_additem(g_Menu, "ak47 + deagle + 250hp", "4", 0);
		menu_additem(g_Menu, "Arma god only", "5", 0);

		menu_setprop(g_Menu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, g_Menu, 0);
	}

	return HAM_IGNORED;
}

public MENU_HANDLER(id, g_Menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_Menu);
		return 1;
	}

	new data[6], name[64];
	new access, callback;

	menu_item_getinfo(g_Menu, item, access, data, 5, name, 63, callback);

	switch (str_to_num(data))
	{
		case 1:
		{
			set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 10);
		}

		case 2:
		{
			set_user_health(id, iHealth);
		}

		case 3:
		{
			give_item(id, g_Items[0]);
			give_item(id, g_Items[1]);
			set_user_health(id, 250);
		}

		case 4:
		{
			give_item(id, g_Items[0]);
			give_item(id, g_Items[2]);
			set_user_health(id, 250);
		}

		case 5:
		{
			if ((get_user_flags(id) == read_flags(g_Flags)))
			{
				give_item(id, "weapon_m249");
				give_item(id, g_Items[0]);
				set_user_health(id, 500);
			}
		}
	}

	menu_destroy(g_Menu);
	return 1;
}
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

14 Dec 2012, 23:12

Mersi compq , dar nu este chiar ceea ce vreau , vreau sa le pui munitie full , Mesaj in chat % A ales m4a1.. (colorat daca se poate) , si cand dai pe 0 sa apara iar meni-ul , cand nu ai acces la arma god only sa zica Nu ai acces la aceasta comanda.
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 152 times

15 Dec 2012, 12:12

| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>

new g_MaxPlayers;

const iHealth = 5000;
new const g_Flags[] = "a";

#define IsPlayer(%1) (1 <= %1 <= g_MaxPlayers)

new const g_Items[][] =
{
	"weapon_deagle",
	"weapon_m4a1",
	"weapon_ak47"
};

new g_Menu;

enum Color
{
	NORMAL = 1, // clients scr_concolor cvar color
	GREEN, // Green Color
	TEAM_COLOR, // Red, grey, blue
	GREY, // grey
	RED, // Red
	BLUE, // Blue
}

new const TeamName[][] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}

public plugin_init()
{
	register_plugin("T menu", "1.0", "compaq");
	RegisterHam(Ham_Spawn, "player", "fw_playerspawned", 1);
	register_clcmd("showmenu", "fw_playerspawned");

	g_MaxPlayers = get_maxplayers();
}

public client_putinserver(id)
{
	set_task(2.0, "exec", id);
}

public exec(id)
{
	if (IsPlayer(id) && is_user_connected(id))
		client_cmd(id, "bind 0 showmenu");
}

public fw_playerspawned(id)
{
	if (!IsPlayer(id) || !is_user_connected(id))
		return HAM_SUPERCEDE;

	set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25);

	if (cs_get_user_team(id) == CS_TEAM_T)
	{
		g_Menu = menu_create("Alege un cadou:", "MENU_HANDLER");

		menu_additem(g_Menu, "Invizibilitate", "1", 0);
		menu_additem(g_Menu, "5000 hp", "2", 0);
		menu_additem(g_Menu, "m4a1 + deagle + 250hp", "3", 0);
		menu_additem(g_Menu, "ak47 + deagle + 250hp", "4", 0);
		menu_additem(g_Menu, "Arma god only", "5", 0);

		menu_setprop(g_Menu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, g_Menu, 0);
	}

	return HAM_IGNORED;
}

public MENU_HANDLER(id, g_Menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_Menu);
		return 1;
	}

	new data[6], name[64], szName[33];
	new access, callback;

	menu_item_getinfo(g_Menu, item, access, data, 5, name, 63, callback);
	get_user_name (id, szName, charsmax(szName));

	switch (str_to_num(data))
	{
		case 1:
		{
			set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 10);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales invizibilitate.", szName);
		}

		case 2:
		{
			set_user_health(id, iHealth);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales viata 6000.", szName);
		}

		case 3:
		{
			give_item(id, g_Items[0]);
			give_item(id, g_Items[1]);
			set_user_health(id, 250);
			cs_set_user_bpammo(id, CSW_M4A1, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales M4A1 + deagle.", szName);
		}

		case 4:
		{
			give_item(id, g_Items[0]);
			give_item(id, g_Items[2]);
			set_user_health(id, 250);
			cs_set_user_bpammo(id, CSW_AK47, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales AK47 + deagle.", szName);
		}

		case 5:
		{
			if ((get_user_flags(id) == read_flags(g_Flags)))
			{
				give_item(id, "weapon_m249");
				give_item(id, g_Items[0]);
				set_user_health(id, 500);
				cs_set_user_bpammo(id, CSW_M249, 200);
				ColorChat(0, GREEN, "^x04%s ^x01 a ales arma god only.", szName);
			}

			else
			{
				client_print(id, print_chat, "Nu ai acces la aceasta comanda.");
			}
		}
	}

	menu_destroy(g_Menu);
	return 1;
}

ColorChat(id, Color:type, const msg[], any:...)
{
	new message[256];

	switch(type)
	{
		case NORMAL: // clients scr_concolor cvar color
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';

	new team, ColorChange, index, MSG_Type;
	
	if(id)
	{
		MSG_Type = MSG_ONE_UNRELIABLE;
		index = id;
	} else {
		index = FindPlayer();
		MSG_Type = MSG_BROADCAST;
	}
	
	team = get_user_team(index);
	ColorChange = ColorSelection(index, MSG_Type, type);

	ShowColorMessage(index, MSG_Type, message);
		
	if(ColorChange)
	{
		Team_Info(index, MSG_Type, TeamName[team]);
	}
}

ShowColorMessage(id, type, message[])
{
	static msgSayText;
	if(!msgSayText)
	{
		msgSayText = get_user_msgid("SayText");
	}
	message_begin(type, msgSayText, _, id);
	write_byte(id)		
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[])
{
	static msgTeamInfo;
	if(!msgTeamInfo)
	{
		msgTeamInfo = get_user_msgid("TeamInfo");
	}
	message_begin(type, msgTeamInfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

ColorSelection(index, type, Color:Type)
{
	switch(Type)
	{
		case RED:
		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:
		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:
		{
			return Team_Info(index, type, TeamName[0]);
		}
	}

	return 0;
}

FindPlayer()
{
	new i = -1;

	while(i <= get_maxplayers())
	{
		if(is_user_connected(++i))
			return i;
	}

	return -1;
}
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

19 Dec 2012, 21:41

Multumesc compq , dar este o problema , cand nu am acces si aleg 5 imi zice "Nu ai acces la acesta optiune"-este ok dar nu mai apare din nou meniul , poti rezolva?
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 152 times

20 Dec 2012, 14:08

| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>

new g_MaxPlayers;

const iHealth = 5000;
new const g_Flags[] = "a";

#define IsPlayer(%1) (1 <= %1 <= g_MaxPlayers)

new const g_Items[][] =
{
	"weapon_deagle",
	"weapon_m4a1",
	"weapon_ak47"
};

new g_Menu;

enum Color
{
	NORMAL = 1, // clients scr_concolor cvar color
	GREEN, // Green Color
	TEAM_COLOR, // Red, grey, blue
	GREY, // grey
	RED, // Red
	BLUE, // Blue
}

new const TeamName[][] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}

public plugin_init()
{
	register_plugin("T menu", "1.0", "compaq");
	RegisterHam(Ham_Spawn, "player", "fw_playerspawned", 1);
	register_clcmd("showmenu", "fw_playerspawned");

	g_MaxPlayers = get_maxplayers();
}

public client_putinserver(id)
{
	set_task(2.0, "exec", id);
}

public exec(id)
{
	if (IsPlayer(id) && is_user_connected(id))
		client_cmd(id, "bind 0 showmenu");
}

public fw_playerspawned(id)
{
	if (!IsPlayer(id) || !is_user_connected(id))
		return HAM_SUPERCEDE;

	set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25);

	if (cs_get_user_team(id) == CS_TEAM_T)
	{
		g_Menu = menu_create("Alege un cadou:", "MENU_HANDLER");

		menu_additem(g_Menu, "Invizibilitate", "1", 0);
		menu_additem(g_Menu, "5000 hp", "2", 0);
		menu_additem(g_Menu, "m4a1 + deagle + 250hp", "3", 0);
		menu_additem(g_Menu, "ak47 + deagle + 250hp", "4", 0);
		menu_additem(g_Menu, "Arma god only", "5", 0);

		menu_setprop(g_Menu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, g_Menu, 0);
	}

	return HAM_IGNORED;
}

public MENU_HANDLER(id, g_Menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_Menu);
		return 1;
	}

	new data[6], name[64], szName[33];
	new access, callback, ok = 1;

	menu_item_getinfo(g_Menu, item, access, data, 5, name, 63, callback);
	get_user_name (id, szName, charsmax(szName));

	switch (str_to_num(data))
	{
		case 1:
		{
			set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 10);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales invizibilitate.", szName);
		}

		case 2:
		{
			set_user_health(id, iHealth);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales viata 6000.", szName);
		}

		case 3:
		{
			give_item(id, g_Items[0]);
			give_item(id, g_Items[1]);
			set_user_health(id, 250);
			cs_set_user_bpammo(id, CSW_M4A1, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales M4A1 + deagle.", szName);
		}

		case 4:
		{
			give_item(id, g_Items[0]);
			give_item(id, g_Items[2]);
			set_user_health(id, 250);
			cs_set_user_bpammo(id, CSW_AK47, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales AK47 + deagle.", szName);
		}

		case 5:
		{
			if ((get_user_flags(id) == read_flags(g_Flags)))
			{
				give_item(id, "weapon_m249");
				give_item(id, g_Items[0]);
				set_user_health(id, 500);
				cs_set_user_bpammo(id, CSW_M249, 200);
				ColorChat(0, GREEN, "^x04%s ^x01 a ales arma god only.", szName);
			}

			else
			{
				client_print(id, print_chat, "Nu ai acces la aceasta comanda.");
				menu_display(id, g_Menu, 0);
				ok = 0;
			}
		}
	}

	menu_destroy(g_Menu);

	if(!ok)
		menu_display(id, g_Menu, 0);

	else return 1;

	return 0;
}

ColorChat(id, Color:type, const msg[], any:...)
{
	new message[256];

	switch(type)
	{
		case NORMAL: // clients scr_concolor cvar color
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';

	new team, ColorChange, index, MSG_Type;
	
	if(id)
	{
		MSG_Type = MSG_ONE_UNRELIABLE;
		index = id;
	} else {
		index = FindPlayer();
		MSG_Type = MSG_BROADCAST;
	}
	
	team = get_user_team(index);
	ColorChange = ColorSelection(index, MSG_Type, type);

	ShowColorMessage(index, MSG_Type, message);
		
	if(ColorChange)
	{
		Team_Info(index, MSG_Type, TeamName[team]);
	}
}

ShowColorMessage(id, type, message[])
{
	static msgSayText;
	if(!msgSayText)
	{
		msgSayText = get_user_msgid("SayText");
	}
	message_begin(type, msgSayText, _, id);
	write_byte(id)		
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[])
{
	static msgTeamInfo;
	if(!msgTeamInfo)
	{
		msgTeamInfo = get_user_msgid("TeamInfo");
	}
	message_begin(type, msgTeamInfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

ColorSelection(index, type, Color:Type)
{
	switch(Type)
	{
		case RED:
		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:
		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:
		{
			return Team_Info(index, type, TeamName[0]);
		}
	}

	return 0;
}

FindPlayer()
{
	new i = -1;

	while(i <= get_maxplayers())
	{
		if(is_user_connected(++i))
			return i;
	}

	return -1;
}
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

20 Dec 2012, 17:08

Multumesc , poti face cand alegi 5 sa-ti dea si munitie full la deagle , si cand dau de 2 ori pe 5 zice ca nu am acces si dispare , poti face sa apara la loc indiferent de cate ori dau?
Stiu ca cer multe dar daca poti face..
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 152 times

20 Dec 2012, 17:30

| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>

new g_MaxPlayers;

const iHealth = 5000;
new const g_Flags[] = "a";

#define IsPlayer(%1) (1 <= %1 <= g_MaxPlayers)

new const g_Items[][] =
{
	"weapon_deagle",
	"weapon_m4a1",
	"weapon_ak47"
};

new g_Menu;

enum Color
{
	NORMAL = 1, // clients scr_concolor cvar color
	GREEN, // Green Color
	TEAM_COLOR, // Red, grey, blue
	GREY, // grey
	RED, // Red
	BLUE, // Blue
}

new const TeamName[][] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}

public plugin_init()
{
	register_plugin("T menu", "1.0", "compaq");
	RegisterHam(Ham_Spawn, "player", "fw_playerspawned", 1);
	register_clcmd("showmenu", "fw_playerspawned");

	g_MaxPlayers = get_maxplayers();
}

public client_putinserver(id)
{
	set_task(2.0, "exec", id);
}

public exec(id)
{
	if (IsPlayer(id) && is_user_connected(id))
		client_cmd(id, "bind 0 showmenu");
}

public fw_playerspawned(id)
{
	if (!IsPlayer(id) || !is_user_connected(id))
		return HAM_SUPERCEDE;

	set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25);

	if (cs_get_user_team(id) == CS_TEAM_T)
	{
		g_Menu = menu_create("Alege un cadou:", "MENU_HANDLER");

		menu_additem(g_Menu, "Invizibilitate", "1", 0);
		menu_additem(g_Menu, "5000 hp", "2", 0);
		menu_additem(g_Menu, "m4a1 + deagle + 250hp", "3", 0);
		menu_additem(g_Menu, "ak47 + deagle + 250hp", "4", 0);
		menu_additem(g_Menu, "Arma god only", "5", 0);

		menu_setprop(g_Menu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, g_Menu, 0);
	}

	return HAM_IGNORED;
}

public MENU_HANDLER(id, g_Menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_Menu);
		return 1;
	}

	new data[6], name[64], szName[33];
	new access, callback, ok = 1;

	menu_item_getinfo(g_Menu, item, access, data, 5, name, 63, callback);
	get_user_name (id, szName, charsmax(szName));

	switch (str_to_num(data))
	{
		case 1:
		{
			set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 10);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales invizibilitate.", szName);
		}

		case 2:
		{
			set_user_health(id, iHealth);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales viata 6000.", szName);
		}

		case 3:
		{
			give_item(id, g_Items[0]);
			give_item(id, g_Items[1]);
			set_user_health(id, 250);
			cs_set_user_bpammo(id, CSW_M4A1, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales M4A1 + deagle.", szName);
		}

		case 4:
		{
			give_item(id, g_Items[0]);
			give_item(id, g_Items[2]);
			set_user_health(id, 250);
			cs_set_user_bpammo(id, CSW_AK47, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(0, GREEN, "^x04%s ^x01 a ales AK47 + deagle.", szName);
		}

		case 5:
		{
			if ((get_user_flags(id) == read_flags(g_Flags)))
			{
				give_item(id, "weapon_m249");
				give_item(id, g_Items[0]);
				set_user_health(id, 500);
				cs_set_user_bpammo(id, CSW_M249, 200);
				cs_set_user_bpammo(id, CSW_DEAGLE, 35);
				ColorChat(0, GREEN, "^x04%s ^x01 a ales arma god only.", szName);
			}

			else
			{
				client_print(id, print_chat, "Nu ai acces la aceasta comanda.");
				ok = 0;
			}
		}
	}

	menu_destroy(g_Menu);

	if(!ok)
	{
		menu_display(id, g_Menu, 0);
		ok = 1;
	}

	else return 1;

	return 0;
}

ColorChat(id, Color:type, const msg[], any:...)
{
	new message[256];

	switch(type)
	{
		case NORMAL: // clients scr_concolor cvar color
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';

	new team, ColorChange, index, MSG_Type;
	
	if(id)
	{
		MSG_Type = MSG_ONE_UNRELIABLE;
		index = id;
	} else {
		index = FindPlayer();
		MSG_Type = MSG_BROADCAST;
	}
	
	team = get_user_team(index);
	ColorChange = ColorSelection(index, MSG_Type, type);

	ShowColorMessage(index, MSG_Type, message);
		
	if(ColorChange)
	{
		Team_Info(index, MSG_Type, TeamName[team]);
	}
}

ShowColorMessage(id, type, message[])
{
	static msgSayText;
	if(!msgSayText)
	{
		msgSayText = get_user_msgid("SayText");
	}
	message_begin(type, msgSayText, _, id);
	write_byte(id)		
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[])
{
	static msgTeamInfo;
	if(!msgTeamInfo)
	{
		msgTeamInfo = get_user_msgid("TeamInfo");
	}
	message_begin(type, msgTeamInfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

ColorSelection(index, type, Color:Type)
{
	switch(Type)
	{
		case RED:
		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:
		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:
		{
			return Team_Info(index, type, TeamName[0]);
		}
	}

	return 0;
}

FindPlayer()
{
	new i = -1;

	while(i <= get_maxplayers())
	{
		if(is_user_connected(++i))
			return i;
	}

	return -1;
}
Locked

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 17 guests