Licenta

Categoria unde puteti cere pentru tutoriale.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
mad--
Membru, skill 0
Membru, skill 0
Posts: 11
Joined: 05 Jul 2021, 19:48
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

13 Jul 2021, 22:07

Stie cineva cum scot licenta dintr-un plugin?
RoyalServer 2
User avatar
DevilBoy.eXe
Super moderator
Super moderator
Posts: 1678
Joined: 05 Jun 2016, 23:04
Detinator Steam: Da
Detinator server CS: GO.WARED.RO
SteamID: DevilBoy_eXe
Reputatie: Super Moderator
Fond eXtream: 0
Location: beyond the time
Discord: zeux.
Has thanked: 15 times
Been thanked: 71 times
Contact:

13 Jul 2021, 23:37

Ce plugin mai exact?
mad--
Membru, skill 0
Membru, skill 0
Posts: 11
Joined: 05 Jul 2021, 19:48
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

14 Jul 2021, 16:02

DevilBoy.eXe wrote:
13 Jul 2021, 23:37
Ce plugin mai exact?
Asta de exemplu am incercat eu da nu merge
| Afiseaza codul
#include < amxmodx >
#include < zombieplague >
//#include < Licence >

#define PLUGIN  "[ZP] Zombie Radio Pitch Changer"
#define VERSION	"1.0"

new cvar_radiopitch;
/*
public plugin_init( ) 
{
	Licence( );

	register_plugin( PLUGIN, VERSION, "VEN, Cristi .C" );
*/
{
	register_message( get_user_msgid( "SendAudio" ), "msg_send_audio" );
	 
	cvar_radiopitch = register_cvar( "zp_zombie_radio_pitch", "75" );
}

public plugin_cfg( )
	set_task( 1.57, "cache_settings" );

public cache_settings( )
	cvar_radiopitch = get_pcvar_num( cvar_radiopitch );

public msg_send_audio( msg_id, msg_dest, id )
{
	if ( !zp_get_user_valid( id ) || !zp_get_user_zombie( id ) )
		return;
	
	set_msg_arg_int( 3, ARG_SHORT, cvar_radiopitch );
}
sau asta :
| Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < zombieplague >
#include < zmvip >
#include < Licence >

#define PLUGIN "[ZP] Knife Mod"
#define VERSION "1.0"

const m_pPlayer = 41;
const XO_WEAPON = 4;

new const MeleeLocationModels[ ] = "ZmLand"
new const MeleeLocationSounds[ ] = "ZmLand"

new const Melee_Names[][] = 
{
	"Nata Knife",
	"Katana",
	"Dragon Claws",
	"Hammer \r(Vip Only)"
}

new const Melee_Models[][] = 
{
	"strong",
	"katana",
	"dragontail",
	"hammer"
}

new const Float:Melee_KnockBack[] = 
{
	600.0,
	600.0,
	600.0,
	1300.0
}

new const Float:Melee_Damage[] = 
{
	2.0,
	2.0,
	2.0,
	4.0
}

new const Melee_OnlyVip[] = 
{
	0,
	0,
	0,
	1
}

new g_iKnife[ 33 ];

new Array:a_Melee_ModelV, Array:a_Melee_ModelP, Array:a_Melee_SoundMiss, Array:a_Melee_SoundHWall, Array:a_Melee_SoundHit,
Array:a_Melee_SoundStab, Array:a_Melee_SoundDraw;

public plugin_precache( )
{
	a_Melee_ModelV = ArrayCreate( 64, 1 );
	a_Melee_ModelP = ArrayCreate( 64, 1 );
	a_Melee_SoundMiss = ArrayCreate( 64, 1 );
	a_Melee_SoundHWall = ArrayCreate( 64, 1 );
	a_Melee_SoundHit = ArrayCreate( 64, 1 );
	a_Melee_SoundStab = ArrayCreate( 64, 1 );
	a_Melee_SoundDraw = ArrayCreate( 64, 1 );

	new buffer[64], i;
	for( i = 0; i < sizeof ( Melee_Models ); i ++ )
	{
		formatex( buffer, charsmax( buffer ), "models/%s/v_%s.mdl", MeleeLocationModels, Melee_Models[ i ] );
		precache_model( buffer );
		ArrayPushString( a_Melee_ModelV, buffer )
		
		formatex( buffer, charsmax( buffer ), "models/%s/p_%s.mdl", MeleeLocationModels, Melee_Models[ i ] );
		precache_model( buffer );
		ArrayPushString( a_Melee_ModelP, buffer )
	
		formatex( buffer, charsmax( buffer ), "%s/%s_miss.wav", MeleeLocationSounds, Melee_Models[ i ] )
		precache_sound( buffer )
		ArrayPushString( a_Melee_SoundMiss, buffer )
		
		formatex( buffer, charsmax( buffer ), "%s/%s_hitwall.wav", MeleeLocationSounds, Melee_Models[ i ] )
		precache_sound( buffer )
		ArrayPushString( a_Melee_SoundHWall, buffer )
	
		formatex( buffer, charsmax( buffer ), "%s/%s_hit1.wav", MeleeLocationSounds, Melee_Models[ i ] )
		precache_sound( buffer )
		ArrayPushString( a_Melee_SoundHit, buffer )
		
		formatex( buffer, charsmax( buffer ), "%s/%s_stab.wav", MeleeLocationSounds, Melee_Models[ i ] )
		precache_sound( buffer )
		ArrayPushString( a_Melee_SoundStab, buffer )
		
		formatex( buffer, charsmax( buffer ), "%s/%s_deploy.wav", MeleeLocationSounds, Melee_Models[ i ] )
		precache_sound( buffer )
		ArrayPushString( a_Melee_SoundDraw, buffer )
	}
}

public plugin_init( ) 
{
	Licence( );

	register_plugin( PLUGIN, VERSION, "Cristi. C" );
	
	RegisterHam( Ham_Item_Deploy, "weapon_knife", "fw_Knife_Deploy", 1 );
	RegisterHam( Ham_TakeDamage, "player", "fw_TakeDamage" );
	RegisterHam( Ham_TraceAttack, "player", "fw_TraceAttack", 1 );
	
	register_forward( FM_EmitSound, "fw_EmitSound" );
	
	register_clcmd( "say /knife", "clcmd_knife" );
	register_clcmd( "knife_menu", "clcmd_knife" );
}

public client_putinserver( id )
{
	g_iKnife[ id ] = 0;
}

public fw_Knife_Deploy( const knife )
{
	if( pev_valid( knife ) != 2 )
	{
		return;
	}

	new id = get_pdata_cbase( knife, m_pPlayer, XO_WEAPON );
	
	if( !is_user_alive( id ) || zp_get_user_zombie( id ) )
	{
		return;
	}
	
	new __knife;
	if( ( __knife = g_iKnife[ id ] ) != -1 )
	{
		new szModel[ 33 ];
		ArrayGetString( a_Melee_ModelV, __knife, szModel, charsmax(szModel))
		set_pev( id, pev_viewmodel2, szModel );
		
		ArrayGetString( a_Melee_ModelP, __knife, szModel, charsmax(szModel))
		set_pev( id, pev_weaponmodel2, szModel );
	}
}

public fw_TakeDamage( victim, inflictor, attacker, Float:damage, damage_type )
{
	if( !is_user_alive( attacker ) || zp_get_user_zombie( attacker ) )
	{
		return;
	}
	
	static __knife;
	if( get_user_weapon( attacker ) == CSW_KNIFE && ( __knife = g_iKnife[ attacker ] ) != -1 )
	{
		SetHamParamFloat( 4, damage * Melee_Damage[ __knife ] );
	}
}

// Ham Trace Attack Forward
public fw_TraceAttack( victim, attacker, Float:damage, Float:direction[ 3 ], tracehandle, damage_type )
{
	// Non-player damage or self damage
	if (victim == attacker || !is_user_alive(attacker) || zp_get_user_zombie( attacker ) )
		return;
	
	if( !zp_get_user_zombie( victim ) )
		return;

	static __knife;
	if( get_user_weapon( attacker ) == CSW_KNIFE && ( __knife = g_iKnife[ attacker ] ) != -1 )
	{
		if( Melee_KnockBack[__knife] <= 0.0 )
			return;
	
		// Get victim's velocity
		static Float:velocity[ 3 ]
		pev(victim, pev_velocity, velocity )
		
		direction[ 0 ] *= Melee_KnockBack[ __knife ];
		direction[ 1 ] *= Melee_KnockBack[ __knife ];
		direction[ 2 ] *= Melee_KnockBack[ __knife ];
		
		velocity[ 0 ] += direction[ 0 ]
		velocity[ 1 ] += direction[ 1 ]
		velocity[ 2 ] += direction[ 2 ]
		
		// Set the knockback'd victim's velocity
		set_pev( victim, pev_velocity, direction )
	}
}

public fw_EmitSound( id, channel, const sample[ ], Float:volume, Float:attn, flags, pitch )
{
	if( !is_user_alive( id ) || zp_get_user_zombie( id ) )
	{
		return FMRES_IGNORED;
	}
	
	if ( sample[ 8 ] == 'k' && sample[ 9 ] == 'n' && sample[ 10 ] == 'i' )
	{
		new __knife, sound[ 64 ];
		if( ( __knife = g_iKnife[ id ] ) != -1 )
		{
			if (sample[ 14 ] == 's' && sample[15] == 'l' && sample[16] == 'a') // slash
			{
				ArrayGetString( a_Melee_SoundMiss, __knife, sound, charsmax( sound ) )
				emit_sound( id, channel, sound, volume, attn, flags, pitch )
				return FMRES_SUPERCEDE;
			}
			if ( sample[ 14 ] == 'h' && sample[ 15 ] == 'i' && sample[ 16 ] == 't' ) // hit
			{
				if ( sample[ 17 ] == 'w' ) // wall
				{
					ArrayGetString( a_Melee_SoundHWall, __knife, sound, charsmax( sound ) )
					emit_sound( id, channel, sound, volume, attn, flags, pitch )
					return FMRES_SUPERCEDE;
				}
				else
				{
					ArrayGetString( a_Melee_SoundHit, __knife, sound, charsmax( sound ) )
					emit_sound(id, channel, sound, volume, attn, flags, pitch )
					return FMRES_SUPERCEDE;
				}
			}
			if ( sample[ 14 ] == 's' && sample[ 15 ] == 't' && sample[ 16 ] == 'a' ) // stab
			{
				ArrayGetString( a_Melee_SoundStab, __knife, sound, charsmax( sound ) )
				emit_sound( id, channel, sound, volume, attn, flags, pitch )
				return FMRES_SUPERCEDE;
			}
			
			if ( sample[ 14 ] == 'd' && sample[ 15 ] == 'e' && sample[ 16 ] == 'p' ) // deploy
			{
				ArrayGetString( a_Melee_SoundDraw, __knife, sound, charsmax( sound ) )
				emit_sound( id, channel, sound, volume, attn, flags, pitch )
				return FMRES_SUPERCEDE;				
			}
		}
	}
	return FMRES_IGNORED;
}

// Items Menu
show_items_menu( id )
{
	static menu[ 128 ];
	new menuid, i, itemdata[ 2 ]
	
	menuid = menu_create( "Equipment: Knifes\r", "menu_knifes" )
	
	for( i = 0; i < sizeof ( Melee_Models ); i ++ )
	{
		formatex( menu, charsmax( menu ), "%s", Melee_Names[ i ] )
		
		itemdata[ 0 ] = i
		itemdata[ 1 ] = 0
		menu_additem( menuid, menu, itemdata )
	}
	
	// No items to display?
	if (  menu_items( menuid  ) <= 0 )
	{
		client_print( id, print_chat, "No knifes available." )
		menu_destroy( menuid )
		return;
	}
	
	// Back - Next - Exit
	menu_setprop( menuid, MPROP_BACKNAME, "Back" )
	menu_setprop( menuid, MPROP_NEXTNAME, "Next" )
	menu_setprop( menuid, MPROP_EXITNAME, "Exit" )
	
	// Fix for AMXX custom menus
	set_pdata_int( id, 205, 0 )
	menu_display( id, menuid )
}

public menu_knifes( id, menuid, knife )
{
	if ( knife == MENU_EXIT )
	{
		menu_destroy( menuid )
		return PLUGIN_HANDLED;
	}
	
	new itemdata[ 2 ], dummy, knifeid;
	menu_item_getinfo(menuid, knife, dummy, itemdata, charsmax( itemdata ), _, _, dummy )
	knifeid = itemdata[ 0 ];
	
	if( Melee_OnlyVip[ knifeid ] != 0 )
	{
		//if( !( zv_get_user_flags( id ) & ZV_UNLIMITED ) )
		if( !( get_user_flags( id ) & ADMIN_LEVEL_H ) )
		{
			menu_destroy( menuid  );
			show_items_menu( id )
			return PLUGIN_HANDLED;
		}
	}
	
	g_iKnife[ id ] = knifeid
	menu_destroy( menuid )
	
	if( get_user_weapon( id ) == CSW_KNIFE )
	{
		fw_Knife_Deploy( fm_cs_get_current_weapon_ent( id ) )
	}

	return PLUGIN_HANDLED;
}

public clcmd_knife( id )
{
	show_items_menu( id )
}

fm_cs_get_current_weapon_ent( id )
{
	if ( pev_valid( id ) != 2 )
		return -1;
	
	return get_pdata_cbase( id, 373 );
}
mad--
Membru, skill 0
Membru, skill 0
Posts: 11
Joined: 05 Jul 2021, 19:48
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

15 Jul 2021, 17:10

up !
User avatar
A k c 3 n 7
Super moderator
Super moderator
Posts: 5138
Joined: 25 Aug 2014, 21:31
Detinator Steam: Da
CS Status: who dares wins
SteamID: Jandarmeria
Reputatie: Super moderator
Moderatorul anului 2023
Fost Membru Club eXtreamCS ( o luna )
Fost eXtream Mod
Fost Intermediar
Nume anterior: Sorinel
Fond eXtream: 0
Location: Unknown
Discord: remusakcent
Has thanked: 4 times
Been thanked: 46 times

15 Jul 2021, 19:15

Stergi linia #include Licence si Licence din plugin init
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests