Cerere plugin knife

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 .
Post Reply
User avatar
Jorj
eXtream Mod
eXtream Mod
Posts: 3500
Joined: 13 Aug 2013, 17:10
Detinator Steam: Da
Detinator server CS: Furien.LsZ.Ro
SteamID: clic_lsz
Reputatie: eXtream Mod
Fost Membru Club eXtreamCS (patru luni)
Nume anterior: Clic
Location: Piatra Neamt
Been thanked: 20 times
Contact:

31 Dec 2013, 17:52

Salut !
Am si eu nevoie de un plugin shop knife pentru furien ...
Am gasit un plugin dar nu e bun ... imi da unknown si bad load .Daca puteti sa-l faceti pe ala sa mearga e foarte bine ... vreau ceva asemanator
.sma | Afiseaza codul
#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >
#include < fakemeta_util >
#include < fun >

#define PLUGIN "Furien Shop"
#define VERSION "0.3"
#define AUTHOR "Gabriel & Modificat de SnowFake"

#define   FL_WATERJUMP   (1<<11)
#define   FL_ONGROUND         (1<<9)

native get_user_credits( id )
native set_user_credits( id, cantitate )

enum Color
{
	NORMAL = 1, // clients scr_concolor cvar color
	GREEN, // Green Color
	TEAM_COLOR, // Red, grey, blue
	GREY, // grey
	RED, // Red
	BLUE, // Blue
}

new TeamName[][] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}

#define IsPlayer(%0)    ( 1 <= %0 <= maxplayers )
new maxplayers, pCvarSpawn;

new HasChoosed[33];

new bool:super_knife [ 33 ];
new bool:super_knife2 [ 33 ];
new bool:super_knife3 [ 33 ];
new bool:super_knife4 [ 33 ];

new super_knife_v_model [ 66 ] = "models/v_fury.mdl";
new super_knife2_v_model [ 66 ] = "models/v_joker.mdl";
new super_knife3_v_model [ 66 ] = "models/v_rambo.mdl";
new super_knife4_v_model [ 66 ] = "models/v_camo.mdl";

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd("say /furienshop", "FurienShop", 0);
	register_clcmd("say furienshop", "FurienShop", 0);
	register_clcmd("say shopfurien", "FurienShop", 0);
	register_clcmd("say /shopfurien", "FurienShop", 0);
	register_event ( "CurWeapon", "CurrentWeapon", "be", "1=1" );
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	RegisterHam ( Ham_Spawn, "player", "Spawn", 1 );
	
	register_event ( "DeathMsg", "eDeath", "a" );

	pCvarSpawn = register_cvar( "spawn?", "0" )
	
	maxplayers = get_maxplayers()
	
}
public plugin_precache ( ) {
	
	precache_model ( super_knife_v_model );
	precache_model ( super_knife2_v_model );
	precache_model ( super_knife3_v_model );
	precache_model ( super_knife3_v_model );
        precache_model ( super_knife4_v_model );
}
public eDeath ( ) {
	
	new iVictim = read_data ( 2 );
	
	client_putinserver ( iVictim );
	
}
public round_start()
{
	new iPlayers[32]
	new iNum
	
	get_players( iPlayers, iNum )
	
	for( new i = 0; i < iNum; i++ )
	{
		HasChoosed[iPlayers] = 0;
	}
}
public Spawn ( id ) {

	if( get_pcvar_num( pCvarSpawn ) == 0 ) {
        FurienShop( id );
	}
	if( get_user_team( id ) == 2 ) {
	super_knife[ id ] = false;
	super_knife2[ id ] = false;
	super_knife3[ id ] = false;
	super_knife4[ id ] = false;
	}
}
public client_putinserver ( id ) {
	
	super_knife [ id ] = false;
	super_knife2 [ id ] = false;
	super_knife3 [ id ] = false;
	super_knife4 [ id ] = false;
	HasChoosed [ id ] = false;
}

public client_disconnect ( id ) 
{
	client_putinserver ( id );
}
public CurrentWeapon ( id ) {
	
	if ( super_knife [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, super_knife_v_model );
	}
	if ( super_knife2 [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, super_knife2_v_model );
	}
	if ( super_knife3 [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, super_knife3_v_model );
	}
	if ( super_knife4 [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, super_knife4_v_model );
	}
}
public FurienShop ( id ) {
	
	if ( get_user_team ( id ) == 1 && is_user_alive ( id ) ) {
		
		if ( HasChoosed [ id ] ) {
			
			ColorChat ( id, GREEN, "^x04[FURIEN]^x01 Ti-ai ales runda aceasta knife-ul .");
			return 1;
		}
		
		else if ( !HasChoosed [ id ] ) {
			
			set_task ( 0.1, "ShowFurien", id );
			
		}
	}
	return 1
}
public ShowFurien(id, level, cid) {    
	
	new menu = menu_create( "\r Furien\w Shop", "furienhandler");
	menu_additem(menu, "Fury Knife \yX3 - \r10 \yCredite", "0", 0);
	menu_additem(menu, "Joker rKnife \yX4 - \r20 \yCredite", "1", 0);
	menu_additem(menu, "Rambo Knife \yX5 - \r30 \yCredite", "2", 0 );
	menu_additem(menu, "Camo Knife \yX6 - \r40 \yCredite", "3", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public furienhandler(id, menu, item, level, cid) {
	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 0:
		{
			new iCredits = get_user_credits ( id ) - 10;
			if( iCredits < 0 )
				{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				super_knife[ id ] = true;
				CurrentWeapon( id );
				
				set_user_credits( id, iCredits );
				HasChoosed [ id ] = true;
				return 1;
			}
		}
		case 1:
		{
			new iCredits = get_user_credits ( id ) - 20;
			if( iCredits < 0 )
				{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				super_knife2[ id ] = true;
				CurrentWeapon( id );
				
				set_user_credits( id, iCredits );
				HasChoosed [ id ] = true;
				return 1;
			}
		}
		
		case 2:
		{
			new iCredits = get_user_credits ( id ) - 30;
			if( iCredits < 0 )
				{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				super_knife3[ id ] = true;
				CurrentWeapon( id );
				
				set_user_credits( id, iCredits );
				HasChoosed [ id ] = true;
				return 1;
			}
		}
		
		case 3:
		{
			new iCredits = get_user_credits ( id ) - 40;
			if( iCredits < 0 )
				{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
				
			}
			else
			{ 
				super_knife4[ id ] = true;
				CurrentWeapon( id );
				
				set_user_credits( id, iCredits );
				HasChoosed [ id ] = true;
				return 1;
			}
		}
	}
	
	menu_destroy(menu);
	return 1;
}
public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage ) {
	
	if ( get_user_team ( iAttacker ) == get_user_team ( iVictim ) || iAttacker == iVictim )
		return 1;
	
	
	if ( IsPlayer ( iAttacker ) ) {
		
		new szWeapon = get_user_weapon ( iAttacker );
		
		if ( super_knife [ iAttacker ] && szWeapon == CSW_KNIFE && iInflictor == iAttacker ) {
			
			SetHamParamFloat ( 4, fDamage * 1.4 );
			return HAM_HANDLED;
			
		}
		if ( super_knife2 [ iAttacker ] && szWeapon == CSW_KNIFE && iInflictor == iAttacker ) {
			
			SetHamParamFloat ( 4, fDamage * 1.9 );
			return HAM_HANDLED;
			
		}
		if ( super_knife3 [ iAttacker ] && szWeapon == CSW_KNIFE && iInflictor == iAttacker ) {
			
			SetHamParamFloat ( 4, fDamage * 2.3 );
			return HAM_HANDLED;
			
		}
		if ( super_knife4 [ iAttacker ] && szWeapon == CSW_KNIFE && iInflictor == iAttacker ) {
			
			SetHamParamFloat ( 4, fDamage * 2.9 );
			return HAM_HANDLED;
			
		}
		return HAM_IGNORED
	}
	return HAM_IGNORED;
}
ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
	new message[256];
	
	switch(type)
	{
		case NORMAL: // clients scr_concolor cvar color
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}
	
	vformat(message[1], 251, msg, 4);
	
	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';
	
	new team, ColorChange, index, MSG_Type;
	
	if(id)
		{
		MSG_Type = MSG_ONE;
		index = id;
		} else {
		index = FindPlayer();
		MSG_Type = MSG_ALL;
	}
	
	team = get_user_team(index);
	ColorChange = ColorSelection(index, MSG_Type, type);
	
	ShowColorMessage(index, MSG_Type, message);
	
	if(ColorChange)
		{
		Team_Info(index, MSG_Type, TeamName[team]);
	}
}

ShowColorMessage(id, type, message[])
{
	static bool:saytext_used;
	static get_user_msgid_saytext;
	if(!saytext_used)
		{
		get_user_msgid_saytext = get_user_msgid("SayText");
		saytext_used = true;
	}
	message_begin(type, get_user_msgid_saytext, _, id);
	write_byte(id)		
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[])
{
	static bool:teaminfo_used;
	static get_user_msgid_teaminfo;
	if(!teaminfo_used)
		{
		get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
		teaminfo_used = true;
	}
	message_begin(type, get_user_msgid_teaminfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();
	
	return 1;
}

ColorSelection(index, type, Color:Type)
{
	switch(Type)
	{
		case RED:
		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:
		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:
		{
			return Team_Info(index, type, TeamName[0]);
		}
	}
	
	return 0;
}

FindPlayer()
{
	new i = -1;
	
	while(i <= get_maxplayers())
		{
		if(is_user_connected(++i))
			return i;
	}
	
	return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Intermediez tranzactii cand am chef si timp ! :)

Image
Rapidserver
User avatar
Adventx
Membru, skill +4
Membru, skill +4
Posts: 1785
Joined: 17 Sep 2013, 20:44
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 125 times
Been thanked: 142 times
Contact:

31 Dec 2013, 17:57

Merge bine pluginul, adauga modelele in models/ si gata! ;)
User avatar
Jorj
eXtream Mod
eXtream Mod
Posts: 3500
Joined: 13 Aug 2013, 17:10
Detinator Steam: Da
Detinator server CS: Furien.LsZ.Ro
SteamID: clic_lsz
Reputatie: eXtream Mod
Fost Membru Club eXtreamCS (patru luni)
Nume anterior: Clic
Location: Piatra Neamt
Been thanked: 20 times
Contact:

31 Dec 2013, 18:57

Nu imi merge ... l-am pus bine ... si imi da la nume unknown si bad load
Intermediez tranzactii cand am chef si timp ! :)

Image
User avatar
w3zoo_RedX
Membru, skill +2
Membru, skill +2
Posts: 737
Joined: 21 Dec 2013, 22:16
Detinator Steam: Da
CS Status: Scripter CS.
Detinator server CS: PM.
SteamID: PM.
Location: Bucuresti sector 2
Has thanked: 45 times
Been thanked: 45 times
Contact:

31 Dec 2013, 19:12

ai trecut FurienShop.amxx in plugins.ini?
User avatar
Jorj
eXtream Mod
eXtream Mod
Posts: 3500
Joined: 13 Aug 2013, 17:10
Detinator Steam: Da
Detinator server CS: Furien.LsZ.Ro
SteamID: clic_lsz
Reputatie: eXtream Mod
Fost Membru Club eXtreamCS (patru luni)
Nume anterior: Clic
Location: Piatra Neamt
Been thanked: 20 times
Contact:

31 Dec 2013, 19:48

mda...
Intermediez tranzactii cand am chef si timp ! :)

Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests