Modificare amx_who

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 .
Post Reply
User avatar
nescafezalau
Membru, skill +1
Membru, skill +1
Posts: 220
Joined: 08 Jun 2010, 12:32
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 56 times
Been thanked: 30 times
Contact:

27 Jul 2012, 12:34

As vrea sa-mi modifice cine acest amx_who. Adminii apar sub forma de meniu, de exemplu:
Admini Online:
1. blablalbla - Comisar
2. TRETGEG - Chestor
3. fagfasd - Agent Sef

Problema e ca rangurile nu apar in ordine. Ar putea cineva sa faca sa apara in ordine?
Si inca ceva.. Cand nu sunt admini online, nu apare nimic. Eu as vrea sa apara in hud ceva de genul: Nu sunt admini online. Adica, static const MENU_NAME[ ] = "\r Admini Online";, In loc de admini online sa apara 'Nu sunt admini online', si tot asa, pe orice numar ai apasa, sa iasa din meniu.

Code: Select all

#include <amxmodx>

#pragma semicolon 1


#define MAX_GROUPS 7

new g_groupNames[ MAX_GROUPS ][ ] = {
   
	"Chestor",
	"Comisar Sef",
	"Comisar",
	"Subcomisar",
	"Inspector",
	"Agent Sef Pr",
	"Agent Sef"
};

new g_groupFlags[ MAX_GROUPS ][ ] = {
	
	"abcdefghijklmnopqrstu",
	"bcdefghijkmnopqrsu",
	"bcdefijmnopqru",  
	"bcdefijmnu",
	"bcdefijm",
	"bcdefij",
	"bcdeij"
};

new g_groupFlagsValue[ MAX_GROUPS ];

static const PLUGIN_NAME[ ] 	= "Ultimate Who";
static const PLUGIN_VERSION[ ]	= "1.0";

static const MENU_NAME[ ] = "\r Admini Online";
static const MENU_EXIT_NAME[ ] = "\yIesire^n^n^n\rwww.godplay.ro";

public plugin_init( ) 
{
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, "Askhanar" );
	
	register_clcmd("say /who", "cmdWho", -1, "");
	register_clcmd("say /admins", "cmdWho", -1, "");
	register_concmd("say /admin", "cmdWho", -1, "");
	register_clcmd("say_team /who", "cmdWho", -1, "");
	register_clcmd("say_team /admins", "cmdWho", -1, "");
	register_concmd("say_team /admin", "cmdWho", -1, "");
	
   
	for( new i = 0 ; i < MAX_GROUPS ; i++ )
		g_groupFlagsValue[ i ] = read_flags( g_groupFlags[ i ] );
   
	
}
public cmdWho( id )
{
	ShowMenu( id, 0 );
	return 1;
}
public ShowMenu(id, page)
{
	new MenuName[ 64 ], MenuExitKey[ 32 ];
	new AdminName[ 32 ], AdminMenuMessage[ 32 ][ 64 ],AdminMenuKey[ 32 ][ 32 ], MenuKey = 1;
	formatex( MenuName, sizeof ( MenuName ) -1, "%s", MENU_NAME );
	formatex( MenuExitKey, sizeof ( MenuExitKey ) -1, "%s", MENU_EXIT_NAME );
	new menu = menu_create(MenuName, "ShowMenuHandler");	
		
	static Players[ 32 ], Num, Player;
	get_players( Players, Num, "ch" );

	for( new x = 0 ; x < Num ; x++ ) 
	{   
		Player = Players[ x ];
		for( new i = 0 ; i < MAX_GROUPS ; i++ ) 
		{ 
			if( get_user_flags( Player ) == g_groupFlagsValue[ i ] )
			{
				get_user_name( Player, AdminName, sizeof ( AdminName ) - 1);
				if(Player == id) 
				{
					
					formatex( AdminMenuMessage[ MenuKey ], sizeof ( AdminMenuMessage[ ] ) -1, "\w%s \y- \w%s\r *", AdminName, g_groupNames[ i ] );
				
				}
				else
				{
					
					formatex( AdminMenuMessage[ MenuKey ], sizeof ( AdminMenuMessage[ ] ) -1, "\w%s \y- \w%s", AdminName, g_groupNames[ i ] );
			
				}
				formatex( AdminMenuKey[ MenuKey ], sizeof ( AdminMenuKey[ ] ) -1, "%d", MenuKey );
				MenuKey++;
			}
		}
	}
	
	for( new z = 1 ; z < MenuKey ; z++ )
	{
		
		menu_additem( menu, AdminMenuMessage[ z ], AdminMenuKey[ z ], 0 );
	}
	
	menu_setprop(menu, MPROP_EXITNAME, MenuExitKey );
	
	menu_display(id, menu, page);
}

public ShowMenuHandler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		return 1;
	}
	
	new data[6], iName[64];
	new iaccess, callback;
	
	menu_item_getinfo(menu, item, iaccess, data,5, iName, 63, callback);
	
	new key = str_to_num(data);
	//new page = floatround(str_to_float(data)/7.0001, floatround_floor);
	
	switch(key)
	{
		case 1,2,3,4,5,6,7:
		{
			//ShowMenu( id, page );
			return 1;
		}
	}
	return 0;
}
Image
Muzica nu zgomot!
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2054
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1131 times
Contact:

27 Jul 2012, 13:20

am sa il modific.. mai incolo daca am cv timp.. ca mi-au ramas un plugin de surfxp si inca alte 4 de facut..
si sa sti ica e cv de munca la faza cu 'in ordine' ( tre sa iau fiecare rang in parte.. in fine )

LE: acum e pus sa iasa pe orice tasta apesi.. ori nu iese ?
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
Andrei.B
Fost administrator
Fost administrator
Posts: 6481
Joined: 17 Aug 2009, 08:15
Detinator Steam: Da
CS Status: Plecat pe mari si tari
Detinator server CS: Nu detin !
SteamID: andreybci94
Reputatie: Fost Membru Club eXtreamCS (o luna)
Fost Administrator
Nume anterior : bLack, Andrei,krusc
Contribuitor
Location: ConstanTa
Has thanked: 275 times
Been thanked: 556 times
Contact:

27 Jul 2012, 13:32

Pai ai folosit cvar-urile ? vad ca e ultimate who nu e amx_who

http://www.extreamcs.com/forum/pluginur ... 31778.html

Mereu in suflet culorile ( Roş -Albastru )
Image
ImageImage
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2054
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1131 times
Contact:

27 Jul 2012, 14:09

Krusc wrote:Pai ai folosit cvar-urile ? vad ca e ultimate who nu e amx_who

http://www.extreamcs.com/forum/pluginur ... 31778.html
ala e ultimate who. . facut de mine adica asa mi-a venit pe moment sa`i pun numele..
nu e ultimate who lui p.of.pw .. nici macar 1 linie nu se aseamana..

btw poftim desi nu meritai.. 'geniule' ( m-ai enervat urat pe steam )
Ultimate Who Menu Version | Afiseaza codul
#include <amxmodx>

#pragma semicolon 1


#define MAX_GROUPS 7

new g_groupNames[ MAX_GROUPS][ ] = {
	
	"Chestor",
	"Comisar Sef",
	"Comisar",
	"Subcomisar",
	"Inspector",
	"Agent Sef Pr",
	"Agent Sef"
};

new g_groupFlags[ MAX_GROUPS ][ ] = {
	
	"abcdefghijklmnopqrstu",
	"bcdefghijkmnopqrsu",
	"bcdefijmnopqru", 
	"bcdefijmnu",
	"bcdefijm",
	"bcdefij",
	"bcdeij"
};

new g_groupFlagsValue[ MAX_GROUPS ];

static const PLUGIN_NAME[ ]    = "Ultimate Who";
static const PLUGIN_VERSION[ ]   = "2.0";

static const MENU_NAME[ ] = "\r Admini Online";
static const NO_ADMINS_MENU_NAME[ ] = "\y Nu sunt admini online";
static const MENU_EXIT_NAME[ ] = "\yIesire^n^n^n\rwww.godplay.ro";


public plugin_init( )
{
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, "Askhanar" );
	
	register_clcmd("say /who", "cmdWho", -1, "");
	register_clcmd("say /admins", "cmdWho", -1, "");
	register_concmd("say /admin", "cmdWho", -1, "");
	register_clcmd("say_team /who", "cmdWho", -1, "");
	register_clcmd("say_team /admins", "cmdWho", -1, "");
	register_concmd("say_team /admin", "cmdWho", -1, "");
	
	
	for( new i = 0 ; i < MAX_GROUPS ; i++ )
		g_groupFlagsValue[ i ] = read_flags( g_groupFlags[ i ] );
	
	
}
public cmdWho( id )
{
	ShowMenu( id, 0 );
	return 1;
}

public ShowMenu(id, page)
{
	new MenuName[ 64 ], MenuExitKey[ 32 ];
	
	formatex( MenuName, sizeof ( MenuName ) -1, "%s",  MENU_NAME );

	formatex( MenuExitKey, sizeof ( MenuExitKey ) -1, "%s", MENU_EXIT_NAME );
	
	new menu = menu_create(MenuName, "ShowMenuHandler");   
	
	if( AdminsOnline(    )  )
	{
		
		for( new i = 0; i < MAX_GROUPS; i++  )
		{
			AddAdminsToMenu( id, menu, i );
		}
	}
	else
	{
		menu_additem( menu, NO_ADMINS_MENU_NAME, "1", 0 );
	}
	
	menu_setprop(menu, MPROP_EXITNAME, MenuExitKey );
	
	menu_display(id, menu, page);
}

public ShowMenuHandler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy( menu );
		return 1;
	}
	
	new data[6], iName[64];
	new iaccess, callback;
	
	menu_item_getinfo(menu, item, iaccess, data,5, iName, 63, callback);
	
	new key = str_to_num(data);
	
	switch(key)
	{
		case 1,2,3,4,5,6,7:
		{
			menu_destroy( menu );
			return 1;
		}
	}
	
	return 0;
}

public AddAdminsToMenu( const id, const menu,  const group  )
{
	
	new AdminMenuMessage[ 32 ][ 64 ],AdminMenuKey[ 32 ][ 32 ], MenuKey = 1;
	
	static Players[ 32 ], Num, Player;
	get_players( Players, Num, "ch" );
	
	for( new x = 0 ; x < Num ; x++ )
	{   
		Player = Players[ x ];
		if( get_user_flags( Player ) == g_groupFlagsValue[ group ] )
		{

			formatex( AdminMenuMessage[ MenuKey ], sizeof ( AdminMenuMessage[ ] ) -1, "\w%s \y- \w%s%s",
				get_name( Player ), g_groupNames[ group ], Player == id ? "\r *" : "" );
				
			formatex( AdminMenuKey[ MenuKey ], sizeof ( AdminMenuKey[ ] ) -1, "%d", MenuKey );
			
			MenuKey++;
		}
	}
	
	for( new z = 1 ; z < MenuKey ; z++ )
	{
		
		menu_additem( menu, AdminMenuMessage[ z ], AdminMenuKey[ z ], 0 );
	}
	
}
	
stock bool:AdminsOnline(    )
{
	new bool:AdminsFound = false;
	
	static Players[ 32 ], Num, Player;
	get_players( Players, Num, "ch" );
	
	for( new x = 0 ; x < Num ; x++ )
	{   
		Player = Players[ x ];
		for( new i = 0 ; i < MAX_GROUPS ; i++ )
		{
			if( AdminsFound ) break;
			if( get_user_flags( Player ) == g_groupFlagsValue[ i ] )
			{
				AdminsFound = true;
			}
		}
	}
	
	return AdminsFound ? true : false;
}

stock get_name( id )
{
	
	new name[ 32 ];
	get_user_name( id, name, sizeof ( name ) -1 );

	return name;
}]
LE: poza din semnatura cred ca ti se potriveste =))
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
nescafezalau
Membru, skill +1
Membru, skill +1
Posts: 220
Joined: 08 Jun 2010, 12:32
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 56 times
Been thanked: 30 times
Contact:

27 Jul 2012, 15:18

Mersi, cred ca o sa pun un amx_Who in motd:)
Image
Muzica nu zgomot!
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2054
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1131 times
Contact:

27 Jul 2012, 15:20

nescafezalau wrote:Mersi, cred ca o sa pun un amx_Who in motd:)
noroc cu amx_Who in motd:) ( toate sunt pline de buguri ).
btw nu-mi faci in ciuda :P
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
nescafezalau
Membru, skill +1
Membru, skill +1
Posts: 220
Joined: 08 Jun 2010, 12:32
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 56 times
Been thanked: 30 times
Contact:

27 Jul 2012, 15:37

O sa incerc sa fac eu unul.
Image
Muzica nu zgomot!
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests