Plugin /shop[rezolvat]

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
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3560
Joined: 02 Apr 2012, 16:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 797 times
Been thanked: 607 times

18 Feb 2013, 21:47

Image

Toate sa se poata sa se ia doar odata pe runda + la viteza sa fie viteza 500 ( si sa fie si cand se schimba arma gen pistol dupa lama si tot asa sa ramana viteza)+ la gravity sa fie 600
sa fie colorat ,multumesc
Last edited by CsN^ ;x on 23 Feb 2013, 18:39, edited 1 time in total.
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
User avatar
eNd.
Membru, skill +1
Membru, skill +1
Posts: 236
Joined: 19 Jan 2013, 21:18
Detinator Steam: Da
CS Status: Whoa...
SteamID: skitaila03
Has thanked: 18 times
Been thanked: 79 times

20 Feb 2013, 15:56

Ti l-am facut eu...
Daca gasesti buguri spune'mi.
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <colorchat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "eNd."
#pragma semicolon 1
new const szPrefix[] = "^x04Prefix:^x03";
//Cvar
new cvar_nade, cvar_nade2, cvar_hp , cvar_ap;
new cvar_deagle , cvar_godmode, cvar_speed , cvar_gravity;
new cvar_shopon;
new cvar_gravity2 , cvar_fast, cvar_normal;
//Bool
new bool:g_bSpeed[33];
new bool:g_bUsed[33];
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	cvar_shopon = register_cvar("shop_on", "1");
	cvar_nade = register_cvar("shop_nade", "500");
	cvar_nade2 = register_cvar("shop_nade2", "1000");
	cvar_hp = register_cvar("shop_hp", "10000");
	cvar_ap = register_cvar("shop_ap", "10000");
	cvar_deagle = register_cvar("shop_deagle", "11000");
	cvar_godmode = register_cvar("shop_godmode", "13000");
	cvar_speed = register_cvar("shop_speed", "13500");
	cvar_gravity = register_cvar("shop_gravity", "15000");
	cvar_normal = register_cvar("normal_speed", "250");
	cvar_fast = register_cvar("fast_speed", "600");
	cvar_gravity2 = register_cvar("set_gravity", "0.60");
	register_clcmd("say /shop2", "cmd_shop");
	register_clcmd("say_team /shop2", "cmd_shop");
	//Event
	register_event( "CurWeapon", "CurWeapon", "be", "1=1" );
	//Ham
	RegisterHam( Ham_Spawn, "player", "Player_Spawn", 1 );
}
public Player_Spawn(const id)
{
	g_bSpeed[id] = false;
	g_bUsed[id] = false;
	set_task(1.0, "Remove_Godmode", id);

	if(is_user_alive(id))
	{
		set_user_gravity(id, 1.0);

		if(!g_bSpeed[id])
			set_user_maxspeed(id, get_pcvar_float(cvar_normal));
	}	
	return PLUGIN_HANDLED;
}
public CurWeapon(id)
{
	if(g_bSpeed[id])
		set_user_maxspeed(id, get_pcvar_float(cvar_fast));
		
	else if(!g_bSpeed[id])
		set_user_maxspeed(id, get_pcvar_float(cvar_normal));
		
	return PLUGIN_HANDLED;
}
public cmd_shop(id)
{
	if(!get_pcvar_num(cvar_shopon))
	{
		ColorChat(id, NORMAL, "%s Shop in lucru", szPrefix);
		return PLUGIN_HANDLED;
	}
	if(!is_user_alive(id) || is_user_bot(id))
	{
		ColorChat(id, NORMAL, "%s Esti mort.", szPrefix);
		return PLUGIN_HANDLED;
	}
	if(g_bUsed[id])
	{
		ColorChat(id, NORMAL, "%s Tocmai ai folosit shop'ul.", szPrefix);
		return PLUGIN_HANDLED;
	}
	else shop_menu(id);
	

	return PLUGIN_HANDLED;
}

public shop_menu(id)
{
		new shopmenu = menu_create("\yShop^n\r", "sub_show_shop");

		menu_additem(shopmenu, "\wHE:\r500 \y$", "1", 0);
		menu_additem(shopmenu, "\wHE + FLASH:\r1000 \y$", "2", 0);
		menu_additem(shopmenu, "\w350 HP:\r10000 \y$", "3", 0);
      	  	menu_additem(shopmenu, "\w350 AP:\r10000 \y$", "4", 0);
		menu_additem(shopmenu, "\wDeagle(2 bullets):\r11000 \y$", "5", 0);
		menu_additem(shopmenu, "\wGodmode(35 sec):\r13000 \y$", "6", 0);
		menu_additem(shopmenu, "\wSpeed(1 tura):\r13500 \y$", "7", 0);
		menu_additem(shopmenu, "\wGravity(1 tura):\r15000 \y$", "8", 0);
		menu_setprop(shopmenu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, shopmenu, 0);
}

public sub_show_shop(id, shopmenu, item)  
{
	if (item == MENU_EXIT)
	{
		remove_task(id);
		menu_destroy(shopmenu);
		return PLUGIN_HANDLED;
	}
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(shopmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_nade)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_hegrenade");
				ColorChat(id, NORMAL, "%s Ai cumparat HeGrenade.", szPrefix);
				return PLUGIN_HANDLED;
			}
			
		}
		
		case 2: 
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_nade2)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_flashbang");
				give_item(id, "weapon_hegrenade");
				ColorChat(id, NORMAL, "%s Ai cumparat HeGrenade + Flash.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		
		case 3:
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_hp)))
			{
				g_bUsed[id] = true;
				set_user_health(id, 350);
				ColorChat(id, NORMAL, "%s Ai cumparat 350 Viata.", szPrefix);
	
				return PLUGIN_HANDLED;
			}
		}
		
		case 4:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_ap)))
			{
				g_bUsed[id] = true;
				set_user_armor(id, 350);
				ColorChat(id, NORMAL, "%s Ai cumparat 350 Armura.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		
		case 5:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_deagle)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_deagle");
				cs_set_weapon_ammo(CSW_DEAGLE, 2);
				ColorChat(id, NORMAL, "%s Ai cumparat Deagle cu 2xbullets.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		case 6:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_godmode)))
			{
				set_user_godmode( id, 1);
				set_task(35.0, "Remove_Godmode", id);
				ColorChat(id, NORMAL, "%s Ai cumparat GodMode 35 secunde.", szPrefix);
				return PLUGIN_HANDLED;
			}

		}
		case 7:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_speed)))
			{
				g_bUsed[id] = true;
				g_bSpeed[id] = true;
				set_user_maxspeed(id, get_pcvar_float(cvar_fast));
				ColorChat(id, NORMAL, "%s Ai cumparat Viteza.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		case 8:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_gravity)))
			{
				g_bUsed[id] = true;
				set_user_gravity(id, get_pcvar_float(cvar_gravity2));
				ColorChat(id, NORMAL, "%s Ai cumparat Gravity.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
	}
	menu_destroy(shopmenu);
	return PLUGIN_HANDLED;
}
public Remove_Godmode(id)
    if(is_user_alive(id))
        set_user_godmode( id, 0);

public client_disconnect(id)
    remove_task(id);


stock cs_take_user_money( id , amount )
{
	new money = cs_get_user_money( id );
    
	if( money < amount )
	{
		ColorChat(id, NORMAL, "%s Nu ai destui bani.", szPrefix);
		return 0;
	}
	
	cs_set_user_money( id , min( ( money-amount ) , 16000 ) );
	return 1;
}
Last edited by eNd. on 22 Feb 2013, 23:16, edited 1 time in total.
Image
ImageImage
User avatar
Rap^
Membru, skill +2
Membru, skill +2
Posts: 621
Joined: 01 Oct 2011, 00:25
Detinator Steam: Da
Reputatie: Fost Scripter eXtreamCS
Fost Super moderator
Location: Bucuresti
Has thanked: 16 times
Been thanked: 156 times

21 Feb 2013, 17:29

1. Nu este nevoie sa ii setezi tu viteza default in CurWeapon, ea se seteaza automat 250.
2.

Code: Select all

ColorChat(id, NORMAL, "%s Esti mort sau bot.", szPrefix)
Nu cred ca era necesar sa ii zici ca e bot.
3.

Code: Select all

cs_set_weapon_ammo(find_ent_by_owner(10, "weapon_deagle", id), 2)
- >

Code: Select all

cs_set_weapon_ammo(CSW_DEAGLE, 2)
4. Nu vad ce rost au bool-urile de la Gravity si GodMode.
5. Daca faci cum am zis la punctul 3 nu ai nevoie de engine.
Imagination is more important than knowledge.
Knowledge is limited - Imagination encircles the world.
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

21 Feb 2013, 18:38

ColorChat(id, NORMAL, "%s Esti mort sau bot.", szPrefix)
Ce rost are colorchat daca textul apare normal ?
User avatar
eNd.
Membru, skill +1
Membru, skill +1
Posts: 236
Joined: 19 Jan 2013, 21:18
Detinator Steam: Da
CS Status: Whoa...
SteamID: skitaila03
Has thanked: 18 times
Been thanked: 79 times

21 Feb 2013, 19:06

Rap^ wrote:1. Nu este nevoie sa ii setezi tu viteza default in CurWeapon, ea se seteaza automat 250.
2.

Code: Select all

ColorChat(id, NORMAL, "%s Esti mort sau bot.", szPrefix)
Nu cred ca era necesar sa ii zici ca e bot.
3.

Code: Select all

cs_set_weapon_ammo(find_ent_by_owner(10, "weapon_deagle", id), 2)
- >

Code: Select all

cs_set_weapon_ammo(CSW_DEAGLE, 2)
4. Nu vad ce rost au bool-urile de la Gravity si GodMode.
5. Daca faci cum am zis la punctul 3 nu ai nevoie de engine.
Ty.
Am sa revin cu update.
Hades Ownage wrote:
ColorChat(id, NORMAL, "%s Esti mort sau bot.", szPrefix)

Ce rost are colorchat daca textul apare normal ?
Look.

Code: Select all

new const szPrefix[] = "Prefix^x04:"
edit:
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <colorchat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "eNd."
#pragma semicolon 1
new const szPrefix[] = "^x04Prefix:^x03";
//Cvar
new cvar_nade, cvar_nade2, cvar_hp , cvar_ap;
new cvar_deagle , cvar_godmode, cvar_speed , cvar_gravity;
new cvar_shopon;
new cvar_gravity2 , cvar_fast, cvar_normal;
//Bool
new bool:g_bSpeed[33];
new bool:g_bUsed[33];
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	cvar_shopon = register_cvar("shop_on", "1");
	cvar_nade = register_cvar("shop_nade", "500");
	cvar_nade2 = register_cvar("shop_nade2", "1000");
	cvar_hp = register_cvar("shop_hp", "10000");
	cvar_ap = register_cvar("shop_ap", "10000");
	cvar_deagle = register_cvar("shop_deagle", "11000");
	cvar_godmode = register_cvar("shop_godmode", "13000");
	cvar_speed = register_cvar("shop_speed", "13500");
	cvar_gravity = register_cvar("shop_gravity", "15000");
	cvar_normal = register_cvar("normal_speed", "250");
	cvar_fast = register_cvar("fast_speed", "600");
	cvar_gravity2 = register_cvar("set_gravity", "0.60");
	register_clcmd("say /shop2", "cmd_shop");
	register_clcmd("say_team /shop2", "cmd_shop");
	//Event
	register_event( "CurWeapon", "CurWeapon", "be", "1=1" );
	//Ham
	RegisterHam( Ham_Spawn, "player", "Player_Spawn", 1 );
}
public Player_Spawn(const id)
{
	g_bSpeed[id] = false;
	g_bUsed[id] = false;
	set_task(1.0, "Remove_Godmode", id);

	if(is_user_alive(id))
	{
		set_user_gravity(id, 1.0);

		if(!g_bSpeed[id])
			set_user_maxspeed(id, get_pcvar_float(cvar_normal));
	}	
	return PLUGIN_HANDLED;
}
public CurWeapon(id)
{
	if(g_bSpeed[id])
		set_user_maxspeed(id, get_pcvar_float(cvar_fast));
		
	else if(!g_bSpeed[id])
		set_user_maxspeed(id, get_pcvar_float(cvar_normal));
		
	return PLUGIN_HANDLED;
}
public cmd_shop(id)
{
	if(!get_pcvar_num(cvar_shopon))
	{
		ColorChat(id, NORMAL, "%s Shop in lucru", szPrefix);
		return PLUGIN_HANDLED;
	}
	if(!is_user_alive(id) || is_user_bot(id))
	{
		ColorChat(id, NORMAL, "%s Esti mort.", szPrefix);
		return PLUGIN_HANDLED;
	}
	if(g_bUsed[id])
	{
		ColorChat(id, NORMAL, "%s Tocmai ai folosit shop'ul.", szPrefix);
		return PLUGIN_HANDLED;
	}
	else shop_menu(id);
	

	return PLUGIN_HANDLED;
}

public shop_menu(id)
{
		new shopmenu = menu_create("\yShop^n\r", "sub_show_shop");

		menu_additem(shopmenu, "\wHE:\r500 \y$", "1", 0);
		menu_additem(shopmenu, "\wHE + FLASH:\r1000 \y$", "2", 0);
		menu_additem(shopmenu, "\w350 HP:\r10000 \y$", "3", 0);
      	  	menu_additem(shopmenu, "\w350 AP:\r10000 \y$", "4", 0);
		menu_additem(shopmenu, "\wDeagle(2 bullets):\r11000 \y$", "5", 0);
		menu_additem(shopmenu, "\wGodmode(35 sec):\r13000 \y$", "6", 0);
		menu_additem(shopmenu, "\wSpeed(1 tura):\r13500 \y$", "7", 0);
		menu_additem(shopmenu, "\wGravity(1 tura):\r15000 \y$", "8", 0);
		menu_setprop(shopmenu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, shopmenu, 0);
}

public sub_show_shop(id, shopmenu, item)  
{
	if (item == MENU_EXIT)
	{
		remove_task(id);
		menu_destroy(shopmenu);
		return PLUGIN_HANDLED;
	}
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(shopmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_nade)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_hegrenade");
				ColorChat(id, NORMAL, "%s Ai cumparat HeGrenade.", szPrefix);
				return PLUGIN_HANDLED;
			}
			
		}
		
		case 2: 
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_nade2)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_flashbang");
				give_item(id, "weapon_hegrenade");
				ColorChat(id, NORMAL, "%s Ai cumparat HeGrenade + Flash.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		
		case 3:
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_hp)))
			{
				g_bUsed[id] = true;
				set_user_health(id, 350);
				ColorChat(id, NORMAL, "%s Ai cumparat 350 Viata.", szPrefix);
	
				return PLUGIN_HANDLED;
			}
		}
		
		case 4:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_ap)))
			{
				g_bUsed[id] = true;
				set_user_armor(id, 350);
				ColorChat(id, NORMAL, "%s Ai cumparat 350 Armura.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		
		case 5:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_deagle)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_deagle");
				cs_set_weapon_ammo(CSW_DEAGLE, 2);
				ColorChat(id, NORMAL, "%s Ai cumparat Deagle cu 2xbullets.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		case 6:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_godmode)))
			{
				set_user_godmode( id, 1);
				set_task(35.0, "Remove_Godmode", id);
				ColorChat(id, NORMAL, "%s Ai cumparat GodMode 35 secunde.", szPrefix);
				return PLUGIN_HANDLED;
			}

		}
		case 7:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_speed)))
			{
				g_bUsed[id] = true;
				g_bSpeed[id] = true;
				set_user_maxspeed(id, get_pcvar_float(cvar_fast));
				ColorChat(id, NORMAL, "%s Ai cumparat Viteza.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		case 8:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_gravity)))
			{
				g_bUsed[id] = true;
				set_user_gravity(id, get_pcvar_float(cvar_gravity2));
				ColorChat(id, NORMAL, "%s Ai cumparat Gravity.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
	}
	menu_destroy(shopmenu);
	return PLUGIN_HANDLED;
}
public Remove_Godmode(id)
    if(is_user_alive(id))
        set_user_godmode( id, 0);

public client_disconnect(id)
    remove_task(id);


stock cs_take_user_money( id , amount )
{
	new money = cs_get_user_money( id );
    
	if( money < amount )
	{
		ColorChat(id, NORMAL, "%s Nu ai destui bani.", szPrefix);
		return 0;
	}
	
	cs_set_user_money( id , min( ( money-amount ) , 16000 ) );
	return 1;
}
Last edited by eNd. on 22 Feb 2013, 23:16, edited 1 time in total.
Image
ImageImage
User avatar
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3560
Joined: 02 Apr 2012, 16:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 797 times
Been thanked: 607 times

22 Feb 2013, 21:55

Scuze end dar nu merge :| cand scriu /shop nu apare nimica de la ce o fi :-?
PS:O sa testez si pe alt server sa vad ca poate e de la ceva ..revin si cu un edit
Edit : Nu merge am incercat si pe alt server .. :|
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
User avatar
eNd.
Membru, skill +1
Membru, skill +1
Posts: 236
Joined: 19 Jan 2013, 21:18
Detinator Steam: Da
CS Status: Whoa...
SteamID: skitaila03
Has thanked: 18 times
Been thanked: 79 times

22 Feb 2013, 23:15

Poftim am facut update..
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <colorchat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "eNd."
#pragma semicolon 1
new const szPrefix[] = "^x04Prefix:^x03";
//Cvar
new cvar_nade, cvar_nade2, cvar_hp , cvar_ap;
new cvar_deagle , cvar_godmode, cvar_speed , cvar_gravity;
new cvar_shopon;
new cvar_gravity2 , cvar_fast, cvar_normal;
//Bool
new bool:g_bSpeed[33];
new bool:g_bUsed[33];
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	cvar_shopon = register_cvar("shop_on", "1");
	cvar_nade = register_cvar("shop_nade", "500");
	cvar_nade2 = register_cvar("shop_nade2", "1000");
	cvar_hp = register_cvar("shop_hp", "10000");
	cvar_ap = register_cvar("shop_ap", "10000");
	cvar_deagle = register_cvar("shop_deagle", "11000");
	cvar_godmode = register_cvar("shop_godmode", "13000");
	cvar_speed = register_cvar("shop_speed", "13500");
	cvar_gravity = register_cvar("shop_gravity", "15000");
	cvar_normal = register_cvar("normal_speed", "250");
	cvar_fast = register_cvar("fast_speed", "600");
	cvar_gravity2 = register_cvar("set_gravity", "0.60");
	register_clcmd("say /shop2", "cmd_shop");
	register_clcmd("say_team /shop2", "cmd_shop");
	//Event
	register_event( "CurWeapon", "CurWeapon", "be", "1=1" );
	//Ham
	RegisterHam( Ham_Spawn, "player", "Player_Spawn", 1 );
}
public Player_Spawn(const id)
{
	g_bSpeed[id] = false;
	g_bUsed[id] = false;
	set_task(1.0, "Remove_Godmode", id);

	if(is_user_alive(id))
	{
		set_user_gravity(id, 1.0);

		if(!g_bSpeed[id])
			set_user_maxspeed(id, get_pcvar_float(cvar_normal));
	}	
	return PLUGIN_HANDLED;
}
public CurWeapon(id)
{
	if(g_bSpeed[id])
		set_user_maxspeed(id, get_pcvar_float(cvar_fast));
		
	else if(!g_bSpeed[id])
		set_user_maxspeed(id, get_pcvar_float(cvar_normal));
		
	return PLUGIN_HANDLED;
}
public cmd_shop(id)
{
	if(!get_pcvar_num(cvar_shopon))
	{
		ColorChat(id, NORMAL, "%s Shop in lucru", szPrefix);
		return PLUGIN_HANDLED;
	}
	if(!is_user_alive(id) || is_user_bot(id))
	{
		ColorChat(id, NORMAL, "%s Esti mort.", szPrefix);
		return PLUGIN_HANDLED;
	}
	if(g_bUsed[id])
	{
		ColorChat(id, NORMAL, "%s Tocmai ai folosit shop'ul.", szPrefix);
		return PLUGIN_HANDLED;
	}
	else shop_menu(id);
	

	return PLUGIN_HANDLED;
}

public shop_menu(id)
{
		new shopmenu = menu_create("\yShop^n\r", "sub_show_shop");

		menu_additem(shopmenu, "\wHE:\r500 \y$", "1", 0);
		menu_additem(shopmenu, "\wHE + FLASH:\r1000 \y$", "2", 0);
		menu_additem(shopmenu, "\w350 HP:\r10000 \y$", "3", 0);
      	  	menu_additem(shopmenu, "\w350 AP:\r10000 \y$", "4", 0);
		menu_additem(shopmenu, "\wDeagle(2 bullets):\r11000 \y$", "5", 0);
		menu_additem(shopmenu, "\wGodmode(35 sec):\r13000 \y$", "6", 0);
		menu_additem(shopmenu, "\wSpeed(1 tura):\r13500 \y$", "7", 0);
		menu_additem(shopmenu, "\wGravity(1 tura):\r15000 \y$", "8", 0);
		menu_setprop(shopmenu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, shopmenu, 0);
}

public sub_show_shop(id, shopmenu, item)  
{
	if (item == MENU_EXIT)
	{
		remove_task(id);
		menu_destroy(shopmenu);
		return PLUGIN_HANDLED;
	}
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(shopmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_nade)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_hegrenade");
				ColorChat(id, NORMAL, "%s Ai cumparat HeGrenade.", szPrefix);
				return PLUGIN_HANDLED;
			}
			
		}
		
		case 2: 
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_nade2)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_flashbang");
				give_item(id, "weapon_hegrenade");
				ColorChat(id, NORMAL, "%s Ai cumparat HeGrenade + Flash.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		
		case 3:
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_hp)))
			{
				g_bUsed[id] = true;
				set_user_health(id, 350);
				ColorChat(id, NORMAL, "%s Ai cumparat 350 Viata.", szPrefix);
	
				return PLUGIN_HANDLED;
			}
		}
		
		case 4:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_ap)))
			{
				g_bUsed[id] = true;
				set_user_armor(id, 350);
				ColorChat(id, NORMAL, "%s Ai cumparat 350 Armura.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		
		case 5:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_deagle)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_deagle");
				cs_set_weapon_ammo(CSW_DEAGLE, 2);
				ColorChat(id, NORMAL, "%s Ai cumparat Deagle cu 2xbullets.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		case 6:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_godmode)))
			{
				set_user_godmode( id, 1);
				set_task(35.0, "Remove_Godmode", id);
				ColorChat(id, NORMAL, "%s Ai cumparat GodMode 35 secunde.", szPrefix);
				return PLUGIN_HANDLED;
			}

		}
		case 7:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_speed)))
			{
				g_bUsed[id] = true;
				g_bSpeed[id] = true;
				set_user_maxspeed(id, get_pcvar_float(cvar_fast));
				ColorChat(id, NORMAL, "%s Ai cumparat Viteza.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		case 8:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_gravity)))
			{
				g_bUsed[id] = true;
				set_user_gravity(id, get_pcvar_float(cvar_gravity2));
				ColorChat(id, NORMAL, "%s Ai cumparat Gravity.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
	}
	menu_destroy(shopmenu);
	return PLUGIN_HANDLED;
}
public Remove_Godmode(id)
    if(is_user_alive(id))
        set_user_godmode( id, 0);

public client_disconnect(id)
    remove_task(id);


stock cs_take_user_money( id , amount )
{
	new money = cs_get_user_money( id );
    
	if( money < amount )
	{
		ColorChat(id, NORMAL, "%s Nu ai destui bani.", szPrefix);
		return 0;
	}
	
	cs_set_user_money( id , min( ( money-amount ) , 16000 ) );
	return 1;
}
Image
ImageImage
User avatar
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3560
Joined: 02 Apr 2012, 16:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 797 times
Been thanked: 607 times

22 Feb 2013, 23:27

Tot la fel cand scriu /shop nu imi apare nimica :|
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
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 Feb 2013, 23:33

CsN^ ;x wrote:Tot la fel cand scriu /shop nu imi apare nimica :|
Comanda este: /shop2.
@eNd. ceva ma face sa cred ca pluginul NU este facut de tine.
Retras
User avatar
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3560
Joined: 02 Apr 2012, 16:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 797 times
Been thanked: 607 times

22 Feb 2013, 23:36

-ModeR- wrote:
CsN^ ;x wrote:Tot la fel cand scriu /shop nu imi apare nimica :|
Comanda este: /shop2.
@eNd. ceva ma face sa cred ca pluginul NU este facut de tine.
Mersi :)
Acuma il testez si vad daca are vreun bug :P

Edit : Merge perfect dar are 1 singur bug :) la deagal ii da 7 gloante daca se poate 2 cum am specificat eu :) si sa ii mai bagi la speed mai mult putin ca are decat 270 :)
PS:As dori sa pui la Inceput cand scri /shop apare meniul si sus sa scrie Shop serverului sau sa scriu ce vreau si dedesupt banii ($)
Edit2:Cand iau gravitatia si schimb cutit si pun pistol si tot asa dispare gravitatia intr-o secunda :| vreau sa ramana 1 tura cum zice asa si la viteza daca se poate .. :|
Last edited by CsN^ ;x on 22 Feb 2013, 23:56, edited 1 time in total.
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
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 Feb 2013, 23:56

E cam, codat prost pluginul ala :|
EDIT:
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <colorchat>
#include <engine>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "eNd."
#pragma semicolon 1
new const szPrefix[] = "^x04Prefix:^x03";
//Cvar
new cvar_nade, cvar_nade2, cvar_hp , cvar_ap;
new cvar_deagle , cvar_godmode, cvar_speed , cvar_gravity;
new cvar_shopon;
new cvar_gravity2 , cvar_fast, cvar_normal;
//Bool
new bool:g_bSpeed[33];
new bool:g_bUsed[33];
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	cvar_shopon = register_cvar("shop_on", "1");
	cvar_nade = register_cvar("shop_nade", "500");
	cvar_nade2 = register_cvar("shop_nade2", "1000");
	cvar_hp = register_cvar("shop_hp", "10000");
	cvar_ap = register_cvar("shop_ap", "10000");
	cvar_deagle = register_cvar("shop_deagle", "11000");
	cvar_godmode = register_cvar("shop_godmode", "13000");
	cvar_speed = register_cvar("shop_speed", "13500");
	cvar_gravity = register_cvar("shop_gravity", "15000");
	cvar_normal = register_cvar("normal_speed", "250");
	cvar_fast = register_cvar("fast_speed", "600");
	cvar_gravity2 = register_cvar("set_gravity", "0.60");
	register_clcmd("say /shop2", "cmd_shop");
	register_clcmd("say_team /shop2", "cmd_shop");
	//Event
	register_event( "CurWeapon", "CurWeapon", "be", "1=1" );
	//Ham
	RegisterHam( Ham_Spawn, "player", "Player_Spawn", 1 );
}
public Player_Spawn(const id)
{
	g_bSpeed[id] = false;
	g_bUsed[id] = false;
	set_task(1.0, "Remove_Godmode", id);

	if(is_user_alive(id))
	{
		set_user_gravity(id, 1.0);

		if(!g_bSpeed[id])
			set_user_maxspeed(id, get_pcvar_float(cvar_normal));
	}	
	return PLUGIN_HANDLED;
}
public CurWeapon(id)
{
	if(g_bSpeed[id])
		set_user_maxspeed(id, get_pcvar_float(cvar_fast));
		
	else if(!g_bSpeed[id])
		set_user_maxspeed(id, get_pcvar_float(cvar_normal));
		
	return PLUGIN_HANDLED;
}
public cmd_shop(id)
{
	if(!get_pcvar_num(cvar_shopon))
	{
		ColorChat(id, NORMAL, "%s Shop in lucru", szPrefix);
		return PLUGIN_HANDLED;
	}
	if(!is_user_alive(id) || is_user_bot(id))
	{
		ColorChat(id, NORMAL, "%s Esti mort.", szPrefix);
		return PLUGIN_HANDLED;
	}
	if(g_bUsed[id])
	{
		ColorChat(id, NORMAL, "%s Tocmai ai folosit shop'ul.", szPrefix);
		return PLUGIN_HANDLED;
	}
	else shop_menu(id);
	

	return PLUGIN_HANDLED;
}

public shop_menu(id)
{
		new shopmenu = menu_create("\yShop^n\r", "sub_show_shop");

		menu_additem(shopmenu, "\wHE:\r500 \y$", "1", 0);
		menu_additem(shopmenu, "\wHE + FLASH:\r1000 \y$", "2", 0);
		menu_additem(shopmenu, "\w350 HP:\r10000 \y$", "3", 0);
      	  	menu_additem(shopmenu, "\w350 AP:\r10000 \y$", "4", 0);
		menu_additem(shopmenu, "\wDeagle(2 bullets):\r11000 \y$", "5", 0);
		menu_additem(shopmenu, "\wGodmode(35 sec):\r13000 \y$", "6", 0);
		menu_additem(shopmenu, "\wSpeed(1 tura):\r13500 \y$", "7", 0);
		menu_additem(shopmenu, "\wGravity(1 tura):\r15000 \y$", "8", 0);
		menu_setprop(shopmenu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, shopmenu, 0);
}

public sub_show_shop(id, shopmenu, item)  
{
	if (item == MENU_EXIT)
	{
		remove_task(id);
		menu_destroy(shopmenu);
		return PLUGIN_HANDLED;
	}
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(shopmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_nade)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_hegrenade");
				ColorChat(id, NORMAL, "%s Ai cumparat HeGrenade.", szPrefix);
				return PLUGIN_HANDLED;
			}
			
		}
		
		case 2: 
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_nade2)))
			{
				g_bUsed[id] = true;
				give_item(id, "weapon_flashbang");
				give_item(id, "weapon_hegrenade");
				ColorChat(id, NORMAL, "%s Ai cumparat HeGrenade + Flash.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		
		case 3:
		{
			if(cs_take_user_money(id , get_pcvar_num(cvar_hp)))
			{
				g_bUsed[id] = true;
				set_user_health(id, 350);
				ColorChat(id, NORMAL, "%s Ai cumparat 350 Viata.", szPrefix);
	
				return PLUGIN_HANDLED;
			}
		}
		
		case 4:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_ap)))
			{
				g_bUsed[id] = true;
				set_user_armor(id, 350);
				ColorChat(id, NORMAL, "%s Ai cumparat 350 Armura.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		
		case 5:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_deagle)))
			{
				g_bUsed[id] = true;
				ItemDeagle(id,2)
				ColorChat(id, NORMAL, "%s Ai cumparat Deagle cu 2xbullets.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		case 6:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_godmode)))
			{
				set_user_godmode( id, 1);
				set_task(35.0, "Remove_Godmode", id);
				ColorChat(id, NORMAL, "%s Ai cumparat GodMode 35 secunde.", szPrefix);
				return PLUGIN_HANDLED;
			}

		}
		case 7:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_speed)))
			{
				g_bUsed[id] = true;
				g_bSpeed[id] = true;
				set_user_maxspeed(id, get_pcvar_float(cvar_fast));
				ColorChat(id, NORMAL, "%s Ai cumparat Viteza.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
		case 8:
		{
			if(cs_take_user_money( id , get_pcvar_num(cvar_gravity)))
			{
				g_bUsed[id] = true;
				set_user_gravity(id, get_pcvar_float(cvar_gravity2));
				ColorChat(id, NORMAL, "%s Ai cumparat Gravity.", szPrefix);
				return PLUGIN_HANDLED;
			}
		}
	}
	menu_destroy(shopmenu);
	return PLUGIN_HANDLED;
}
public Remove_Godmode(id)
    if(is_user_alive(id))
        set_user_godmode( id, 0);

public client_disconnect(id)
    remove_task(id);


stock cs_take_user_money( id , amount )
{
	new money = cs_get_user_money( id );
    
	if( money < amount )
	{
		ColorChat(id, NORMAL, "%s Nu ai destui bani.", szPrefix);
		return 0;
	}
	
	cs_set_user_money( id , min( ( money-amount ) , 16000 ) );
	return 1;
}
stock ItemDeagle(id,count)
{   
    give_item(id,"weapon_deagle");
    new gl = find_ent_by_owner(-1,"weapon_deagle",id);
    if (gl)
    cs_set_weapon_ammo(id,count);
}

Uite, deagle cu 2 gloante.
Retras
User avatar
eNd.
Membru, skill +1
Membru, skill +1
Posts: 236
Joined: 19 Jan 2013, 21:18
Detinator Steam: Da
CS Status: Whoa...
SteamID: skitaila03
Has thanked: 18 times
Been thanked: 79 times

23 Feb 2013, 00:00

CsN^ ;x wrote:
-ModeR- wrote:
CsN^ ;x wrote:Tot la fel cand scriu /shop nu imi apare nimica :|
Comanda este: /shop2.
@eNd. ceva ma face sa cred ca pluginul NU este facut de tine.
Mersi :)
Acuma il testez si vad daca are vreun bug :P

Edit : Merge perfect dar are 1 singur bug :) la deagal ii da 7 gloante daca se poate 2 cum am specificat eu :) si sa ii mai bagi la speed mai mult putin ca are decat 270 :)
PS:As dori sa pui la Inceput cand scri /shop apare meniul si sus sa scrie Shop serverului sau sa scriu ce vreau si dedesupt banii ($)
Edit2:Cand iau gravitatia si schimb cutit si pun pistol si tot asa dispare gravitatia intr-o secunda :| vreau sa ramana 1 tura cum zice asa si la viteza daca se poate .. :|
Am uitat sa modific , ca l-am testat , pe un server cu un shop deja inclus...
edit: Moder initial am folosit engine , dar la sfatul lu' Rap am folosit :
Rap^ wrote: 3.

Code: Select all

cs_set_weapon_ammo(find_ent_by_owner(10, "weapon_deagle", id), 2)
- >

Code: Select all

cs_set_weapon_ammo(CSW_DEAGLE, 2)
5. Daca faci cum am zis la punctul 3 nu ai nevoie de engine.
Image
ImageImage
Post Reply

Return to “Cereri”

  • Information