[REZOLVAT]furien shop

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
HecaTe
eXtream Mod
eXtream Mod
Posts: 3121
Joined: 16 Aug 2014, 07:53
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
SteamID: hecate_2k
Reputatie: eXtream Mod
Fond eXtream: 0
Location: Medias/Alba Iulia
Has thanked: 43 times
Been thanked: 25 times
Contact:

18 Aug 2014, 19:50

Descriere plugin cerut: Daca puteti sa modificati un plugin.
Alte informatii:Can scriu shop in chat imi apare
Image
image hosting no registration
As vrea sa-l faceti sa arate mai bine daca se poate...
Aici aveti sma-ul:
| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>

#define PLUGIN "ShOp"
#define VERSION "1.0"
#define AUTHOR "C0sm1N"

#pragma semicolon 1

new const sKnife[66] = "models/superknife/v_knife.mdl";

new bool:g_bKnife[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_event("CurWeapon", "evCurweapon", "be", "1=1");
	register_logevent("round_start", 2, "1=Round_Start");
	
	register_clcmd("say /shop","cmdShop");
}
public cmdShop(id)
{
	if(get_user_team(id) == 1 && is_user_alive(id))
	{
		set_task(0.1,"shopf",id);
	}
	if(get_user_team(id) == 2 && is_user_alive(id))
	{
		set_task(0.1,"shopct",id);
	}
}
public shopf(id)
{
	static menu;
	menu = menu_create ("yShop rFurieni","furien_menu");
	
	menu_additem ( menu,"r SuperKnife [10.000 $]","1", 0 );
	menu_additem ( menu,"r He Granade [4.000 $]","2", 0 );
	menu_additem ( menu,"r +50 HP [3.000 $]","3", 0 );
	menu_additem ( menu,"r +50 Armura [500 $]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public furien_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		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:
		{
			if(cs_get_user_money(id) >= 10000)
			{
				g_bKnife[id] = true;
				cs_set_user_money(id, cs_get_user_money(id) - 10000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 4000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 4000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public shopct( id )
{
	static menu;
	menu = menu_create ("yShop rFurieni","anti_menu");
	
	menu_additem ( menu,"r Defuse Kit [1.000 $]","1", 0 );
	menu_additem ( menu,"r HE Granade [4.000 $]","2", 0 );
	menu_additem ( menu,"r +50 HP [3.000 $]","3", 0 );
	menu_additem ( menu,"r +50 Armura [500 $]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public anti_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		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:
		{
			if(cs_get_user_money(id) >= 500)
			{
				give_item(id, "item_thighpack");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 4000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 4000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public evCurweapon(id)
{
	if(g_bKnife[id])
	{
		if(get_user_weapon(id) == CSW_KNIFE)
		{
			set_pev(id, pev_viewmodel2, sKnife);
		}
	}
}
public round_start( )
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum);
	for(new i = 0; i < iNum; i++)
	{
		g_bKnife[ iPlayers[ i ] ] = false;
	}
}
public client_disconnect(id)
	g_bKnife[id] = false;
	
public client_putinsevrer(id)
	g_bKnife[id] = false;
	
public plugin_precache()
{
	precache_model(sKnife);
}


Mersi anticipat [-o<
Last edited by Cosmin on 19 Aug 2014, 13:53, edited 1 time in total.
Reason: marcat ca rezolvat
Image
Image
Mai nou si internet banking are liber de 1 decembrie :kappa: :kappa:
Image
eXtreamSHOP
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1938
Joined: 16 Jul 2011, 20:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Location: Bacău
Has thanked: 227 times
Been thanked: 471 times
Contact:

18 Aug 2014, 20:01

Data viitoare pentru surse scrie

Code: Select all

[sursa=]cod[/sursa]
Eroarea asta provine de la compilarea pe platforma freakz. Incearca local [adica din pc-ul tau] si scapi de eroare.
Image
Cosmin
Fost moderator
Fost moderator
Posts: 9526
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 568 times
Been thanked: 587 times

18 Aug 2014, 20:02

@mutat in modificari

sursa:
| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>

static const
	PLUGIN[] = "Shop",
	VERSION[] = "1.0",
	AUTHOR[] = "C0sm1N";


#pragma semicolon 1

new const sKnife[66] = "models/superknife/v_knife.mdl";

new bool:g_bKnife[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_event("CurWeapon", "evCurweapon", "be", "1=1");
	register_logevent("round_start", 2, "1=Round_Start");
	
	register_clcmd("say /shop","cmdShop");
}
public cmdShop(id)
{
	if(get_user_team(id) == 1 && is_user_alive(id))
	{
		set_task(0.1,"shopf",id);
	}
	if(get_user_team(id) == 2 && is_user_alive(id))
	{
		set_task(0.1,"shopct",id);
	}
}
public shopf(id)
{
	static menu;
	menu = menu_create ("\dShop rFurieni","furien_menu");
	
	menu_additem ( menu,"\rSuperKnife [10.000 $]","1", 0 );
	menu_additem ( menu,"\rHe Granade [4.000 $]","2", 0 );
	menu_additem ( menu,"\r+50 HP [3.000 $]","3", 0 );
	menu_additem ( menu,"\r+50 Armura [500 $]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public furien_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		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:
		{
			if(cs_get_user_money(id) >= 10000)
			{
				g_bKnife[id] = true;
				cs_set_user_money(id, cs_get_user_money(id) - 10000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 4000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 4000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public shopct( id )
{
	static menu;
	menu = menu_create ("\dShop rFurieni","anti_menu");
	
	menu_additem ( menu,"\rDefuse Kit [1.000 $]","1", 0 );
	menu_additem ( menu,"\rHE Grenade [4.000 $]","2", 0 );
	menu_additem ( menu,"\r+50 HP [3.000 $]","3", 0 );
	menu_additem ( menu,"\r+50 Armura [500 $]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public anti_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		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:
		{
			if(cs_get_user_money(id) >= 500)
			{
				give_item(id, "item_thighpack");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 4000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 4000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public evCurweapon(id)
{
	if(g_bKnife[id])
	{
		if(get_user_weapon(id) == CSW_KNIFE)
		{
			set_pev(id, pev_viewmodel2, sKnife);
		}
	}
}
public round_start( )
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum);
	for(new i = 0; i < iNum; i++)
	{
		g_bKnife[ iPlayers[ i ] ] = false;
	}
}
public client_disconnect(id)
	g_bKnife[id] = false;

public client_putinsevrer(id)
	g_bKnife[id] = false;

public plugin_precache()
{
	precache_model(sKnife);
}
User avatar
HecaTe
eXtream Mod
eXtream Mod
Posts: 3121
Joined: 16 Aug 2014, 07:53
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
SteamID: hecate_2k
Reputatie: eXtream Mod
Fond eXtream: 0
Location: Medias/Alba Iulia
Has thanked: 43 times
Been thanked: 25 times
Contact:

19 Aug 2014, 00:01

am compilat cu amxmodx.org/webcompiler.cgi deoarece compilerul nu merge...poate deaia e asa.â
Mi-l poate compila cineva va rog frumos?
Thx anticipat!
Image
Image
Mai nou si internet banking are liber de 1 decembrie :kappa: :kappa:
Image
Cosmin
Fost moderator
Fost moderator
Posts: 9526
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 568 times
Been thanked: 587 times

19 Aug 2014, 00:13

User avatar
HecaTe
eXtream Mod
eXtream Mod
Posts: 3121
Joined: 16 Aug 2014, 07:53
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
SteamID: hecate_2k
Reputatie: eXtream Mod
Fond eXtream: 0
Location: Medias/Alba Iulia
Has thanked: 43 times
Been thanked: 25 times
Contact:

19 Aug 2014, 12:38

Puteti da T/C!
problema rezolvata
Image
Image
Mai nou si internet banking are liber de 1 decembrie :kappa: :kappa:
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests