[CERERE] - SKIN ALOCAT.

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
kEnT3D
Membru, skill +1
Membru, skill +1
Posts: 134
Joined: 24 Jul 2012, 20:44
Detinator Steam: Nu
CS Status: Tu, Eu, Ea și Antonia.
Detinator server CS: Da.
SteamID: STEAM:0:0.
Location: Timișoara.
Has thanked: 2 times
Been thanked: 6 times
Contact:

29 Jul 2012, 17:34

Salut. Uite, am venit și eu cu o cerere destul de grea zic eu. Hai să vă spun despre ce este vorba.

Detalii: Poate cineva să aloce skin-uri pe clasa acestui plugin? Acum când se schimbă clasa rămâne skin-ul clasei de la echipă. Aș vrea să aloc (de exemplu) skin-ul 'x' lui Goku, skin-ul 'y' lui Gohan și așa mai departe.
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <orpheu_memory>
#include <orpheu>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>

/******************************************************************************************
*		      _____        ______       ________				  *
*		     |  __  \     |   _  \     |_____  /				  *
*                    | |  \ |     | _____/         / /					  *
*                    | |  | |     |  _  \        / /					  *
*                    | |__/ |     | |_\  |     /  /_____				  *
*                    |_____/      |_____/    /________/					  *
*											  *
*											  *
*                        -  ~ By EnterPrice62 ~ -					  *
*         										  *
*          Change Log:									  *
*        										  *
*          v1.0: 				  				  	  *
*               - Create Plugin								  *
*											  *
*	   v1.1:									  *
*               - Fix Some Bugs								  *
*               - Added More Cvars							  *
*											  *
*          v1.2:									  *
*	        - Added Infinite Round ( Orpheu )					  *
*               - Added Respawn Players							  *
*											  *
*          v1.3:									  *
*               - Added A Class More To CTS/TTS						  *
*               - Added Respawn Player Protection					  *
*											  *
*          v1.4:									  *
*               - Remove 14 Entities							  *
*               - Fix Block Buy								  *
*               - Can Show The Damage With a Kamehameha					  *
*               - Optimize the plugin							  *
*											  *
*											  *
*		        ~ Requeriments ~				         	  *
*											  *
*		*-   Orpheu Files							  * 
*											  *
*											  *
*											  *
******************************************************************************************/

// Good class
enum _:GOOD
{ 
	Goku,
	Vegeta,
	Trunks,
	Gohan
} 

// Villan Class
enum _:VILLAN
{
	Freezer, 
	Cell,
	Dabura,
	MaginBoo
}

// Evolution ( for damage )
enum EVOLUTION
{
	NORMAL,
	SSJ1,
	SSJ2,
	SSJ3
}
// Good class Names
new const g_GoodNames[ GOOD ][] = 
{ 
	"Goku", 
	"Vegeta",
	"Trunks",
	"Gohan"
}; 

// Villan class Names
new const g_VillanNames[ VILLAN ][] =
{	
	"Freezer", 
	"Cell",
	"Dabura",
	"Magin Boo"
}

// Evolution Names
new const g_EvolutionName[ EVOLUTION ][] =
{
	"Normal",
	"Super Saiyan 1",
	"Super Saiyan 2",
	"Super Saiyan 3 [ Last ]"
}

// Bomb classnames
new const szClassName[][] = 
{
	"func_buyzone",
	"armoury_entity",
	"func_bomb_target",
	"info_bomb_target",
	"hostage_entity",
	"monster_scientist",
	"func_hostage_rescue",
	"info_hostage_rescue",
	"info_vip_start",
	"func_vip_safetyzone",
	"func_escapezone",
	"info_map_parameters",
	"player_weaponstrip",
	"game_player_equip"
}

// Precache Wavs
new const DBZWavs[][] =
{
	"dbz/plasma_shoot.wav",
	"dbz/explosion.wav"
}

// OFFSETS game.
const RESPAWNTIME =				2
const PROTECTIONTIME =				3

// Defines
#define PlayerTeam(%1)		g_Team[id] == %1
#define SetpData(%1)		set_pdata_int( %1, 125, get_pdata_int(%1, 125) & ~(1<<8) )

/*******************************= GAME AND PLAYER VARS= **********************************/
new EVOLUTION:PlayerLevel[33];

new Float:LevelDamageMultiplier[ EVOLUTION ] = { _:1.0,_:6.0,_:10.0,_:13.0 }

new CsTeams:g_Team[33];
new GoodRandomClass[33]
new VillanRandomClass[33]
new g_iKamehameha[33]
new KIReady[33]
new g_KI[33]
new g_iCountdown[33]
	
new gTrailModel
new gExplosionModel
new g_iMaxPlayers
new g_iMsgSayText
new g_msgHideWeapon
new g_fwEntitySpawn
new g_MsgRoundTime
new g_PluginON
new Class
new iClass
new GokuHealth
new GokuGravity
new GokuSpeed
new VegetaHealth
new VegetaGravity
new VegetaSpeed
new TrunksHealth
new TrunksGravity
new TrunksSpeed
new GohanHealth
new GohanGravity
new GohanSpeed
new FreezerHealth
new FreezerGravity
new FreezerSpeed
new CellHealth
new CellGravity
new CellSpeed
new DaburaHealth
new DaburaGravity
new DaburaSpeed
new MaginBooHealth
new MaginBooGravity
new MaginBooSpeed
new PcvarRespawnTime
new PcvarProtectionTime
new ClassSelect

new g_Class[33][ GOOD ];
new g_iClass[33][ VILLAN ];

/*****************************************************************************************/

public plugin_init()
{
	register_plugin( "Dragon Ball Z ~ Mode", "1.4" , "EnterPrice62" )
	
	g_PluginON = register_cvar( "dbz_on", "1" )
	
	if( !get_pcvar_num(g_PluginON) )
		return;
		
	register_dictionary( "DragonBallZ.txt" ) // Lang
	
	RegisterHam( Ham_TakeDamage, "player", "fw_TakeDamage" )
	RegisterHam( Ham_Killed, "player", "fw_PlayerKilled" )
	RegisterHam( Ham_Spawn, "player", "Fw_PlayerSpawn", 1 )
	RegisterHam( Ham_Touch, "weaponbox", "fw_TouchWeapon" )
	RegisterHam( Ham_Touch, "armoury_entity", "fw_TouchWeapon" )
	RegisterHam( Ham_Touch, "weapon_shield", "fw_TouchWeapon" )
	
	// Goku Habilities
	GokuHealth = register_cvar( "dbz_goku_health", "160" )
	GokuGravity = register_cvar( "dbz_goku_gravity", "0.6" )
	GokuSpeed = register_cvar( "dbz_goku_speed", "350.0" )
	
	// Vegeta Habilities
	VegetaHealth = register_cvar( "dbz_vegeta_health", "130" )
	VegetaGravity = register_cvar( "dbz_vegeta_gravity", "0.3" )
	VegetaSpeed = register_cvar( "dbz_vegeta_speed", "370.0" )
	
	// Trunks Habilities
	TrunksHealth = register_cvar( "dbz_trunks_health", "150" )
	TrunksGravity = register_cvar( "dbz_trunks_gravity", "0.4" )
	TrunksSpeed = register_cvar( "dbz_trunks_speed", "385.0" )
	
	// Gohan Habilities
	GohanHealth = register_cvar( "dbz_gohan_health", "145" )
	GohanGravity = register_cvar( "dbz_gohan_gravity", "0.5" )
	GohanSpeed = register_cvar( "dbz_gohan_speed", "400.0" )
	
	// Freezer Habilities
	FreezerHealth = register_cvar( "dbz_freezer_health", "170" )
	FreezerGravity = register_cvar( "dbz_freezer_gravity", "0.8" )
	FreezerSpeed = register_cvar( "dbz_freezer_speed", "360.0" )
	
	// Cell Habilities
	CellHealth = register_cvar( "dbz_cell_health", "135" )
	CellGravity = register_cvar( "dbz_cell_gravity", "0.2" )
	CellSpeed = register_cvar( "dbz_cell_speed", "375.0" )
	
	// Dabura Habilities
	DaburaHealth = register_cvar( "dbz_dabura_health", "120" )
	DaburaGravity = register_cvar( "dbz_dabura_gravity", "0.6" )
	DaburaSpeed = register_cvar( "dbz_dabura_speed", "410.0" )
	
	// Magin Boo Habilities
	MaginBooHealth = register_cvar( "dbz_maginboo_health", "200" )
	MaginBooGravity = register_cvar( "dbz_maginboo_gravity", "0.7" )
	MaginBooSpeed = register_cvar( "dbz_maginboo_speed", "385.0" )
	
	PcvarRespawnTime = register_cvar( "dbz_respawntime", "" )
	PcvarProtectionTime = register_cvar( "dbz_protection", "" )
	
	g_MsgRoundTime = get_user_msgid( "RoundTime" )
	g_msgHideWeapon = get_user_msgid( "HideWeapon" )
	g_iMsgSayText = get_user_msgid( "SayText" )
	g_iMaxPlayers = get_maxplayers()
	
	set_pcvar_num( PcvarRespawnTime, RESPAWNTIME )
	set_pcvar_num( PcvarProtectionTime, PROTECTIONTIME )
	
	register_clcmd( "say", "CmdHookSay" )
	
	register_touch( "_Kamehameha","*","KamehamehaHIT" )
	
	register_event( "CurWeapon", "EventCurWeapon", "be" )
	register_event( "ResetHUD", "EventResetHud", "be" )
	register_event( "TeamInfo", "PlayerJoinTeam", "a" )
	
	register_forward( FM_ClientKill, "FwdClientKill" )
	unregister_forward( FM_Spawn, g_fwEntitySpawn ) 
	
	register_message( g_MsgRoundTime, "MsgRoundTime")
		
	set_task( 300.0, "DisplayHelpMessage",_,_,_, "b")
	set_task( 2.0, "IncreasingKI",_,_,_, "b" )
	set_task( 0.1, "ShowPlayerKi",_,_,_, "b" )
	
	GameForwards()
}


// Unlimited Round
public GameForwards() <> {}
public GameForwards() <disabled>
{
	OrpheuRegisterHook(OrpheuGetFunction("CheckMapConditions", "CHalfLifeMultiplay"), "game_blockConditions")
	OrpheuRegisterHook(OrpheuGetFunction("CheckWinConditions", "CHalfLifeMultiplay"), "game_blockConditions")

	if(is_linux_server())
		OrpheuRegisterHook(OrpheuGetFunction("HasRoundTimeExpired", "CHalfLifeMultiplay"), "game_blockConditions")

	else
		game_memoryReplace("roundTimeCheck", {0x90, 0x90, 0x90})

	state enabled
}

public OrpheuHookReturn:game_blockConditions() <>
	return OrpheuIgnored

public OrpheuHookReturn:game_blockConditions() <enabled>
{
	OrpheuSetReturn(false)

	return OrpheuSupercede
}

game_memoryReplace(szID[], const iBytes[], const iLen = sizeof iBytes)
{
	new iAddress

	OrpheuMemoryGet(szID, iAddress)

	for( new i; i < iLen; i++ )
	{
		OrpheuMemorySetAtAddress( iAddress, "roundTimeCheck|dummy", 1, iBytes, iAddress )
		iAddress++
	}

	server_cmd("sv_restart 1")
}

// Precache sounds and sprites.
public plugin_precache()
{
	precache_model("sprites/dbz/plasma.spr")
	
	for( new i = 0; i < sizeof ( DBZWavs ); i++ )
		precache_sound(DBZWavs)

	gTrailModel = precache_model("sprites/dbz/laserbeam.spr")
	gExplosionModel = precache_model("sprites/dbz/plasma_explode.spr")
	
	g_fwEntitySpawn = register_forward( FM_Spawn, "fw_EntitySpawn" ) 
	
	new iEnt = create_entity( szClassName[11] )

	if( iEnt )
	{
		DispatchKeyValue( iEnt, "buying", "3" )
		DispatchSpawn( iEnt )
	}
}

// Player class when he is entered in the server
public client_putinserver( id )
{
	GoodRandomClass[id] = random_num( 1, 4 ) // Good Class
	VillanRandomClass[id] = random_num( 1, 4 ) // Villan Class
	
	// Random Class
	switch ( GoodRandomClass[id] )
	{
		case 1: ChangeClass( id, Goku )
		case 2: ChangeClass( id, Vegeta )
		case 3: ChangeClass( id, Trunks )
		case 4: ChangeClass( id, Gohan )
	}
	switch ( VillanRandomClass[id] )
	{
		case 1: ChangeClass( id, Freezer )
		case 2: ChangeClass( id, Cell )
		case 3: ChangeClass( id, Dabura )
		case 4: ChangeClass( id, MaginBoo )
	}
}

// When the player spawn...
public Fw_PlayerSpawn( id )
{
	g_Team[id] = cs_get_user_team(id)
	
	if( PlayerTeam( CS_TEAM_T ) || PlayerTeam( CS_TEAM_CT ) )
	{
		if( is_user_alive( id ) )
		{
			fm_strip_user_weapons( id )
			fm_give_item(id, "weapon_knife" )
			
			ChangeClass( id , ClassSelect );
		}
	}
	
	ColorChat(id, "!g[DBZ] !y%L: !g%s" ,id, "ML_CURRENT_CLASS", (PlayerTeam( CS_TEAM_CT )) ? g_GoodNames[ g_Class[id][Class] ] : g_VillanNames[ g_iClass[id][iClass] ] )
}

// Block touch weapons
public fw_TouchWeapon(weapon, id)
{
	if ( !is_user_connected(id) )
		return HAM_IGNORED;
	
	if ( id && !is_user_bot(id) )
		return HAM_SUPERCEDE;
	
	return HAM_IGNORED;
}

// Increase Damage according the evolution
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
	SetHamParamFloat( 4, damage * LevelDamageMultiplier[PlayerLevel[attacker]] )
	return FMRES_IGNORED;
}  

// Block Kill
public FwdClientKill(id) 
{
	return FMRES_SUPERCEDE;
}

// Remove c4 bomb
public fw_EntitySpawn( Entity )
{
	if ( !pev_valid(Entity) )
		return FMRES_IGNORED;
	
	new iClassname[32]
	pev( Entity, pev_classname, iClassname, sizeof iClassname - 1 )
	
	for ( new i = 0; i < sizeof szClassName; i++ )
	{
		if ( equal( iClassname, szClassName) )
		{
			engfunc( EngFunc_RemoveEntity, Entity )
			return FMRES_SUPERCEDE;
		}
	}
	
	return FMRES_IGNORED;
}

// Respawn player killed.
public fw_PlayerKilled(victim, attacker, shouldgib)
{
	set_task( get_pcvar_float(PcvarRespawnTime), "PlayerRespawn", victim )
}

// Show the KI of player, and check if he is using IN_USE to launch a kamehameha
public ShowPlayerKi()
{
	for( new id = 1; id <= g_iMaxPlayers; id++ )
	{
		if( g_KI[id] < 0 )
			g_KI[id] = 0
		if( g_KI[id] > 100 )
			g_KI[id] = 100
			
		if( is_user_alive( id ) )
		{
			new szMessage[128]
			fKIStr(id,szMessage,127)
			
			set_hudmessage(0, 0, 255, -1.0, 0.9, 0, 6.0, 12.0)
			show_hudmessage( id, szMessage )
			
			new INT = entity_get_int( id, EV_INT_button )
			
			if( g_KI[id] >= 100 ) 
			{
				g_iKamehameha[id] = 1
				
				if(INT & IN_USE )
				{
					g_KI[id] = 0
					KameHameHaShoot(id)
					
					client_print( id, print_center, "%L", id, "ML_KAMEKAMEHA" )
				}
			}			
			else if( g_KI[id] < 100 && (INT & IN_USE) )
			{	
				ColorChat(id,"!g[DBZ] !y%L", id, "ML_NO_HAVE_KI" )
				return PLUGIN_HANDLED;
			}
		}
		
		switch( get_user_frags( id ) )
		{
			case 4..12: PlayerLevel[id] = SSJ1
			case 13..22: PlayerLevel[id] = SSJ2
			case 23..30: PlayerLevel[id] = SSJ3
			
			default: PlayerLevel[id] = NORMAL
		}
	}
	
	return PLUGIN_CONTINUE;
}	

fKIStr( id, Str[], iLen )
{
	new Float:flKI = float(g_KI[id])/10.0, iKI = floatround(flKI) * 10
		
	new MYClass[33]
	copy( MYClass[id], charsmax( MYClass), PlayerTeam( CS_TEAM_CT ) ? g_GoodNames[ g_Class[id][Class] ] : g_VillanNames[ g_iClass[id][iClass] ] )
	
	new MyStatus[33]
	copy( MyStatus[id], charsmax( MyStatus ), g_EvolutionName[PlayerLevel[id]] )
		
	switch(iKI)
	{
		case 0 : format( Str, iLen, "KI: 0%% ^n [ ========== ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 10 : format( Str, iLen, "KI: 10%% ^n [ 0========= ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 20 : format( Str, iLen, "KI: 20%% ^n [ 00======== ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 30 : format( Str, iLen, "KI: 30%% ^n [ 000======= ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 40 : format( Str, iLen, "KI: 40%% ^n [ 0000====== ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 50 : format( Str, iLen, "KI: 50%% ^n [ 00000===== ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 60 : format( Str, iLen, "KI: 60%% ^n [ 000000==== ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 70 : format( Str, iLen, "KI: 70%% ^n [ 0000000=== ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 80 : format( Str, iLen, "KI: 80%% ^n [ 00000000== ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 90 : format( Str, iLen, "KI: 90%% ^n [ 000000000= ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		case 100 : format( Str, iLen, "KI: 100%% ^n [ 0000000000 ] ^n %L: %s | %L: %s", id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
		
		default : format( Str, iLen,"KI: [ %i%% ] ^n %L: %s | %L: %s", g_KI[id], id, "ML_CLASS", MYClass[id], id, "ML_STATUS", MyStatus[id] )
	}
	
	return PLUGIN_CONTINUE
}

// Increase KI
public IncreasingKI()
{
	for( new id = 1; id <= g_iMaxPlayers; id ++)
	{
		if( is_user_alive( id ) )
		{
			if( g_KI[id] < 100 )
			{
				KIReady[id] = 0
				
				if( KIReady[id] < 1 )
				{
					g_KI[id] += 10
					
					new iColor1 = PlayerTeam( CS_TEAM_CT ) ? 255 : 0
					
					fm_set_rendering(id, kRenderFxGlowShell, 255, iColor1, 0, kRenderNormal, 25)
					
					client_print( id, print_center, "[DBZ] %L: %d %%", id, "ML_INCREASE_KI", g_KI[id] )  
				}
			}
			else
			{
				KIReady[id]++;
				
				if( KIReady[id] == 1 )
				{
					fm_set_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25)
					
					client_print( id, print_center, "[DBZ] %L", id, "ML_KI_IS_ALREDY_COMPLETE" )
					return PLUGIN_HANDLED
				}
			}
		}
	}
	
	return PLUGIN_HANDLED;
}
	
// Kamehameha Shoot
public KameHameHaShoot(id)
{
	new Ka = g_iKamehameha[id]
	if( Ka > 0 )
	{
		Ka = Ka - 1
		
		new Origin[3], Float:fOrigin[3]
		new Float:Velocity[3] 
		
		get_user_origin( id,Origin, 1 )
		IVecFVec( Origin, fOrigin )
		
		new iKameHameHa = create_entity("info_target")
		entity_set_string( iKameHameHa, EV_SZ_classname, "_Kamehameha" )
		
		new Float:posAdjust[ 3 ]
		velocity_by_aim( id, 70, posAdjust )
		
		fOrigin[ 0 ] += posAdjust[ 0 ]
		fOrigin[ 1 ] += posAdjust[ 1 ]
		fOrigin[ 2 ] += posAdjust[ 2 ]
		
		entity_set_vector( iKameHameHa, EV_VEC_origin,fOrigin )
		
		new Float:iMaxs[3] = { 0.2,0.2,0.5 }
		new Float:iMins[3] = { -0.2,-0.2,-0.5 }
		
		entity_set_size( iKameHameHa, iMins,iMaxs )
		
		entity_set_int( iKameHameHa, EV_INT_solid, SOLID_BBOX )
		entity_set_int( iKameHameHa, EV_INT_movetype, MOVETYPE_FLYMISSILE )
		entity_set_int( iKameHameHa, EV_INT_rendermode, 5 )
		
		entity_set_float( iKameHameHa, EV_FL_renderamt, 255.0 )
		entity_set_float( iKameHameHa, EV_FL_scale, 1.20 )
		entity_set_float( iKameHameHa, EV_FL_framerate,1.0 )
		
		entity_set_model( iKameHameHa, "sprites/dbz/plasma.spr" )
		emit_sound( iKameHameHa, CHAN_AUTO, "dbz/plasma_shoot.wav", 1.0, ATTN_NORM, 0, PITCH_NORM )
		VelocityByAim( id,1150, Velocity )
		entity_set_vector( iKameHameHa,EV_VEC_velocity,Velocity )
		entity_set_edict( iKameHameHa, EV_ENT_owner, id )
		
		message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
		write_byte( 22 )
		write_short( iKameHameHa )
		write_short( gTrailModel )
		write_byte( 25 ) 
		write_byte( 7 )
		write_byte( 42 )
		write_byte( 170 )
		write_byte( 255 )
		write_byte( 255 )
		message_end( )
		
		return PLUGIN_HANDLED;
	} 
	else
	{
		set_hudmessage( 0,30,200,-1.0,0.75,0,3.0,10.0,0.15,0.5,1 )
		show_hudmessage( id, "%L", id, "ML_NO_MORE_KAMEHAMEHA" )
		
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_HANDLED;
}

// Kamehameha Damage/Hit
public KamehamehaHIT( iKameHameHa,Other )
{
	if( Other == 0 )
	{
		new Float:fOrigin[3]
		new iOrigin[3]
		
		entity_get_vector( iKameHameHa, EV_VEC_origin, fOrigin )
		
		FVecIVec( fOrigin, iOrigin )
		
		message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
		write_byte( 23 )
		write_coord( iOrigin[0] )
		write_coord( iOrigin[1] )
		write_coord( iOrigin[2] )
		write_short( gExplosionModel )
		write_byte( 3 )
		write_byte( 12 )
		write_byte( 210 )
		message_end( )
		
		emit_sound( iKameHameHa, CHAN_AUTO, "dbz/explosion.wav", 1.0, ATTN_NORM, 0, PITCH_NORM )
		
		remove_entity( iKameHameHa )
	}
	else if( is_user_connected(Other) )
	{
		new iAttacker = entity_get_edict( iKameHameHa,EV_ENT_owner )
		
		if( get_user_team(Other) != get_user_team(iAttacker) )
		{
			new Bodypart,iWeapon[32];
			
			new Float:Dmg = random_float(70.0, 90.0)
			fakedamage( Other, "Terminator", Dmg, 1 )
			
			new szName[33]
			get_user_name( Other, szName, 32 )
			
			ColorChat( 0, "!g[DBZ] !y%L", 0, "ML_DAMAGE_RECIBED",szName, Dmg)
			
			if( !is_user_alive( Other ) )
			{
				make_deathmsg( iAttacker, Other, Bodypart,iWeapon )
				fm_set_user_frags( iAttacker, get_user_frags(iAttacker) + 1 )
			}
			
			new Float:fOrigin[3]
			new iOrigin[3]
			
			entity_get_vector( iKameHameHa, EV_VEC_origin, fOrigin )
			
			FVecIVec( fOrigin, iOrigin )
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
			write_byte( 23 )
			write_coord( iOrigin[0] )
			write_coord( iOrigin[1] )
			write_coord( iOrigin[2] )
			write_short( gExplosionModel )
			write_byte( 3 )
			write_byte( 12 )
			write_byte( 210 )
			message_end( )
			
			emit_sound( iKameHameHa, CHAN_AUTO, "dbz/explosion.wav", 1.0, ATTN_NORM, 0, PITCH_NORM )
			client_cmd( Other,"spk dbz/bc_spithit2" )
			client_cmd( iAttacker,"spk dbz/bc_spithit2" )
			
			remove_entity( iKameHameHa )
		}
		else
		{
			new Float:fOrigin[3]
			new iOrigin[3]

			entity_get_vector( iKameHameHa, EV_VEC_origin, fOrigin )
			
			FVecIVec( fOrigin, iOrigin )
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
			write_byte( 23 )
			write_coord( iOrigin[0] )
			write_coord( iOrigin[1] )
			write_coord( iOrigin[2] )
			write_short( gExplosionModel )
			write_byte( 3 )
			write_byte( 12 )
			write_byte( 210)
			message_end( )
			
			emit_sound( iKameHameHa, CHAN_AUTO, "dbz/explosion.wav", 1.0, ATTN_NORM, 0, PITCH_NORM )
			remove_entity( iKameHameHa )
		}
	}
	else
	{
		new Float:fOrigin[3]
		new iOrigin[3]
		
		entity_get_vector( iKameHameHa, EV_VEC_origin, fOrigin )
		
		FVecIVec( fOrigin, iOrigin )
		
		message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
		write_byte( 23 )
		write_coord( iOrigin[0] )
		write_coord( iOrigin[1] )
		write_coord( iOrigin[2] )
		write_short( gExplosionModel )
		write_byte( 3 )
		write_byte( 12 )
		write_byte( 210 )	
		message_end( )
		
		emit_sound( iKameHameHa, CHAN_AUTO, "dbz/explosion.wav", 1.0, ATTN_NORM, 0, PITCH_NORM )
		
		remove_entity( iKameHameHa )
	}
}

// Hook say comands
public CmdHookSay( id )
{
	new szSay[192]
	read_args( szSay, 191 )
	remove_quotes( szSay )
	
	if( containi( szSay, "help") != -1 )
		DisplayDbzHelp(id)
	else if( containi( szSay, "class" ) != -1 )
		cmdPlayerSelect(id)
}	

// Timeleft ARG_SHORT
public MsgRoundTime()
	set_msg_arg_int(1, ARG_SHORT, get_timeleft())

// Event CurWeapon
public EventCurWeapon( id )
{
	new weaponID = read_data(2)

	if(weaponID != CSW_KNIFE)
		return PLUGIN_CONTINUE
	
	SetOthersToFighters( id )
	
	return PLUGIN_CONTINUE 
}
// Remove Money HUD
public EventResetHud(id)
{
	if(is_user_bot(id))
		return;
		
	message_begin( MSG_ONE_UNRELIABLE, g_msgHideWeapon, {0, 0, 0}, id )
	write_byte( 32 )
	message_end( )
}  

// Plaeyr JoinTeam
public PlayerJoinTeam()
{
	new id = read_data(1)
	
	new szTeam[2]
	read_data(2, szTeam, charsmax(szTeam))

	switch(szTeam[0])
	{
		case 'T': set_task( get_pcvar_float(PcvarRespawnTime), "PlayerRespawn", id )

		case 'C': set_task( get_pcvar_float(PcvarRespawnTime), "PlayerRespawn", id )

		case 'U': SetpData(id)

		default: SetpData(id)
	}
}

public PlayerRespawn( id )
{
	if( is_user_alive(id) )
		return

	set_hudmessage( 0, 255, 0, -1.0, 0.6, 2, 0.5, 0.1, 0.0, 1.0, 1 )
	show_hudmessage(id, "%L", id, "ML_HUD_RESPAWN" )

	entity_set_int(id, EV_INT_deadflag, DEAD_RESPAWNABLE)
	entity_set_int(id, EV_INT_iuser1, 0)
	call_think(id)
	DispatchSpawn(id)
	
	fm_set_user_health( id, 100 )
	
	g_iCountdown[id] = get_pcvar_num( PcvarProtectionTime )
	
	set_task( 3.0, "PlayerProtection", id )
}

public PlayerProtection(id )
{
	static iStart
	iStart = g_iCountdown[id]
	
	iStart--

	fm_set_user_godmode( id, 1 )
	
	if( iStart >= get_pcvar_num( PcvarProtectionTime ) )
	{
		set_hudmessage( 0, 255, 0, -1.0, 0.6, 2, 0.5, 0.1, 0.0, 1.0, 1 )
		show_hudmessage( id, "%L", id, "ML_HUD_PROTECTION", iStart )

		set_task( 1.0, "PlayerProtection", id  )
	}
	else
	{
		set_hudmessage( 255, 255, 0, -1.0, 0.6, 2, 0.5, 0.1, 0.0, 1.0, 1 )
		show_hudmessage(id, "%L", id, "ML_HUD_PROTECTION_EXPIRED")
		
		fm_set_user_godmode( id, 0 )
	}
	
}
// Menu of fighters
public cmdPlayerSelect( id ) 
{ 
	static szItem[64]
	
	formatex( szItem, charsmax(szItem), "%L", id, "ML_MENU_TITLE" )
	new iMenu = menu_create( szItem , "HandleClassMenu" );
	
	new szNum[ 3 ], i, iCheck = PlayerTeam( CS_TEAM_CT )
	
	static szSizeof
	szSizeof = iCheck ? (sizeof g_GoodNames) : ( sizeof g_VillanNames )
    
	for ( i = 0 ; i < szSizeof ; i++ )
	{
		num_to_str( i , szNum , charsmax( szNum ) );
		menu_additem( iMenu , iCheck ? g_GoodNames[ i ] : g_VillanNames, szNum , 0 );
	}
    
	formatex( szItem, charsmax(szItem), "%L", id, "ML_EXIT" )
	menu_setprop( iMenu, MPROP_EXITNAME, szItem )
	menu_setprop( iMenu , MPROP_EXIT , MEXIT_ALL ); 
	menu_display( id , iMenu , 0 );
	
	return PLUGIN_HANDLED;
} 

public HandleClassMenu( id , iMenu , iItem ) 
{
	new szKey[ 3 ] , iSelectedClass , Dummy;
	menu_item_getinfo( iMenu , iItem , Dummy , szKey , 2 , "" , 0 , Dummy );
	
	iSelectedClass = str_to_num( szKey );
	
	ClassSelect = iSelectedClass
	
	switch( g_Team[id] )
	{
		case CS_TEAM_CT:
		{
			if( g_Class[ id ][ Class ] == iSelectedClass )
			{
				ColorChat(id, "!g[DBZ] !y%L: !g%s", id, "ML_ALREDY_ARE_THAT_CLASS", g_GoodNames[ iSelectedClass ] );
				return PLUGIN_HANDLED;
			}
		}
		case CS_TEAM_T:
		{
			if( g_iClass[ id ][ iClass] == iSelectedClass )
			{
				ColorChat(id, "!g[DBZ] !y%L: !g%s", id, "ML_ALREDY_ARE_THAT_CLASS", g_VillanNames[ iSelectedClass ] );
				return PLUGIN_HANDLED;
			}
		}
	}
	
	ColorChat( id, "!g[DBZ] !y%L", id, "ML_NEXT_CLASS", PlayerTeam( CS_TEAM_CT ) ? g_GoodNames[ClassSelect] : g_VillanNames[ClassSelect] )
	
	return PLUGIN_HANDLED;
} 

public ChangeClass( id , NewClass ) 
{
	if( PlayerTeam( CS_TEAM_CT ) )
		g_Class[ id ][ Class ] = NewClass;
	else
		g_iClass[ id ][ iClass ] = NewClass;
	
	SetHealthToFighters( id )
	SetOthersToFighters( id )
	
	return PLUGIN_HANDLED;  
} 

// Fighters Health
public SetHealthToFighters( id )
{
	/*
	new iLife;
		
	if( PlayerTeam( CS_TEAM_CT ) )
	{
		switch( g_Class[id][Class] )
		{
			case Goku: iLife = get_pcvar_num( GokuHealth )
			case Vegeta: iLife = get_pcvar_num( VegetaHealth )
			case Trunks: iLife = get_pcvar_num( TrunksHealth )
			case Gohan: iLife = get_pcvar_num( GohanHealth )
		}
	}
	else
	{
		
		switch( g_iClass[id][iClass] )
		{
			case Freezer: iLife = get_pcvar_num( FreezerHealth )
			case Cell: iLife = get_pcvar_num( CellHealth )
			case Dabura: iLife = get_pcvar_num( DaburaHealth )
			case MaginBoo: iLife = get_pcvar_num( MaginBooHealth )
		}
	}
	
	fm_set_user_health( id, iLife )
	*/
	
	if( PlayerTeam( CS_TEAM_CT ) )
	{
		new gClass = g_Class[id][Class]
		fm_set_user_health( id, ( gClass == Goku ) ? get_pcvar_num( GokuHealth ) : ( gClass == Vegeta ) ? get_pcvar_num( VegetaHealth ) : ( gClass == Gohan ) ? get_pcvar_num( GohanHealth ) : get_pcvar_num( TrunksHealth) )
	}
	else
	{
		new vClass = g_iClass[id][iClass]
		fm_set_user_health( id, ( vClass == Freezer ) ? get_pcvar_num( FreezerHealth ) : ( vClass == Cell ) ? get_pcvar_num( CellHealth ) : ( vClass == Dabura ) ? get_pcvar_num( DaburaHealth ) : get_pcvar_num( MaginBooHealth ) )
	}
	
}

// Fighters Speed and Gravity
public SetOthersToFighters( id )
{
	/*
	new Float:iGravity, Float:iSpeed;
		
	if( PlayerTeam( CS_TEAM_CT ) )
	{
		switch( g_Class[id][Class] )
		{
			case Goku:
			{
				iGravity = get_pcvar_float( GokuGravity )
				iSpeed = get_pcvar_float( GokuSpeed )
			}
			case Vegeta:
			{
				iGravity = get_pcvar_float( VegetaGravity )
				iSpeed = get_pcvar_float( VegetaSpeed )
			}
			case Trunks:
			{
				iGravity = get_pcvar_float( TrunksGravity )
				iSpeed = get_pcvar_float( TrunksSpeed )
			}
			case Gohan:
			{
				iGravity = get_pcvar_float( GohanGravity )
				iSpeed = get_pcvar_float( GohanSpeed )
			}
		}
	}
	else
	{
		
		switch( g_iClass[id][iClass] )
		{
			case Freezer:
			{
				iGravity = get_pcvar_float( FreezerGravity )
				iSpeed = get_pcvar_float( FreezerSpeed )
			}
			case Cell:
			{
				iGravity = get_pcvar_float( CellGravity )
				iSpeed = get_pcvar_float( CellSpeed )
			}
			case Dabura:
			{
				iGravity = get_pcvar_float( DaburaGravity )
				iSpeed = get_pcvar_float( DaburaSpeed )
			}
			case MaginBoo:
			{
				iGravity = get_pcvar_float( MaginBooGravity )
				iSpeed = get_pcvar_float( MaginBooSpeed )
			}
		}
	}
	
	fm_set_user_gravity( id, iGravity )
	fm_set_user_maxspeed( id, iSpeed )
	*/
	
	if( PlayerTeam( CS_TEAM_CT ) )
	{
		new gClass = g_Class[id][Class]
		
		fm_set_user_gravity( id, ( gClass == Goku ) ? get_pcvar_float( GokuGravity ) : ( gClass == Vegeta ) ? get_pcvar_float( VegetaGravity ) : ( gClass == Gohan ) ? get_pcvar_float( GohanGravity) : get_pcvar_float( TrunksGravity ) )
		fm_set_user_maxspeed( id, ( gClass == Goku ) ? get_pcvar_float( GokuSpeed ) : ( gClass == Vegeta ) ? get_pcvar_float( VegetaSpeed ) : ( gClass == Gohan ) ? get_pcvar_float( GohanSpeed ) : get_pcvar_float( TrunksSpeed ) )
	}
	else
	{
		new vClass = g_iClass[id][iClass]
		
		fm_set_user_gravity( id, ( vClass == Freezer ) ? get_pcvar_float( FreezerGravity ) : ( vClass == Cell ) ? get_pcvar_float( CellGravity ) : ( vClass == MaginBoo ) ? get_pcvar_float( MaginBooGravity) : get_pcvar_float( DaburaGravity ) )
		fm_set_user_maxspeed( id, ( vClass == Freezer ) ? get_pcvar_float( FreezerSpeed ) : ( vClass == Cell ) ? get_pcvar_float( CellSpeed ) : ( vClass == MaginBoo ) ? get_pcvar_float( MaginBooSpeed ) : get_pcvar_float(DaburaSpeed) )
	}
}

// DBZ Help
public DisplayDbzHelp( id )
{
	new Motd[1501],iLen;
	
	iLen = format(Motd, sizeof Motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<center><h2>---- %L ----</h2></center>^n^n", id, "ML_DBZ_TITLE" );
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<font color=#fff000><U><h2>%L:</h2></U>^n", id, "ML_DBZ_SUBTITLE" );
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<UL><LI>%L^n", id, "ML_LAUCH_KAMEHAMEHA");
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<LI>%L^n", id, "ML_INCREASE_DAMAGE_KNIFE");
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<LI>%L^n", id, "ML_EVOLUTION_REQUIRED_FRAGS");
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<LI>%L^n", id, "ML_KAMEHAMEHA_DAMAGE");
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<LI>%L^n", id, "ML_GLOW_KI");
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<LI>%L^n", id, "ML_RELOAD_KI");
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<LI>%L^n", id, "ML_KI_REQUIRED_MAX");
	iLen += format(Motd[iLen], (sizeof Motd - 1) - iLen,"<LI>%L^n", id, "ML_CLASS_ESTADISTICS");
	
	show_motd(id, Motd, "Dragon ball Z Help!");
}

// Message of Help
public DisplayHelpMessage( )
{
	ColorChat(0, "!g[DBZ] !y%L", 0, "ML_DISPLAY_HELP" )
}

/*******************************= FOR THE MESSAGE COLOR =*********************************/
stock ColorChat(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!g", "^4")
	replace_all(msg, 190, "!y", "^1")
	replace_all(msg, 190, "!team", "^3")
	replace_all(msg, 190, "!team2", "^0")
	
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, g_iMsgSayText, _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}
/*****************************************************************************************/


Îmi apare și această eroare, însă nu apare nimic ciudat în joc. Se poate rezolva?

Code: Select all

L 07/18/2012 - 23:41:23: [CSTRIKE] Invalid player 1
L 07/18/2012 - 23:41:23: [AMXX] Displaying debug trace (plugin "DBZMode.amxx")
L 07/18/2012 - 23:41:23: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 07/18/2012 - 23:41:23: [AMXX]    [0] DBZMode.sma::Fw_PlayerSpawn (line 375)
Vă mulțumesc mult, știu că sunteți scripteri buni pe aici care ați putea face asta, dar e vorba de timp.
Image
Image
Image
User avatar
geo_neo9
Membru, skill +1
Membru, skill +1
Posts: 343
Joined: 29 Aug 2007, 08:45
Detinator Steam: Da
Has thanked: 12 times
Been thanked: 74 times
Contact:

29 Jul 2012, 20:37

Bump !
User avatar
kEnT3D
Membru, skill +1
Membru, skill +1
Posts: 134
Joined: 24 Jul 2012, 20:44
Detinator Steam: Nu
CS Status: Tu, Eu, Ea și Antonia.
Detinator server CS: Da.
SteamID: STEAM:0:0.
Location: Timișoara.
Has thanked: 2 times
Been thanked: 6 times
Contact:

29 Jul 2012, 23:46

Thanks.
Image
Image
Image
User avatar
geo_neo9
Membru, skill +1
Membru, skill +1
Posts: 343
Joined: 29 Aug 2007, 08:45
Detinator Steam: Da
Has thanked: 12 times
Been thanked: 74 times
Contact:

31 Jul 2012, 21:45

Bump.
User avatar
Andrei.B
Fost administrator
Fost administrator
Posts: 6481
Joined: 17 Aug 2009, 08:15
Detinator Steam: Da
CS Status: Plecat pe mari si tari
Detinator server CS: Nu detin !
SteamID: andreybci94
Reputatie: Fost Membru Club eXtreamCS (o luna)
Fost Administrator
Nume anterior : bLack, Andrei,krusc
Contribuitor
Location: ConstanTa
Has thanked: 275 times
Been thanked: 556 times
Contact:

01 Aug 2012, 08:47

Incearca sa scrii debug in fata acelui plugin si vezi daca merge

Mereu in suflet culorile ( Roş -Albastru )
Image
ImageImage
User avatar
geo_neo9
Membru, skill +1
Membru, skill +1
Posts: 343
Joined: 29 Aug 2007, 08:45
Detinator Steam: Da
Has thanked: 12 times
Been thanked: 74 times
Contact:

01 Aug 2012, 20:35

Daca citesti eroare, o sa observi ca e cea cu debug. :)
User avatar
TheBestKiller
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 509
Joined: 31 Jul 2012, 09:57
Detinator Steam: Da
Reputatie: Ban 2 luni
Utilizator neserios (tepar)
Has thanked: 38 times
Been thanked: 27 times

01 Aug 2012, 21:01

Frate orpheu este cea mai mare tampenie POSIBILA :-j
User avatar
geo_neo9
Membru, skill +1
Membru, skill +1
Posts: 343
Joined: 29 Aug 2007, 08:45
Detinator Steam: Da
Has thanked: 12 times
Been thanked: 74 times
Contact:

01 Aug 2012, 21:09

Te rog, nu devia de la subiect.
#Rezolvat de mult timp.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests