[Cerere]Plugin gen Shop

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 .
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

19 Jan 2013, 08:44

Salut,
As dori un plugin care cand scriun in chat /cumpara sa imi arate un meniu din care sa pot cumpara:
-he = 3000$
-smoke = 1500$
-flash = 1500$
-respawn odata pe runda =10.000$


Celalalt topic mi-a fost mutat la cos :-w

Multumesc!
RoyalServer 2
User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

19 Jan 2013, 13:06

| Afiseaza codul
[code=php]#include < amxmodx >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#include < colorchat >

#define PLUGIN "Shop Plug-In"
#define VERSION "1.0"
#define AUTHOR "hadesownage"

new g_Tag;
new CvarRespawnCost;
new limita[33]

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)    
    register_clcmd("say /cumpara","shop_menu", -1 )
    register_clcmd("say_team /cumpara","shop_menu", -1 )
    g_Tag = register_cvar("shop_tag", "[Shop]");
    CvarRespawnCost = register_cvar("respawn_cost", "10000");  // Pretul respawn-ului , default 10000
}

public shop_menu ( id, level, cid )
{

    if (is_user_alive(id))
    {
        new menu = menu_create( "Shop Menu", "menu_handler" )
        menu_additem(menu, "HE GRENADE", "1", 0)
        menu_additem(menu, "SMOKE GRENADE", "2", 0 )
        menu_additem(menu, "FLASH BANG", "3", 0 )
        menu_additem(menu, "RESPAWN", "4", 0)
        
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
        menu_display(id, menu, 0);
    }
    
    return 1
}

public menu_handler ( id, menu, item )
{
    if( item == MENU_EXIT )
    {
        return 1
    }
    
    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:
    {
        new iMoney = cs_get_user_money(id) - 3000;
        if( iMoney < 0 )
    {
        ColorChat(id,GREEN,"%s^x01 Mai ai nevoie de %i $ ca sa cumperi acest item !", g_Tag, ( iMoney * -1 ) );
        return 1
    }
        else
        {
        ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada HE !", g_Tag);    
        give_item(id, "weapon_hegrenade")
        }
    }
    case 2:
    {
        new iMoney = cs_get_user_money(id) - 1500;
        if ( iMoney < 0 )
    {
        ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
        return 1
    }
        else
        {
        ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada SMOKE !", g_Tag);     
        give_item(id, "weapon_smokegrenade")
    }
    }
    case 3:
    {
        new iMoney = cs_get_user_money(id) - 1500;
        if ( iMoney < 0 )
    {
        ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
        return 1
    }
        else
        {
        ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada FLASH !", g_Tag);
        give_item(id, "weapon_flashbang")
    }
    }
       
    case 4:
    {
        set_task(0.1, "cmdRespawn", id);
        limita[id] += 1
    }

    }
    
    menu_destroy(menu);
    return 1
    
}

public cmdRespawn(id) {
    
    if(limita[id] == 1){
        ColorChat(id,GREEN,"%s^x01 Ai folosit deja aceasta optiune !", g_Tag);
        return PLUGIN_HANDLED;
    }
    
    if( !is_user_connected(id) ) return PLUGIN_HANDLED;
    
    new szTag[32];
    get_pcvar_string(g_Tag, szTag, sizeof(szTag) - 1);
    
    if( cs_get_user_team(id) == CS_TEAM_SPECTATOR ) {
    ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti Spectator !", g_Tag);
    return PLUGIN_HANDLED;
    }
    if( is_user_alive(id) ) {
    ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti viu !", g_Tag);
    return PLUGIN_HANDLED;
    }
    if(cs_get_user_money(id) < get_pcvar_num(CvarRespawnCost)) {
    ColorChat(id,GREEN,"%s^x01 Nu ai destui bani !", g_Tag);
    return PLUGIN_HANDLED;
    }
    if(cs_get_user_money(id) > get_pcvar_num(CvarRespawnCost)) {
    ExecuteHamB(Ham_CS_RoundRespawn, id);
    cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(CvarRespawnCost), 1);
    ColorChat(id,GREEN,"%s^x01 Ai cumparat respawn !", g_Tag);
    set_task(0.5, "SetUserWeapons", id + 12345);
    return PLUGIN_HANDLED;
    }
    return PLUGIN_HANDLED;    
    }
public SetUserWeapons(id) {
    id -= 12345;
        
    if( !is_user_connected(id) ) return PLUGIN_HANDLED;
    
    strip_user_weapons(id);
    give_item(id, "weapon_knife");
    
    return PLUGIN_CONTINUE;
    }
[/code]
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

19 Jan 2013, 15:24

E bun dar nu retrage din bani! poti sa cumperi cat vrei
User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

19 Jan 2013, 16:09

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

#define PLUGIN "Shop Plug-In"
#define VERSION "1.0"
#define AUTHOR "hadesownage"

new g_Tag;
new CvarRespawnCost;
new limita[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)	
	register_clcmd("say /cumpara","shop_menu", -1 )
	register_clcmd("say_team /cumpara","shop_menu", -1 )
	g_Tag = register_cvar("shop_tag", "[Shop]");
	CvarRespawnCost = register_cvar("respawn_cost", "1");
}

public shop_menu ( id, level, cid )
{
	
	if (is_user_alive(id))
	{
		new menu = menu_create( "Shop Menu", "menu_handler" )
		menu_additem(menu, "HE GRENADE", "1", 0)
		menu_additem(menu, "SMOKE GRENADE", "2", 0 )
		menu_additem(menu, "FLASH BANG", "3", 0 )
		menu_additem(menu, "RESPAWN", "4", 0)
		
		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, menu, 0);
	}
	
	return 1
}

public menu_handler ( id, menu, item )
{
	if( item == MENU_EXIT )
	{
		return 1
	}
	
	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:
		{
			new iMoney = cs_get_user_money(id) - 3000;
			if( iMoney < 0 )
			{
				ColorChat(id,GREEN,"%s^x01 Mai ai nevoie de %i $ ca sa cumperi acest item !", g_Tag, ( iMoney * -1 ) );
				return 1
			}
			else
			{
				ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada HE !", g_Tag);	
				give_item(id, "weapon_hegrenade")
				cs_set_user_money( id, iMoney );
			}
		}
		case 2:
		{
			new iMoney = cs_get_user_money(id) - 1500;
			if ( iMoney < 0 )
			{
				ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
				return 1
			}
			else
			{
				ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada SMOKE !", g_Tag);	 
				give_item(id, "weapon_smokegrenade")
				cs_set_user_money( id, iMoney );
			}
		}
		case 3:
		{
			new iMoney = cs_get_user_money(id) - 1500;
			if ( iMoney < 0 )
			{
				ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
				return 1
			}
			else
			{
				ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada FLASH !", g_Tag);
				give_item(id, "weapon_flashbang")
				cs_set_user_money( id, iMoney );
			}
		}
		
		case 4:
		{
			new iMoney = cs_get_user_money(id) - 10000;
			if ( iMoney < 0 )
			set_task(0.1, "cmdRespawn", id);
			limita[id] += 1
			cs_set_user_money( id, iMoney );
		}
		
	}
	
	menu_destroy(menu);
	return 1
	
}

public cmdRespawn(id) {
	
	if(limita[id] == 1){
		ColorChat(id,GREEN,"%s^x01 Ai folosit deja aceasta optiune !", g_Tag);
		return PLUGIN_HANDLED;
	}
	
	if( !is_user_connected(id) ) return PLUGIN_HANDLED;
	
	new szTag[32];
	get_pcvar_string(g_Tag, szTag, sizeof(szTag) - 1);
	
	if( cs_get_user_team(id) == CS_TEAM_SPECTATOR ) {
		ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti Spectator !", g_Tag);
		return PLUGIN_HANDLED;
	}
	if( is_user_alive(id) ) {
		ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti viu !", g_Tag);
		return PLUGIN_HANDLED;
	}
	if(cs_get_user_money(id) < get_pcvar_num(CvarRespawnCost)) {
		ColorChat(id,GREEN,"%s^x01 Nu ai destui bani !", g_Tag);
		return PLUGIN_HANDLED;
	}
	if(cs_get_user_money(id) > get_pcvar_num(CvarRespawnCost)) {
		ExecuteHamB(Ham_CS_RoundRespawn, id);
		cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(CvarRespawnCost), 1);
		ColorChat(id,GREEN,"%s^x01 Ai cumparat respawn !", g_Tag);
		set_task(0.5, "SetUserWeapons", id + 12345);
		return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;	
}
public SetUserWeapons(id) {
	id -= 12345;
	
	if( !is_user_connected(id) ) return PLUGIN_HANDLED;
	
	strip_user_weapons(id);
	give_item(id, "weapon_knife");
	
	return PLUGIN_CONTINUE;
}
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

19 Jan 2013, 16:18

Multumesc merge!
Puteti bifa ca rezolvat
ai 2x thanks
User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

19 Jan 2013, 17:30

Vezi daca iti merge acum respawnul:
| Afiseaza codul
#include < amxmodx >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#include < colorchat >

#define PLUGIN "Shop Plug-In"
#define VERSION "1.0"
#define AUTHOR "hadesownage"

new g_Tag;
new limita[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)	
	register_clcmd("say /cumpara","shop_menu", -1 )
	register_clcmd("say_team /cumpara","shop_menu", -1 )
	g_Tag = register_cvar("shop_tag", "[Shop]");
}

public shop_menu ( id, level, cid )
{
	
	if (is_user_alive(id))
	{
		new menu = menu_create( "Shop Menu", "menu_handler" )
		menu_additem(menu, "HE GRENADE", "1", 0)
		menu_additem(menu, "SMOKE GRENADE", "2", 0 )
		menu_additem(menu, "FLASH BANG", "3", 0 )
		menu_additem(menu, "RESPAWN", "4", 0)
		
		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, menu, 0);
	}
	
	return 1
}

public menu_handler ( id, menu, item )
{
	if( item == MENU_EXIT )
	{
		return 1
	}
	
	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:
		{
			new iMoney = cs_get_user_money(id) - 3000;
			if( iMoney < 0 )
			{
				ColorChat(id,GREEN,"%s^x01 Mai ai nevoie de %i $ ca sa cumperi acest item !", g_Tag, ( iMoney * -1 ) );
				return 1
			}
			else
			{
				ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada HE !", g_Tag);	
				give_item(id, "weapon_hegrenade")
				cs_set_user_money( id, iMoney );
			}
		}
		case 2:
		{
			new iMoney = cs_get_user_money(id) - 1500;
			if ( iMoney < 0 )
			{
				ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
				return  PLUGIN_HANDLED
			}
			else
			{
				ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada SMOKE !", g_Tag);	 
				give_item(id, "weapon_smokegrenade")
				cs_set_user_money( id, iMoney );
			}
		}
		case 3:
		{
			new iMoney = cs_get_user_money(id) - 1500;
			if ( iMoney < 0 )
			{
				ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
				return  PLUGIN_HANDLED
			}
			else
			{
				ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada FLASH !", g_Tag);
				give_item(id, "weapon_flashbang")
				cs_set_user_money( id, iMoney );
			}
		}
		
		case 4:
		{
			if(cs_get_user_team (id)==CS_TEAM_SPECTATOR){
				ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti spectator !", g_Tag);
				return  PLUGIN_HANDLED
			}
			if(is_user_alive(id)){
				ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti viu !", g_Tag);
				return PLUGIN_HANDLED
			}
			new iMoney = cs_get_user_money(id) - 10000;
			if ( iMoney < 0 )
			{
				ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
				return PLUGIN_HANDLED
			}
			else
			{
				ExecuteHamB(Ham_CS_RoundRespawn, id);
				ColorChat(id,GREEN,"%s^x01 Ai cumparat respawn !", g_Tag);
				cs_set_user_money( id, iMoney );
				set_task(0.5, "SetUserWeapons", id + 12345);
				limita[id] += 1
				return PLUGIN_HANDLED
			}
		}
		
	}
	
	menu_destroy(menu);
	return 1
	
}

public SetUserWeapons(id) {
	id -= 12345;
	
	if( !is_user_connected(id) ) return PLUGIN_HANDLED;
	
	strip_user_weapons(id);
	give_item(id, "weapon_knife");
	
	return PLUGIN_CONTINUE;
}
User avatar
ExoTiQ
Membru, skill +1
Membru, skill +1
Posts: 180
Joined: 21 Aug 2012, 21:44
Detinator Steam: Da
CS Status: Funny
Detinator server CS: Da
SteamID: Privat
Has thanked: 4 times
Been thanked: 52 times
Contact:

19 Jan 2013, 18:59

Hades Ownage wrote:Vezi daca iti merge acum respawnul:
| Afiseaza codul
#include < amxmodx >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#include < colorchat >

#define PLUGIN "Shop Plug-In"
#define VERSION "1.0"
#define AUTHOR "hadesownage"

new g_Tag;
new limita[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)	
	register_clcmd("say /cumpara","shop_menu", -1 )
	register_clcmd("say_team /cumpara","shop_menu", -1 )
	g_Tag = register_cvar("shop_tag", "[Shop]");
}

public shop_menu ( id, level, cid )
{
	
	if (is_user_alive(id))
	{
		new menu = menu_create( "Shop Menu", "menu_handler" )
		menu_additem(menu, "HE GRENADE", "1", 0)
		menu_additem(menu, "SMOKE GRENADE", "2", 0 )
		menu_additem(menu, "FLASH BANG", "3", 0 )
		menu_additem(menu, "RESPAWN", "4", 0)
		
		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, menu, 0);
	}
	
	return 1
}

public menu_handler ( id, menu, item )
{
	if( item == MENU_EXIT )
	{
		return 1
	}
	
	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:
		{
			new iMoney = cs_get_user_money(id) - 3000;
			if( iMoney < 0 )
			{
				ColorChat(id,GREEN,"%s^x01 Mai ai nevoie de %i $ ca sa cumperi acest item !", g_Tag, ( iMoney * -1 ) );
				return 1
			}
			else
			{
				ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada HE !", g_Tag);	
				give_item(id, "weapon_hegrenade")
				cs_set_user_money( id, iMoney );
			}
		}
		case 2:
		{
			new iMoney = cs_get_user_money(id) - 1500;
			if ( iMoney < 0 )
			{
				ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
				return  PLUGIN_HANDLED
			}
			else
			{
				ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada SMOKE !", g_Tag);	 
				give_item(id, "weapon_smokegrenade")
				cs_set_user_money( id, iMoney );
			}
		}
		case 3:
		{
			new iMoney = cs_get_user_money(id) - 1500;
			if ( iMoney < 0 )
			{
				ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
				return  PLUGIN_HANDLED
			}
			else
			{
				ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada FLASH !", g_Tag);
				give_item(id, "weapon_flashbang")
				cs_set_user_money( id, iMoney );
			}
		}
		
		case 4:
		{
			if(cs_get_user_team (id)==CS_TEAM_SPECTATOR){
				ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti spectator !", g_Tag);
				return  PLUGIN_HANDLED
			}
			if(is_user_alive(id)){
				ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti viu !", g_Tag);
				return PLUGIN_HANDLED
			}
			new iMoney = cs_get_user_money(id) - 10000;
			if ( iMoney < 0 )
			{
				ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
				return PLUGIN_HANDLED
			}
			else
			{
				ExecuteHamB(Ham_CS_RoundRespawn, id);
				ColorChat(id,GREEN,"%s^x01 Ai cumparat respawn !", g_Tag);
				cs_set_user_money( id, iMoney );
				set_task(0.5, "SetUserWeapons", id + 12345);
				limita[id] += 1
				return PLUGIN_HANDLED
			}
		}
		
	}
	
	menu_destroy(menu);
	return 1
	
}

public SetUserWeapons(id) {
	id -= 12345;
	
	if( !is_user_connected(id) ) return PLUGIN_HANDLED;
	
	strip_user_weapons(id);
	give_item(id, "weapon_knife");
	
	return PLUGIN_CONTINUE;
}
La tine respawn limit nu lucreaza.
Poti sa faci respawn cat vrei.

Momentan,activitate mai slaba.
.


*[Anti Auto-Connect] [Config exec Connect IP Checker] [60%] [Public]
*[SISA Zombie + CSO Shop] [79%] [Contracost]

*[Plugin Snow] [100%] [La cerere - Privat]

* Screen#1 / Screen#2 / Screen#3
Acest plugin este facut la cerere si nu o sa fie public !
O sa fie public doar daca il face public Askhanar.



User avatar
CryWolf
Administrator
Administrator
Posts: 6505
Joined: 07 Aug 2008, 16:33
Detinator Steam: Da
Reputatie: Administrator
Fost Scripter
Manager CS2.eXtream.Ro
Fost Detinator ZM.eXtream.Ro
Fost manager CS.eXtream.Ro
Fost manager CSGO.eXtream.Ro
Fost manager global
Location: Botosani
Discord: crywolf1989
Has thanked: 202 times
Been thanked: 850 times
Contact:

19 Jan 2013, 19:06

untested :-?
shop.sma | Afiseaza codul
[code=php]
#include < amxmodx >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#include < colorchat >

#define PLUGIN "Shop Plug-In"
#define VERSION "1.0"
#define AUTHOR "hadesownage"

new g_Tag;
new bool:bAlreadyUsed [ 33 ]

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)    
    register_clcmd("say /cumpara","shop_menu", -1 )
    register_clcmd("say_team /cumpara","shop_menu", -1 )
    g_Tag = register_cvar("shop_tag", "[Shop]");
    register_event( "HLTV" , "evNewRound" , "a" , "1=0" , "2=0" );
}

public evNewRound( )
    arrayset( bAlreadyUsed , false , sizeof( bAlreadyUsed ) );
    
public shop_menu ( id, level, cid )
{
    
    if (is_user_alive(id))
    {
        new menu = menu_create( "Shop Menu", "menu_handler" )
        menu_additem(menu, "HE GRENADE", "1", 0)
        menu_additem(menu, "SMOKE GRENADE", "2", 0 )
        menu_additem(menu, "FLASH BANG", "3", 0 )
        menu_additem(menu, "RESPAWN", "4", 0)
        
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
        menu_display(id, menu, 0);
    }
    
    return 1
}

public menu_handler ( id, menu, item )
{
    if( item == MENU_EXIT )
    {
        return 1
    }
    
    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:
        {
            new iMoney = cs_get_user_money(id) - 3000;
            if( iMoney < 0 )
            {
                ColorChat(id,GREEN,"%s^x01 Mai ai nevoie de %i $ ca sa cumperi acest item !", g_Tag, ( iMoney * -1 ) );
                return 1
            }
            else
            {
                ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada HE !", g_Tag);    
                give_item(id, "weapon_hegrenade")
                cs_set_user_money( id, iMoney );
            }
        }
        case 2:
        {
            new iMoney = cs_get_user_money(id) - 1500;
            if ( iMoney < 0 )
            {
                ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
                return  PLUGIN_HANDLED
            }
            else
            {
                ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada SMOKE !", g_Tag);     
                give_item(id, "weapon_smokegrenade")
                cs_set_user_money( id, iMoney );
            }
        }
        case 3:
        {
            new iMoney = cs_get_user_money(id) - 1500;
            if ( iMoney < 0 )
            {
                ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
                return  PLUGIN_HANDLED
            }
            else
            {
                ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada FLASH !", g_Tag);
                give_item(id, "weapon_flashbang")
                cs_set_user_money( id, iMoney );
            }
        }
        
        case 4:
        {
            if(cs_get_user_team (id)==CS_TEAM_SPECTATOR){
                ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti spectator !", g_Tag);
                return  PLUGIN_HANDLED
            }
            if(is_user_alive(id)){
                ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti viu !", g_Tag);
                return PLUGIN_HANDLED
            }
            new iMoney = cs_get_user_money(id) - 10000;
            if ( iMoney < 0 )
            {
                ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
                return PLUGIN_HANDLED
            }
            else
            {
                ExecuteHamB(Ham_CS_RoundRespawn, id);
                ColorChat(id,GREEN,"%s^x01 Ai cumparat respawn !", g_Tag);
                cs_set_user_money( id, iMoney );
                set_task(0.5, "SetUserWeapons", id + 12345);
                bAlreadyUsed[ id ] = true;
                return 1;
            }
        }
        
    }
    
    menu_destroy(menu);
    return 1
    
}

public SetUserWeapons(id) {
    id -= 12345;
    
    if( !is_user_connected(id) ) return PLUGIN_HANDLED;
    
    strip_user_weapons(id);
    give_item(id, "weapon_knife");
    
    return PLUGIN_CONTINUE;
} [/code]
NU IMI MAI DA-TI PM CU CERERE AJUTOR/SAMD, FOLOSITI FORUMUL, CITESC MAJORITATEA TOPICURILOR.
www.dark-arena.com , SERVERE CS / CS2 / L4D AU REVENIT ONLINE.
www.diasporaiptv.ro - SERVICII PREMIUM IPTV

Image

Image
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

19 Jan 2013, 22:03

nu merge meniu cand esti mort
User avatar
ExoTiQ
Membru, skill +1
Membru, skill +1
Posts: 180
Joined: 21 Aug 2012, 21:44
Detinator Steam: Da
CS Status: Funny
Detinator server CS: Da
SteamID: Privat
Has thanked: 4 times
Been thanked: 52 times
Contact:

19 Jan 2013, 22:27

Mr.SpRyTe wrote:nu merge meniu cand esti mort
Nu poti sa folosesti menu cand esti mort pentru ca In "public shop_menu" exista

Code: Select all

if (is_user_alive(id))
CryWolf wrote:untested :-?
shop.sma | Afiseaza codul
[code=php]
#include < amxmodx >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#include < colorchat >

#define PLUGIN "Shop Plug-In"
#define VERSION "1.0"
#define AUTHOR "hadesownage"

new g_Tag;
new bool:bAlreadyUsed [ 33 ]

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)    
    register_clcmd("say /cumpara","shop_menu", -1 )
    register_clcmd("say_team /cumpara","shop_menu", -1 )
    g_Tag = register_cvar("shop_tag", "[Shop]");
    register_event( "HLTV" , "evNewRound" , "a" , "1=0" , "2=0" );
}

public evNewRound( )
    arrayset( bAlreadyUsed , false , sizeof( bAlreadyUsed ) );
    
public shop_menu ( id, level, cid )
{
    
    if (is_user_alive(id))
    {
        new menu = menu_create( "Shop Menu", "menu_handler" )
        menu_additem(menu, "HE GRENADE", "1", 0)
        menu_additem(menu, "SMOKE GRENADE", "2", 0 )
        menu_additem(menu, "FLASH BANG", "3", 0 )
        menu_additem(menu, "RESPAWN", "4", 0)
        
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
        menu_display(id, menu, 0);
    }
    
    return 1
}

public menu_handler ( id, menu, item )
{
    if( item == MENU_EXIT )
    {
        return 1
    }
    
    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:
        {
            new iMoney = cs_get_user_money(id) - 3000;
            if( iMoney < 0 )
            {
                ColorChat(id,GREEN,"%s^x01 Mai ai nevoie de %i $ ca sa cumperi acest item !", g_Tag, ( iMoney * -1 ) );
                return 1
            }
            else
            {
                ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada HE !", g_Tag);    
                give_item(id, "weapon_hegrenade")
                cs_set_user_money( id, iMoney );
            }
        }
        case 2:
        {
            new iMoney = cs_get_user_money(id) - 1500;
            if ( iMoney < 0 )
            {
                ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
                return  PLUGIN_HANDLED
            }
            else
            {
                ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada SMOKE !", g_Tag);     
                give_item(id, "weapon_smokegrenade")
                cs_set_user_money( id, iMoney );
            }
        }
        case 3:
        {
            new iMoney = cs_get_user_money(id) - 1500;
            if ( iMoney < 0 )
            {
                ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
                return  PLUGIN_HANDLED
            }
            else
            {
                ColorChat(id,GREEN,"%s^x01 Ai cumparat o grenada FLASH !", g_Tag);
                give_item(id, "weapon_flashbang")
                cs_set_user_money( id, iMoney );
            }
        }
        
        case 4:
        {
            if(cs_get_user_team (id)==CS_TEAM_SPECTATOR){
                ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti spectator !", g_Tag);
                return  PLUGIN_HANDLED
            }
            if(is_user_alive(id)){
                ColorChat(id,GREEN,"%s^x01 Nu poti folosi aceasta comanda cand esti viu !", g_Tag);
                return PLUGIN_HANDLED
            }
            new iMoney = cs_get_user_money(id) - 10000;
            if ( iMoney < 0 )
            {
                ColorChat(id,GREEN, "%s^x01 Mai ai nevoie de %i $ ca sa cumperi acet item !", g_Tag, ( iMoney * -1 ) );
                return PLUGIN_HANDLED
            }
            else
            {
                ExecuteHamB(Ham_CS_RoundRespawn, id);
                ColorChat(id,GREEN,"%s^x01 Ai cumparat respawn !", g_Tag);
                cs_set_user_money( id, iMoney );
                set_task(0.5, "SetUserWeapons", id + 12345);
                bAlreadyUsed[ id ] = true;
                return 1;
            }
        }
        
    }
    
    menu_destroy(menu);
    return 1
    
}

public SetUserWeapons(id) {
    id -= 12345;
    
    if( !is_user_connected(id) ) return PLUGIN_HANDLED;
    
    strip_user_weapons(id);
    give_item(id, "weapon_knife");
    
    return PLUGIN_CONTINUE;
} [/code]
Tot nu lucreaza respawn , ai uitat sa folosesti

Code: Select all

if(bAlreadyUsed[id]==true)

Acum incerc sa-l fac eu.
----------------
EDIT: Poftim Spryte , cum ai cerut in PM.
shop2.sma | Afiseaza codul
#include < amxmodx >
#include < hamsandwich >
#include < cstrike >
#include < fun >
#include < colorchat >

#define PLUGIN "Shop"
#define VERSION "1.0"
#define AUTHOR "ExoTiQ"

new bool:bAlreadyUsed [ 33 ]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)    
	register_clcmd("say /cumpara","shop_menu", -1 )
	register_clcmd("say_team /cumpara","shop_menu", -1 )
	register_event( "HLTV" , "evNewRound" , "a" , "1=0" , "2=0" );
}

public evNewRound( ) arrayset( bAlreadyUsed , false , sizeof( bAlreadyUsed ) );

public shop_menu( id, level, cid ) {
	
	new menu = menu_create( "Shop Menu", "menu_handler" )
	menu_additem(menu, "HE Grenade \r(3.000$)", "1", 0)
	menu_additem(menu, "SMOKE Grenade \r(1.500$)", "2", 0 )
	menu_additem(menu, "FLASH Grenade \r(1.500$)", "3", 0 )
	menu_additem(menu, "RESPAWN \r(10.000$)", "4", 0)
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	return 0
}
public menu_handler ( id, menu, item ) {
	if(item == MENU_EXIT) {
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new data[6], szName[64], 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: {
			if(cs_get_user_money(id) < 3000) {
				ColorChat(id,GREEN,"[Shop]^x01 Ai prea putini bani pentru a cumpara ^x04[HE Grenade] ^x01!");
				return 1
				} else {
				ColorChat(id,GREEN,"[Shop]^x01 Ai cumparat ^x04[HE Grenade] ^x01!"); 
				cs_set_user_money(id, cs_get_user_money(id) - 3000)
				give_item(id, "weapon_hegrenade")
			}
		}
		case 2: {
			if(cs_get_user_money(id) < 1500) {
				ColorChat(id,GREEN, "[Shop]^x01 Ai prea putini bani pentru a cumpara ^x04[SMOKE Grenade] ^x01!");
				return 1
				} else {
				ColorChat(id,GREEN,"[Shop]^x01 Ai cumparat ^x04[SMOKE Grenade] ^x01!");
				cs_set_user_money(id, cs_get_user_money(id) - 1500)
				give_item(id, "weapon_smokegrenade")
			}
		}
		case 3: {
			if(cs_get_user_money(id) < 1500) {
				ColorChat(id,GREEN, "[Shop]^x01 Ai prea putini bani pentru a cumpara ^x04[FLASH Grenade] ^x01!");
				return 1
				} else {
				ColorChat(id,GREEN,"[Shop]^x01 Ai cumparat ^x04[FLASH Grenade] ^x01!");
				cs_set_user_money(id, cs_get_user_money(id) - 1500)
				give_item(id, "weapon_flashbang")
			}
		}
		case 4: {		
			if(is_user_alive(id)) {
				ColorChat(id,GREEN,"[Shop]^x01 Nu poti folosi aceasta comanda cand esti viu !");
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 10000) {
				ColorChat(id,GREEN, "[Shop]^x01 Ai prea putini bani pentru a cumpara ^x04[RESPAWN] ^x01!");
				return PLUGIN_HANDLED
				} else {
				if(bAlreadyUsed[id]==true) {
					ColorChat (id,GREEN,"[Shop]^x01 Ai folosit deja acest item runda asta !");
					return 0
				}
				ExecuteHamB(Ham_CS_RoundRespawn, id);
				ColorChat(id,GREEN,"[Shop]^x01 Ai cumparat ^x04[RESPAWN] ^x01!");
				cs_set_user_money(id, cs_get_user_money(id) - 10000)
				set_task(0.5, "SetUserWeapons", id + 12345);			
				return 1;
			}
		}
	}
	menu_destroy(menu);
	return 1
}

public SetUserWeapons(id) {
	id -= 12345;
	if( !is_user_connected(id) ) return PLUGIN_HANDLED;
	strip_user_weapons(id);
	give_item(id, "weapon_knife");
	return PLUGIN_CONTINUE;
}

Momentan,activitate mai slaba.
.


*[Anti Auto-Connect] [Config exec Connect IP Checker] [60%] [Public]
*[SISA Zombie + CSO Shop] [79%] [Contracost]

*[Plugin Snow] [100%] [La cerere - Privat]

* Screen#1 / Screen#2 / Screen#3
Acest plugin este facut la cerere si nu o sa fie public !
O sa fie public doar daca il face public Askhanar.



User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

20 Jan 2013, 09:51

@ExoTiQ auzi ma mare scripter =]] de ce ma rog te-ai pus autor ? stii sa modifici un meniu si cateva linii si gata ?
User avatar
geo_neo9
Membru, skill +1
Membru, skill +1
Posts: 343
Joined: 29 Aug 2007, 09:45
Detinator Steam: Da
Has thanked: 12 times
Been thanked: 74 times

20 Jan 2013, 12:20

Am fost rugat de Hades sa il ajut cu asta, asa ca:
-
Last edited by geo_neo9 on 02 Apr 2013, 11:52, edited 2 times in total.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests