[New] Preturi admine HUD (22.11.2013)

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

05 Apr 2013, 14:34

Descriere: Cu acest plugin puteti vedea preturiile adminelor intr-un mod mai nou si frumos. ( zic eu .. )

Descarcare: SendSpace

Nume: Preturi admine - HUD
Versiune: 1.0
Varianta optimizata de Askhanar:
| Afiseaza codul
/*

- Ei bine, m-am gandit ca multi vor sa afiseze in modul acesta preturiile adminelor.

- Credite: eNd. | Pentru modul de inregistrare comenzi in plugin_init( )

*/

#include < amxmodx >

#define PLUGIN_NAME "Pret Admine - HUD"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "UspStyLe"


new const g_szMenuName[ ] = "\yPreturiile serverului \rCS.CS.RO";
new g_szGradeSiPreturi[ ][ ] =
{
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\yPentru cumparare:^n",
	"\yY!M: \rbulanica.cs"
}

new g_szClCmds[ ][ ] =
{
	"say /preturi",
	"say /buyadmin"
}

new g_iMenu;

public plugin_init( )
{
	// Register plugin
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR )
	
	// Register Chat Commands
	
	for( new i = 0;i < sizeof ( g_szClCmds ); i++ )
		register_clcmd( g_szClCmds[ i ], "pret_admine" )
		
	// Construim meniu o singura data.. nu la fiecare comanda.
	BuildMenu( );
}

BuildMenu( )
{
	g_iMenu = menu_create( g_szMenuName, "preturi_admine_handler" );
	new szKey[ 3 ];
	
	for( new i = 0; i < sizeof ( g_szGradeSiPreturi ); i++ )
	{
		// Cu asta transform integerul i in string.. facandu`l din 1 in "1"
		num_to_str( i + 1, szKey, sizeof ( szKey ) -1 );
		menu_additem( g_iMenu, g_szGradeSiPreturi[ i ], szKey, 0 );
	}
	
	menu_setprop( g_iMenu, MPROP_EXIT, MEXIT_ALL )
	
}
public pret_admine( id )
{
	// Acum doar ii aratam meniul.. nu il mai si construim.
	menu_display( id, g_iMenu, 0 );
}

public preturi_admine_handler( id, menu, item ) 
{
	if( item == MENU_EXIT )
	{
		menu_destroy( menu )
		return PLUGIN_HANDLED;
	}
	
	new data[ 6 ], szName[ 64 ];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback)
	new key = str_to_num( data ) 
	switch(key)
	{
		case 1..11: return PLUGIN_HANDLED
		}
	menu_destroy( menu )
	return PLUGIN_HANDLED
}
Credite:

Code: Select all

eNd. | Pentru modul de inregistrare comenzi in plugin_init( )
Sursa:
.SMA | Afiseaza codul
/*

			- Ei bine, m-am gandit ca multi vor sa afiseze in modul acesta preturiile adminelor.
			
			- Credite: eNd. | Pentru modul de inregistrare comenzi in plugin_init( )
			
*/

#include < amxmodx >
#include < amxmisc >

#define PLUGIN_NAME "Pret Admine - HUD"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "UspStyLe"

new sz_gCMD[ ][ ] =
{
	"say /preturi",
	"say /buyadmin"
}

public plugin_init( )
{
	// Register plugin
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR )
	
	// Register Chat Commands
	
	for ( new i=0;i < sizeof sz_gCMD; i++ )
		register_clcmd( sz_gCMD, "pret_admine" )
}
public pret_admine( id )
{
	new menu = menu_create("\yPreturiile serverului \rCS.CS.RO", "preturi_admine_handler" )  
	menu_additem( menu, "\rNume Grad - \wPret Grad", "1", 0 )
	menu_additem( menu, "\rNume Grad - \wPret Grad", "2", 0 )
	menu_additem( menu, "\rNume Grad - \wPret Grad", "3", 0 )	
	menu_additem( menu, "\rNume Grad - \wPret Grad", "4", 0 )	
	menu_additem( menu, "\yPentru cumparare:^n", "5", 0 )
	menu_additem( menu, "\yY!M: \rbulanica.cs", "6", 0 )	
	menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
	menu_display( id, menu, 0 )
}
public preturi_admine_handler( id, menu, item ) 
{
    if( item == MENU_EXIT )
	{
		menu_destroy( menu )
		return PLUGIN_HANDLED
	}
    new data[ 6 ], szName[ 64 ]
    new access, callback
    menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback)
    new key = str_to_num( data ) 
    switch(key)
    {
		case 1..11: return PLUGIN_HANDLED
	}
    menu_destroy( menu )
    return PLUGIN_HANDLED
}


Instalare:
1. Fisierul preturi_admin_new_hud.sma il puneti in addons/amxmodx/scripting
2. Fisierul preturi_admin_new_hud.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

preturi_admin_new_hud.amxx
4. Alti pasi necesari....

Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • /preturi - afiseaza preturiile adminelor
    /buyadmin - afiseaza preturiile adminelor
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- Nu contine ..

Imagini:
| Afiseaza codul
Image
Last edited by munir on 05 Apr 2013, 15:31, edited 3 times in total.
Retras
RoyalServer 2
User avatar
Ulquiorra
Fost moderator
Fost moderator
Posts: 2053
Joined: 25 Jul 2010, 17: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: Fost Scripter eXtreamCS
Fost Moderator ajutator
Nick anterior: Askhanar
Location: Braila, Romania.
Has thanked: 215 times
Been thanked: 1132 times

05 Apr 2013, 14:47

Code: Select all

switch(key)
    {
		case 1:
		{
			return PLUGIN_HANDLED
		}
		case 2:
		{
			return PLUGIN_HANDLED
		}
		case 3:
		{
			return PLUGIN_HANDLED
		}
		case 4:
		{
			return PLUGIN_HANDLED
		}
		case 5:
		{
			return PLUGIN_HANDLED
		}
		case 6:
		{
			return PLUGIN_HANDLED
		}
		case 7:
		{
			return PLUGIN_HANDLED
		}
		case 8:
		{
			return PLUGIN_HANDLED
		}
		case 9:
		{
			return PLUGIN_HANDLED
		}
		case 10:
		{		
			return PLUGIN_HANDLED
		}
		case 11:
		{
			return PLUGIN_HANDLED
		}
	}
-->

Code: Select all


switch( key )
	case 1..20:	return PLUGIN_HANDLED;
btw nu ai nevoie de amxmisc, dar stai lin ca el e singurul modul care nu este incarcat daca nu a fost folosita nicio functie 'de-a lui' .
Last edited by Ulquiorra on 05 Apr 2013, 14:50, edited 1 time in total.
Caut o persoana dedicata care se pricepe si stie ce face.
Vreau sa creeze si sa se ocupe de administrarea unui server de MU, da e vorba de vechiul joc..ma gandesc undeva la un season 3 ep1/2.

O sa achizitionez un domeniu .ro.
Totodata sponsorizez absolut orice este necesar.
Ma puteti contacta prin: http://solo.to/stfrzv
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

05 Apr 2013, 14:49

Askhanar wrote:

Code: Select all

switch(key)
    {
		case 1:
		{
			return PLUGIN_HANDLED
		}
		case 2:
		{
			return PLUGIN_HANDLED
		}
		case 3:
		{
			return PLUGIN_HANDLED
		}
		case 4:
		{
			return PLUGIN_HANDLED
		}
		case 5:
		{
			return PLUGIN_HANDLED
		}
		case 6:
		{
			return PLUGIN_HANDLED
		}
		case 7:
		{
			return PLUGIN_HANDLED
		}
		case 8:
		{
			return PLUGIN_HANDLED
		}
		case 9:
		{
			return PLUGIN_HANDLED
		}
		case 10:
		{		
			return PLUGIN_HANDLED
		}
		case 11:
		{
			return PLUGIN_HANDLED
		}
	}
-->

Code: Select all


switch( key )
	case 1..20:	return PLUGIN_HANDLED;
Pff, chiar am nevoie de optimizari. Ma gandesc cum sa urc fiecare grad si pret in constante .. :D.
Retras
User avatar
Ulquiorra
Fost moderator
Fost moderator
Posts: 2053
Joined: 25 Jul 2010, 17: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: Fost Scripter eXtreamCS
Fost Moderator ajutator
Nick anterior: Askhanar
Location: Braila, Romania.
Has thanked: 215 times
Been thanked: 1132 times

05 Apr 2013, 14:52

hai ca ti`l optimizez eu cat merge si tu te uiti la schimbari..
Caut o persoana dedicata care se pricepe si stie ce face.
Vreau sa creeze si sa se ocupe de administrarea unui server de MU, da e vorba de vechiul joc..ma gandesc undeva la un season 3 ep1/2.

O sa achizitionez un domeniu .ro.
Totodata sponsorizez absolut orice este necesar.
Ma puteti contacta prin: http://solo.to/stfrzv
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

05 Apr 2013, 14:53

Askhanar wrote:hai ca ti`l optimizez eu cat merge si tu te uiti la schimbari..
Ok, astept. Mersi mult :D
Retras
User avatar
Ulquiorra
Fost moderator
Fost moderator
Posts: 2053
Joined: 25 Jul 2010, 17: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: Fost Scripter eXtreamCS
Fost Moderator ajutator
Nick anterior: Askhanar
Location: Braila, Romania.
Has thanked: 215 times
Been thanked: 1132 times

05 Apr 2013, 15:05

hmm ar arata cam ceva de genul.
| Afiseaza codul
/*

- Ei bine, m-am gandit ca multi vor sa afiseze in modul acesta preturiile adminelor.

- Credite: eNd. | Pentru modul de inregistrare comenzi in plugin_init( )

*/

#include < amxmodx >

#define PLUGIN_NAME "Pret Admine - HUD"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "UspStyLe"


new const g_szMenuName[ ] = "\yPreturiile serverului \rCS.CS.RO";
new g_szGradeSiPreturi[ ][ ] =
{
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\yPentru cumparare:^n",
	"\yY!M: \rbulanica.cs"
}

new g_szClCmds[ ][ ] =
{
	"say /preturi",
	"say /buyadmin"
}

new g_iMenu;

public plugin_init( )
{
	// Register plugin
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR )
	
	// Register Chat Commands
	
	for( new i = 0;i < sizeof ( g_szClCmds ); i++ )
		register_clcmd( g_szClCmds[ i ], "pret_admine" )
		
	// Construim meniu o singura data.. nu la fiecare comanda.
	BuildMenu( );
}

BuildMenu( )
{
	g_iMenu = menu_create( g_szMenuName, "preturi_admine_handler" );
	new szKey[ 3 ];
	
	for( new i = 0; i < sizeof ( g_szGradeSiPreturi ); i++ )
	{
		// Cu asta transform integerul i in string.. facandu`l din 1 in "1"
		num_to_str( i + 1, szKey, sizeof ( szKey ) -1 );
		menu_additem( g_iMenu, g_szGradeSiPreturi[ i ], szKey, 0 );
	}
	
	menu_setprop( g_iMenu, MPROP_EXIT, MEXIT_ALL )
	
}
public pret_admine( id )
{
	// Acum doar ii aratam meniul.. nu il mai si construim.
	menu_display( id, g_iMenu, 0 );
}

public preturi_admine_handler( id, menu, item ) 
{
	if( item == MENU_EXIT )
	{
		menu_destroy( menu )
		return PLUGIN_HANDLED;
	}
	
	new data[ 6 ], szName[ 64 ];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback)
	new key = str_to_num( data ) 
	switch(key)
	{
		case 1..11: return PLUGIN_HANDLED
		}
	menu_destroy( menu )
	return PLUGIN_HANDLED
}
PS: nu vreau credite :P
Caut o persoana dedicata care se pricepe si stie ce face.
Vreau sa creeze si sa se ocupe de administrarea unui server de MU, da e vorba de vechiul joc..ma gandesc undeva la un season 3 ep1/2.

O sa achizitionez un domeniu .ro.
Totodata sponsorizez absolut orice este necesar.
Ma puteti contacta prin: http://solo.to/stfrzv
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

05 Apr 2013, 15:09

Askhanar wrote:hmm ar arata cam ceva de genul.
| Afiseaza codul
/*

- Ei bine, m-am gandit ca multi vor sa afiseze in modul acesta preturiile adminelor.

- Credite: eNd. | Pentru modul de inregistrare comenzi in plugin_init( )

*/

#include < amxmodx >

#define PLUGIN_NAME "Pret Admine - HUD"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "UspStyLe"


new const g_szMenuName[ ] = "\yPreturiile serverului \rCS.CS.RO";
new g_szGradeSiPreturi[ ][ ] =
{
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\yPentru cumparare:^n",
	"\yY!M: \rbulanica.cs"
}

new g_szClCmds[ ][ ] =
{
	"say /preturi",
	"say /buyadmin"
}

new g_iMenu;

public plugin_init( )
{
	// Register plugin
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR )
	
	// Register Chat Commands
	
	for( new i = 0;i < sizeof ( g_szClCmds ); i++ )
		register_clcmd( g_szClCmds[ i ], "pret_admine" )
		
	// Construim meniu o singura data.. nu la fiecare comanda.
	BuildMenu( );
}

BuildMenu( )
{
	g_iMenu = menu_create( g_szMenuName, "preturi_admine_handler" );
	new szKey[ 3 ];
	
	for( new i = 0; i < sizeof ( g_szGradeSiPreturi ); i++ )
	{
		// Cu asta transform integerul i in string.. facandu`l din 1 in "1"
		num_to_str( i + 1, szKey, sizeof ( szKey ) -1 );
		menu_additem( g_iMenu, g_szGradeSiPreturi[ i ], szKey, 0 );
	}
	
	menu_setprop( g_iMenu, MPROP_EXIT, MEXIT_ALL )
	
}
public pret_admine( id )
{
	// Acum doar ii aratam meniul.. nu il mai si construim.
	menu_display( id, g_iMenu, 0 );
}

public preturi_admine_handler( id, menu, item ) 
{
	if( item == MENU_EXIT )
	{
		menu_destroy( menu )
		return PLUGIN_HANDLED;
	}
	
	new data[ 6 ], szName[ 64 ];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback)
	new key = str_to_num( data ) 
	switch(key)
	{
		case 1..11: return PLUGIN_HANDLED
		}
	menu_destroy( menu )
	return PLUGIN_HANDLED
}
PS: nu vreau credite :P
Lol. E aproape facut tot de tine, mersi de optimizari. Chiar sunt bune :P
Retras
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

22 Nov 2013, 20:54

Am facut un mic/mare update. Puteti sa adaugati preturiile/gradele intr-un fisier.
.SMA | Afiseaza codul
#include < amxmodx >
#include < amxmisc >

#define PLUGIN_NAME "[New] Hud Preturi"
#define PLUGIN_VERSION "1.3s"
#define PLUGIN_AUTHOR "falseq"

new g_File[ 128 ];
new g_Degreed[ 64 ], g_Price[ 5 ], g_Line = 0;
new g_Menu;

new const g_MenuTitle[ 64 ] = "Pret admine CS.eXtream.Ro";

public plugin_init( )
{
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_clcmd( "say /preturi", "Func_Preturi" );
	register_clcmd( "say /pretadmine", "Func_Preturi" );
}

public plugin_cfg( )
{
	get_configsdir( g_File, sizeof( g_File ) -1 );
	format( g_File, sizeof( g_File ) -1, "%s/pret_admine.ini", g_File );
	
	if( !file_exists( g_File ) )
	{
		write_file( g_File, "^"Grad^" ^"Pret^"", -1 );
	}
	
	// - - - - - - - - - - - - - - - - - -
	
	g_Menu = menu_create( g_MenuTitle, "Func_Handle" );
	
	// - - - - - - - - - - - - - - - - - -
	
	new szFile = fopen( g_File, "r" );
	
	if( !szFile )
		return 1;
	
	new szData[ 512 ];
	
	while( !feof( szFile ) )
	{
		fgets( szFile, szData, sizeof( szData ) -1 );
		
		if( szData[ 0 ] == ';' || szData[ 0 ] == '/' && szData[ 1 ] == '/' )
			continue;
		
		parse( szData,\
			g_Degreed, sizeof( g_Degreed ) -1,\
			g_Price, sizeof( g_Price ) -1 );
		
		new szFormat[ 64 ], szLine[ 3 ];
		formatex( szFormat, sizeof( szFormat ) -1, "\w%s \y-\w %s", g_Degreed, g_Price );
		num_to_str( g_Line, szLine, sizeof( szLine ) -1 );
		
		menu_additem( g_Menu, szFormat, szLine, 0 );
		
		g_Line++;
	}
	
	fclose( szFile );
	
	return 0;
}	

public Func_Preturi( id )
{
	menu_display( id, g_Menu, 0 );
}

public Func_Handle( id, menu, item )
{
	switch( item )
	{
			case 0..15: return PLUGIN_HANDLED;
	}
	
	return PLUGIN_HANDLED
}
pret_admine.ini (il puneti in addons/amxmodx/configs | Afiseaza codul
"Mama" "5"
"Tata" "10"
"Tata2" "15"
"Tata3" "20"
Adaugati dupa urmatorul model:

Code: Select all

"Nume" "Pret"
Comenzi, pe say/in chat:

Code: Select all

/preturi
/pretadmine
- NU va recomand sa adaugati mai mult de 15 preturi/accese. (adica, mai mult de 15 linii/randuri)
- PLUGINUL este testat, si functioneaza. Orice eroare/parere/sugestie, va rog sa o scrieti aici.
Retras
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 11:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times

22 Nov 2013, 21:00

Frumos falseq felicitari =D>
Felicitari si tie Askhanar pentru optimizarile facute pluginului =D>
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

22 Nov 2013, 21:19

Super tare dintr-un fisier ai gandit bine :) bv
User avatar
sNoK
Membru, skill +1
Membru, skill +1
Posts: 173
Joined: 09 Jul 2009, 08:34
Detinator Steam: Da
Detinator server CS: Furien.Gajik.NeT
Location: BUCURESTI
Has thanked: 9 times
Been thanked: 1 time

15 Aug 2014, 06:25

Askhanar wrote:hmm ar arata cam ceva de genul.
| Afiseaza codul
/*

- Ei bine, m-am gandit ca multi vor sa afiseze in modul acesta preturiile adminelor.

- Credite: eNd. | Pentru modul de inregistrare comenzi in plugin_init( )

*/

#include < amxmodx >

#define PLUGIN_NAME "Pret Admine - HUD"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "UspStyLe"


new const g_szMenuName[ ] = "\yPreturiile serverului \rCS.CS.RO";
new g_szGradeSiPreturi[ ][ ] =
{
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\rNume Grad - \wPret Grad",
	"\yPentru cumparare:^n",
	"\yY!M: \rbulanica.cs"
}

new g_szClCmds[ ][ ] =
{
	"say /preturi",
	"say /buyadmin"
}

new g_iMenu;

public plugin_init( )
{
	// Register plugin
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR )
	
	// Register Chat Commands
	
	for( new i = 0;i < sizeof ( g_szClCmds ); i++ )
		register_clcmd( g_szClCmds[ i ], "pret_admine" )
		
	// Construim meniu o singura data.. nu la fiecare comanda.
	BuildMenu( );
}

BuildMenu( )
{
	g_iMenu = menu_create( g_szMenuName, "preturi_admine_handler" );
	new szKey[ 3 ];
	
	for( new i = 0; i < sizeof ( g_szGradeSiPreturi ); i++ )
	{
		// Cu asta transform integerul i in string.. facandu`l din 1 in "1"
		num_to_str( i + 1, szKey, sizeof ( szKey ) -1 );
		menu_additem( g_iMenu, g_szGradeSiPreturi[ i ], szKey, 0 );
	}
	
	menu_setprop( g_iMenu, MPROP_EXIT, MEXIT_ALL )
	
}
public pret_admine( id )
{
	// Acum doar ii aratam meniul.. nu il mai si construim.
	menu_display( id, g_iMenu, 0 );
}

public preturi_admine_handler( id, menu, item ) 
{
	if( item == MENU_EXIT )
	{
		menu_destroy( menu )
		return PLUGIN_HANDLED;
	}
	
	new data[ 6 ], szName[ 64 ];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback)
	new key = str_to_num( data ) 
	switch(key)
	{
		case 1..11: return PLUGIN_HANDLED
		}
	menu_destroy( menu )
	return PLUGIN_HANDLED
}
PS: nu vreau credite :P


cum pot sa i-l fac gen daca playeri scriu de 5 ori /preturi sa apara nu doar odata
Image

Image

Image

Pentru Cerere Admin | SLOT BAN/UNBAN Vizitati http://gajik.net Sectiune Furien

Download CS 1.6 -> http://www.metin2gajik.com <-

Pentru Donatii sau probleme Add [email protected] sau Skype : snok.alin


© Copyrighy By sNoK All Rights Reserved.


Image
User avatar
ALEXVL
Membru, skill +1
Membru, skill +1
Posts: 243
Joined: 22 Jul 2015, 00:01
Detinator Steam: Da
CS Status: Online
Detinator server CS: ZMX.LSEPLAY.COM
SteamID: Da
Fond eXtream: 0
Contact:

19 Jun 2017, 14:09

e super dar si eu sunt de acord cu sNoK , merge doar 1 data pe mapa , facetil sa mearga ori de cate ori e accesata comanda /preturi.. zic si eu
ZOMBIE CROWN ROMANIA.
The NeW Wolrd Zombie
view server | Afiseaza codul
[ Mod:[/size] Image] [Statistici:[/size] Image ][IP:[/size] Image ]
Post Reply

Return to “Pluginuri eXtream”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests