Modificare plugin shop furien

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
EuSemakka
Membru, skill +1
Membru, skill +1
Posts: 301
Joined: 26 Nov 2013, 17:40
Detinator Steam: Da
Detinator server CS: Furien.FaraLaG.Ro
Has thanked: 38 times
Been thanked: 7 times

22 Dec 2013, 18:58

Numi merge pluginul acesta cand il bag pe server numi arata lama nici pe cea default macar
| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

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

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers ) 

new g_iMaxPlayers;

#pragma semicolon 1

new const vKnife[66] = "models/superknife/v_super_knife1.mdl";
new const pKnife[66] = "models/superknife/p_super_knife1.mdl";

new bool: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");
	
	RegisterHam ( Ham_TakeDamage, "player", "fwd_takedamage" );
	g_iMaxPlayers = get_maxplayers ( );
}
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");
	
	if(cs_get_user_money(id) >= 10000)
	{
		menu_additem ( menu,"\w SuperKnife\y[\r10000$\y]","1", 0 );
	}
	else
	{
	menu_additem ( menu,"\w SuperKnife\y[\rNO MONEY\y]","1", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
		menu_additem ( menu,"\w HeGrenade\y[\r3000$\y]","2", 0 );
	}
	else
	{
		menu_additem ( menu,"\w HeGrenade\y[\rNO MONEY\y]","2", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
	menu_additem ( menu,"\w +50 HP\y[\r3000$\y]","3", 0 );
	}
	else
	{
		menu_additem ( menu,"\w +50 HP\y[\rNO MONEY\y]","3", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	}
	else
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\rNO MONEY\y]","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)
			{
				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) >= 3000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			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");
	
	if(cs_get_user_money(id) >= 500)
	{
	menu_additem ( menu,"\w DefuseKit\y[\r500$\y]","1", 0 );
	}
	else
	{
	menu_additem ( menu,"\w DefuseKit\y[\rNO MONEY\y]","1", 0 );
	}
	
	if(cs_get_user_money(id) >= 6000)
	{
	menu_additem ( menu,"\w HeGrenade\y[\r6000$\y]","2", 0 );
	}
	else
	{
	menu_additem ( menu,"\w HeGrenade\y[\rNO MONEY\y]","2", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
	menu_additem ( menu,"\w +50 HP\y[\r3000$\y]","3", 0 );
	}
	else
	{
	menu_additem ( menu,"\w +50 HP\y[\rNO MONEY\y]","3", 0 );
	}
	
	if(cs_get_user_money(id) >= 500)
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	}
	else
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\rNO MONEY\y]","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) >= 6000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 6000);
			}
			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(get_user_weapon(id) == CSW_KNIFE && bKnife[id])
	{
		set_pev(id, pev_viewmodel2, vKnife);
		set_pev(id, pev_weaponmodel2, pKnife);
	}
}
public round_start( )
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum);
	for(new i = 0; i < iNum; i++)
	{
		bKnife[ iPlayers[ i ] ] = false;
		give_item(iPlayers, "weapon_knife");
	}
}
public fwd_takedamage( iVictim, iInflictor, iAttacker, Float:fDamage )
{
	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && bKnife[ iAttacker ])
	{
		SetHamParamFloat ( 4, fDamage * 2.0 );
		return HAM_HANDLED;
	}
	return HAM_IGNORED;
}
public client_disconnect(id)
	bKnife[id] = false;

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

public plugin_precache()
{
	precache_model(vKnife);
	precache_model(pKnife);
}


Si imi arata asa Image
Last edited by EuSemakka on 22 Dec 2013, 19:11, edited 1 time in total.
Rapidserver
User avatar
EuSemakka
Membru, skill +1
Membru, skill +1
Posts: 301
Joined: 26 Nov 2013, 17:40
Detinator Steam: Da
Detinator server CS: Furien.FaraLaG.Ro
Has thanked: 38 times
Been thanked: 7 times

22 Dec 2013, 18:58

Stergeti acest post.
Cosmin
Fost moderator
Fost moderator
Posts: 9366
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: 492 times
Been thanked: 546 times

22 Dec 2013, 19:27

Deci pe serverul meu merge,i-am si aratat , dar pe al lui nu merge,nu ii arata lama :| cred ca e de la addonsul lui.

EDIT1: Am vorbit cu falseq,a spus ca ai un plugin care se bate cap in cap cu asta..
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

23 Dec 2013, 00:37

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

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

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers ) 

new g_iMaxPlayers;

#pragma semicolon 1

new const vKnife[66] = "models/superknife/v_super_knife1.mdl";
new const pKnife[66] = "models/superknife/p_super_knife1.mdl";

new bool: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");
	
	RegisterHam ( Ham_TakeDamage, "player", "fwd_takedamage" );
	g_iMaxPlayers = get_maxplayers ( );
}
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");
	
	if(cs_get_user_money(id) >= 10000)
	{
		menu_additem ( menu,"\w SuperKnife\y[\r10000$\y]","1", 0 );
	}
	else
	{
	menu_additem ( menu,"\w SuperKnife\y[\rNO MONEY\y]","1", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
		menu_additem ( menu,"\w HeGrenade\y[\r3000$\y]","2", 0 );
	}
	else
	{
		menu_additem ( menu,"\w HeGrenade\y[\rNO MONEY\y]","2", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
	menu_additem ( menu,"\w +50 HP\y[\r3000$\y]","3", 0 );
	}
	else
	{
		menu_additem ( menu,"\w +50 HP\y[\rNO MONEY\y]","3", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	}
	else
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\rNO MONEY\y]","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)
			{
				bKnife[id] = true;
				cs_set_user_money(id, cs_get_user_money(id) - 10000);
                                give_item ( id, "weapon_knife" )
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			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");
	
	if(cs_get_user_money(id) >= 500)
	{
	menu_additem ( menu,"\w DefuseKit\y[\r500$\y]","1", 0 );
	}
	else
	{
	menu_additem ( menu,"\w DefuseKit\y[\rNO MONEY\y]","1", 0 );
	}
	
	if(cs_get_user_money(id) >= 6000)
	{
	menu_additem ( menu,"\w HeGrenade\y[\r6000$\y]","2", 0 );
	}
	else
	{
	menu_additem ( menu,"\w HeGrenade\y[\rNO MONEY\y]","2", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
	menu_additem ( menu,"\w +50 HP\y[\r3000$\y]","3", 0 );
	}
	else
	{
	menu_additem ( menu,"\w +50 HP\y[\rNO MONEY\y]","3", 0 );
	}
	
	if(cs_get_user_money(id) >= 500)
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	}
	else
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\rNO MONEY\y]","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) >= 6000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 6000);
			}
			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(get_user_weapon(id) == CSW_KNIFE && bKnife[id])
	{
		set_pev(id, pev_viewmodel2, vKnife);
		set_pev(id, pev_weaponmodel2, pKnife);
	}
}
public round_start( )
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum);
	for(new i = 0; i < iNum; i++)
	{
		bKnife[ iPlayers[ i ] ] = false;
		give_item(iPlayers, "weapon_knife");
	}
}
public fwd_takedamage( iVictim, iInflictor, iAttacker, Float:fDamage )
{
	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && bKnife[ iAttacker ])
	{
		SetHamParamFloat ( 4, fDamage * 2.0 );
		return HAM_HANDLED;
	}
	return HAM_IGNORED;
}
public client_disconnect(id)
	bKnife[id] = false;

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

public plugin_precache()
{
	precache_model(vKnife);
	precache_model(pKnife);
}
Contact: Activitate scazuta.
Cosmin
Fost moderator
Fost moderator
Posts: 9366
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: 492 times
Been thanked: 546 times

23 Dec 2013, 00:42

I-am facut si eu asa si lafel,este de la addonsul lui are un plugin care face acelasi lucru in spawn.
User avatar
EuSemakka
Membru, skill +1
Membru, skill +1
Posts: 301
Joined: 26 Nov 2013, 17:40
Detinator Steam: Da
Detinator server CS: Furien.FaraLaG.Ro
Has thanked: 38 times
Been thanked: 7 times

23 Dec 2013, 11:30

Am schimbat versiune pluginului de baza furien si la ct imi arata lama la tero numi arata nmk :|
Cosmin
Fost moderator
Fost moderator
Posts: 9366
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: 492 times
Been thanked: 546 times

23 Dec 2013, 14:59

EuSemakka wrote:Am schimbat versiune pluginului de baza furien si la ct imi arata lama la tero numi arata nmk :|
Cred ca este d ela modul furien mai mult ca sigur..pentru ca la T seteaza in spawn un alt skin la knife si tu cand iti alegi din meniu altul probabil ca se face bug :|
User avatar
EuSemakka
Membru, skill +1
Membru, skill +1
Posts: 301
Joined: 26 Nov 2013, 17:40
Detinator Steam: Da
Detinator server CS: Furien.FaraLaG.Ro
Has thanked: 38 times
Been thanked: 7 times

23 Dec 2013, 15:10

Nu stiu de la ce e :|
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

23 Dec 2013, 18:41

EuSemakka wrote:Nu stiu de la ce e :|
Un maestru in furien ( Mama ce modest is ) :)))
Da-mi add: jc_dane97@yahoo.com si te rezolv.
Contact: Activitate scazuta.
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests