Add natives coins from oxi custom shop pls

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Add natives coins from oxi custom shop pls

Мнение от Infamous2018 » 01 Апр 2020, 11:02

can anyone add natives to this plugin pls that i can use oxis custom shop items? Now the Shop dont work. And can some remove this about 1 UP Level thing? Thx

Код за потвърждение: Избери целия код


#include < amxmodx >

#include < fakemeta >
#include < hamsandwich >
#include < engine >
#include < cstrike >

#pragma semicolon 1

#define PLUGIN_VERSION		"2.0.6"

#if AMXX_VERSION_NUM < 183
	#define MAX_PLAYERS		32
#endif

#define __HUD_MAXTIME		1.0

#define is_player(%1)    	( 1 <= %1 <= gMaxPlayers ) 

enum _: iCoinSequences
{
	CoinIdle = 0,
	CoinFloat,
	CoinSpin
};

enum _: iTaskIds ( += 128763 )
{
	__TASKID_HUD_REFRESH,
	__TASKID_RESPAWN_PLAYER
};

new gCvarPluginEnable;
new gCvarPluginMaxCoinsForLife;
new gCvarPluginCoinPerBody;
new gCvarPluginCoinGlow;

new gHudSyncronizer;
new gHudSyncronizer2;
new gMaxPlayers;
new i;

new const gCoinClassname[ ] = "MarioCoin$";

new const gCoinModel[ ] = "models/coin/mario_coin.mdl";

new const gCoinGained[ ] = "MarioCoins/coingained.wav";
new const gLifeGained[ ] = "MarioCoins/lifegained.wav";
new const gRespawned[ ] = "MarioCoins/respawned.wav";

new bCountTokenCoins[ MAX_PLAYERS + 1 ];

public plugin_init( )
{
	register_plugin( "Mario Coins", PLUGIN_VERSION, "tuty" );
	
	register_event( "DeathMsg", "Hook_DeathMessage", "a" );
	register_event( "TextMsg", "EVENT_TextMsg", "a", "2&#Game_C", "2&#Game_w", "2&#Game_will_restart_in" );
	
	register_logevent( "LOG_RoundEnd", 2, "1=Round_End" );

	register_touch( gCoinClassname, "player", "Forward_TouchCoin" );
	register_think( gCoinClassname, "Forward_CoinThink" );
	
	gCvarPluginEnable = register_cvar( "mc_enabled", "1" );
	gCvarPluginCoinPerBody = register_cvar( "mc_bodycoin", "1" );
	gCvarPluginMaxCoinsForLife = register_cvar( "mc_maxcoins", "10" );
	gCvarPluginCoinGlow = register_cvar( "mc_glowcoin", "0" );

	gHudSyncronizer = CreateHudSyncObj( );
	gHudSyncronizer2 = CreateHudSyncObj( );
	
	gMaxPlayers = get_maxplayers( );
	
	if( get_pcvar_num( gCvarPluginEnable ) != 0 )
	{
		set_task( __HUD_MAXTIME, "DisplayMarioCoinsHud", __TASKID_HUD_REFRESH, _, _, "b" );
	}
}

public plugin_precache( )
{
	precache_model( gCoinModel );
	
	precache_sound( gCoinGained );
	precache_sound( gLifeGained );
	precache_sound( gRespawned );
}

public client_connect( id )
{
	bCountTokenCoins[ id ] = 0;
}

public client_disconnected( id )
{
	bCountTokenCoins[ id ] = 0;
}

public EVENT_TextMsg( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public LOG_RoundEnd( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public Hook_DeathMessage( )
{
	if( get_pcvar_num( gCvarPluginEnable ) != 1 )
	{
		return;
	}

	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );

	if( iKiller == iVictim )
	{
		return;
	}

	if( bCountTokenCoins[ iVictim ] >= get_pcvar_num( gCvarPluginMaxCoinsForLife ) )
	{

		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
	}

	new Float:flPlayerOrigin[ 3 ];
	pev( iVictim, pev_origin, flPlayerOrigin );
	
	flPlayerOrigin[ 2 ] += 4.0;

	new iEntity = create_entity( "info_target" );

	if( !pev_valid( iEntity ) )
	{
		return;
	}
	
	engfunc( EngFunc_SetOrigin, iEntity, flPlayerOrigin );
	set_pev( iEntity, pev_classname, gCoinClassname );

	engfunc( EngFunc_SetModel, iEntity, gCoinModel );

	set_pev( iEntity, pev_solid, SOLID_SLIDEBOX );
	set_pev( iEntity, pev_movetype, MOVETYPE_NONE );
	set_pev( iEntity, pev_framerate, 1.0 );
	set_pev( iEntity, pev_sequence, CoinFloat );

	engfunc( EngFunc_SetSize, iEntity, Float:{ -10.0, -10.0, -10.0 }, Float:{ 10.0, 10.0, 10.0 } );
	engfunc( EngFunc_DropToFloor, iEntity );

	set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );
	
	if( get_pcvar_num( gCvarPluginCoinGlow ) == 1 )
	{
		set_rendering( iEntity, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 30 );
	}
}

public Forward_CoinThink( iEntity )
{
	if( pev_valid( iEntity ) )
	{
		set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );

		set_pev( iEntity, pev_framerate, 1.0 );
		set_pev( iEntity, pev_sequence, CoinFloat );
		
		new Float:flOrigin[ 3 ];
		pev( iEntity, pev_origin, flOrigin );
		
		UTIL_DynamicLight( flOrigin, 255, 255, 0, 50 );
	}
}

public Forward_TouchCoin( iEntity, id )
{
	if( pev_valid( iEntity ) )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );
		new iGainCoins = get_pcvar_num( gCvarPluginCoinPerBody );

		bCountTokenCoins[ id ] += iGainCoins;
		
		if( bCountTokenCoins[ id ] > iMaxCoins )
		{
			// --| Example:
			// --| If player somehow has 3 coins, and the iGainCoins cvar is set to 2, will receive +2
			// --| so, that would be 5. instead of displaying 5/iMaxCoins( which is 4 atm ) will look ugly and unprofessional 5/4 coins.
			// --| so, just in case that the value is higher, will set it to maximum
			bCountTokenCoins[ id ] = iMaxCoins;
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}

		else if( bCountTokenCoins[ id ] == iMaxCoins )
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You have 1 UP [%d/%d Coins]!^nAfter death, you will respawn!", bCountTokenCoins[ id ], iMaxCoins );
			
			emit_sound( id, CHAN_ITEM, gLifeGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	
		else
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You got %d coin%s from this body!", iGainCoins, iGainCoins == 1 ? "" : "s" );
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	}
	
	return PLUGIN_CONTINUE;
}

public DisplayMarioCoinsHud( )
{
	new iPlayerCount, iPlayerId;
	new iPlayers[ MAX_PLAYERS ], szFormatHUDMessage[ 192 ];

	get_players( iPlayers, iPlayerCount, "ac" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		set_hudmessage( 255, 127, 42, 0.0, 0.90, 0, 6.0, __HUD_MAXTIME + 0.1 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );

		if( bCountTokenCoins[ iPlayerId ] >= iMaxCoins )
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "1 UP^nCoins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		else
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "Coins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		ShowSyncHudMsg( iPlayerId, gHudSyncronizer, szFormatHUDMessage );
	}
}

public RespawnPlayerAndResetCoins( iTaskid )
{
	new iVictim = iTaskid - __TASKID_RESPAWN_PLAYER;

	if( is_player( iVictim )
	&& !is_user_alive( iVictim ) 
	&& cs_get_user_team( iVictim ) != CS_TEAM_SPECTATOR )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
		ShowSyncHudMsg( iVictim, gHudSyncronizer2, "You used 1 UP! Go go go!" );

		ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
		emit_sound( iVictim, CHAN_AUTO, gRespawned, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
		
		bCountTokenCoins[ iVictim ] = 0;
		
		remove_task( iVictim + __TASKID_RESPAWN_PLAYER );
	}
}

stock UTIL_DynamicLight( Float:flOrigin[ 3 ], r, g, b, a )
{
	engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin );
	write_byte( TE_DLIGHT );
	engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
	write_byte( 17 );
	write_byte( r );
	write_byte( g );
	write_byte( b );
	write_byte( a );
	write_byte( 10 );
	message_end( );
}
i added this here to the plugin: Line 103/104

public plugin_natives()
{
register_native("get_user_coins", "get_user_coins", true)
register_native("set_user_coins", "set_user_coins", true)
}

but now the CUSTOM SHOP dont work. pls help.

L 04/01/2020 - 09:54:19: [AMXX] Run time error 10 (plugin "cshop_items.amxx") (native "cshop_register_item") - debug not enabled!
L 04/01/2020 - 09:54:19: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 04/01/2020 - 09:54:23: Invalid CVAR pointer

L 04/01/2020 - 09:54:19: [AMXX] Plugin "custom_shop.amxx" failed to load: Plugin uses an unknown function (name "set_user_coins") - check your modules.ini.

So i added the natives:

Код за потвърждение: Избери целия код


#include < amxmodx >

#include < fakemeta >
#include < hamsandwich >
#include < engine >
#include < cstrike >

#pragma semicolon 1

#define PLUGIN_VERSION		"2.0.6"

#if AMXX_VERSION_NUM < 183
	#define MAX_PLAYERS		32
#endif

#define __HUD_MAXTIME		1.0

#define is_player(%1)    	( 1 <= %1 <= gMaxPlayers ) 

enum _: iCoinSequences
{
	CoinIdle = 0,
	CoinFloat,
	CoinSpin
};

enum _: iTaskIds ( += 128763 )
{
	__TASKID_HUD_REFRESH,
	__TASKID_RESPAWN_PLAYER
};

new gCvarPluginEnable;
new gCvarPluginMaxCoinsForLife;
new gCvarPluginCoinPerBody;
new gCvarPluginCoinGlow;

new gHudSyncronizer;
new gHudSyncronizer2;
new gMaxPlayers;
new i;

new const gCoinClassname[ ] = "MarioCoin$";

new const gCoinModel[ ] = "models/coin/mario_coin.mdl";

new const gCoinGained[ ] = "MarioCoins/coingained.wav";
new const gLifeGained[ ] = "MarioCoins/lifegained.wav";
new const gRespawned[ ] = "MarioCoins/respawned.wav";

new bCountTokenCoins[ MAX_PLAYERS + 1 ];

public plugin_init( )
{
	register_plugin( "Mario Coins", PLUGIN_VERSION, "tuty" );
	
	register_event( "DeathMsg", "Hook_DeathMessage", "a" );
	register_event( "TextMsg", "EVENT_TextMsg", "a", "2&#Game_C", "2&#Game_w", "2&#Game_will_restart_in" );
	
	register_logevent( "LOG_RoundEnd", 2, "1=Round_End" );

	register_touch( gCoinClassname, "player", "Forward_TouchCoin" );
	register_think( gCoinClassname, "Forward_CoinThink" );
	
	gCvarPluginEnable = register_cvar( "mc_enabled", "1" );
	gCvarPluginCoinPerBody = register_cvar( "mc_bodycoin", "1" );
	gCvarPluginMaxCoinsForLife = register_cvar( "mc_maxcoins", "10" );
	gCvarPluginCoinGlow = register_cvar( "mc_glowcoin", "0" );

	gHudSyncronizer = CreateHudSyncObj( );
	gHudSyncronizer2 = CreateHudSyncObj( );
	
	gMaxPlayers = get_maxplayers( );
	
	if( get_pcvar_num( gCvarPluginEnable ) != 0 )
	{
		set_task( __HUD_MAXTIME, "DisplayMarioCoinsHud", __TASKID_HUD_REFRESH, _, _, "b" );
	}
}

public plugin_precache( )
{
	precache_model( gCoinModel );
	
	precache_sound( gCoinGained );
	precache_sound( gLifeGained );
	precache_sound( gRespawned );
}

public client_connect( id )
{
	bCountTokenCoins[ id ] = 0;
}

public client_disconnected( id )
{
	bCountTokenCoins[ id ] = 0;
}

public plugin_natives()
{
	register_native("get_user_coins", "get_user_coins", true);
	register_native("set_user_coins", "set_user_coins", true);
}
public EVENT_TextMsg( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public LOG_RoundEnd( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public Hook_DeathMessage( )
{
	if( get_pcvar_num( gCvarPluginEnable ) != 1 )
	{
		return;
	}

	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );

	if( iKiller == iVictim )
	{
		return;
	}

	if( bCountTokenCoins[ iVictim ] >= get_pcvar_num( gCvarPluginMaxCoinsForLife ) )
	{

		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
	}

	new Float:flPlayerOrigin[ 3 ];
	pev( iVictim, pev_origin, flPlayerOrigin );
	
	flPlayerOrigin[ 2 ] += 4.0;

	new iEntity = create_entity( "info_target" );

	if( !pev_valid( iEntity ) )
	{
		return;
	}
	
	engfunc( EngFunc_SetOrigin, iEntity, flPlayerOrigin );
	set_pev( iEntity, pev_classname, gCoinClassname );

	engfunc( EngFunc_SetModel, iEntity, gCoinModel );

	set_pev( iEntity, pev_solid, SOLID_SLIDEBOX );
	set_pev( iEntity, pev_movetype, MOVETYPE_NONE );
	set_pev( iEntity, pev_framerate, 1.0 );
	set_pev( iEntity, pev_sequence, CoinFloat );

	engfunc( EngFunc_SetSize, iEntity, Float:{ -10.0, -10.0, -10.0 }, Float:{ 10.0, 10.0, 10.0 } );
	engfunc( EngFunc_DropToFloor, iEntity );

	set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );
	
	if( get_pcvar_num( gCvarPluginCoinGlow ) == 1 )
	{
		set_rendering( iEntity, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 30 );
	}
}

public Forward_CoinThink( iEntity )
{
	if( pev_valid( iEntity ) )
	{
		set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );

		set_pev( iEntity, pev_framerate, 1.0 );
		set_pev( iEntity, pev_sequence, CoinFloat );
		
		new Float:flOrigin[ 3 ];
		pev( iEntity, pev_origin, flOrigin );
		
		UTIL_DynamicLight( flOrigin, 255, 255, 0, 50 );
	}
}

public Forward_TouchCoin( iEntity, id )
{
	if( pev_valid( iEntity ) )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );
		new iGainCoins = get_pcvar_num( gCvarPluginCoinPerBody );

		bCountTokenCoins[ id ] += iGainCoins;
		
		if( bCountTokenCoins[ id ] > iMaxCoins )
		{
			// --| Example:
			// --| If player somehow has 3 coins, and the iGainCoins cvar is set to 2, will receive +2
			// --| so, that would be 5. instead of displaying 5/iMaxCoins( which is 4 atm ) will look ugly and unprofessional 5/4 coins.
			// --| so, just in case that the value is higher, will set it to maximum
			bCountTokenCoins[ id ] = iMaxCoins;
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}

		else if( bCountTokenCoins[ id ] == iMaxCoins )
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You have 1 UP [%d/%d Coins]!^nAfter death, you will respawn!", bCountTokenCoins[ id ], iMaxCoins );
			
			emit_sound( id, CHAN_ITEM, gLifeGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	
		else
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You got %d coin%s from this body!", iGainCoins, iGainCoins == 1 ? "" : "s" );
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	}
	
	return PLUGIN_CONTINUE;
}

public DisplayMarioCoinsHud( )
{
	new iPlayerCount, iPlayerId;
	new iPlayers[ MAX_PLAYERS ], szFormatHUDMessage[ 192 ];

	get_players( iPlayers, iPlayerCount, "ac" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		set_hudmessage( 255, 127, 42, 0.0, 0.90, 0, 6.0, __HUD_MAXTIME + 0.1 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );

		if( bCountTokenCoins[ iPlayerId ] >= iMaxCoins )
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "1 UP^nCoins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		else
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "Coins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		ShowSyncHudMsg( iPlayerId, gHudSyncronizer, szFormatHUDMessage );
	}
}

public RespawnPlayerAndResetCoins( iTaskid )
{
	new iVictim = iTaskid - __TASKID_RESPAWN_PLAYER;

	if( is_player( iVictim )
	&& !is_user_alive( iVictim ) 
	&& cs_get_user_team( iVictim ) != CS_TEAM_SPECTATOR )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
		ShowSyncHudMsg( iVictim, gHudSyncronizer2, "You used 1 UP! Go go go!" );

		ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
		emit_sound( iVictim, CHAN_AUTO, gRespawned, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
		
		bCountTokenCoins[ iVictim ] = 0;
		
		remove_task( iVictim + __TASKID_RESPAWN_PLAYER );
	}
}

stock UTIL_DynamicLight( Float:flOrigin[ 3 ], r, g, b, a )
{
	engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin );
	write_byte( TE_DLIGHT );
	engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
	write_byte( 17 );
	write_byte( r );
	write_byte( g );
	write_byte( b );
	write_byte( a );
	write_byte( 10 );
	message_end( );
}

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Add natives coins from oxi custom shop pls

Мнение от Infamous2018 » 01 Апр 2020, 20:03

my new sma edited by me but now the /shop dont work. i cant choose anything from there.

Код за потвърждение: Избери целия код


#include < amxmodx >

#include < fakemeta >
#include < hamsandwich >
#include < engine >
#include < cstrike >

#pragma semicolon 1

#define PLUGIN_VERSION		"2.0.6"

#if AMXX_VERSION_NUM < 183
	#define MAX_PLAYERS		32
#endif

#define __HUD_MAXTIME		1.0

#define is_player(%1)    	( 1 <= %1 <= gMaxPlayers ) 

enum _: iCoinSequences
{
	CoinIdle = 0,
	CoinFloat,
	CoinSpin
};

enum _: iTaskIds ( += 128763 )
{
	__TASKID_HUD_REFRESH,
	__TASKID_RESPAWN_PLAYER
};

new gCvarPluginEnable;
new gCvarPluginMaxCoinsForLife;
new gCvarPluginCoinPerBody;
new gCvarPluginCoinGlow;

new gHudSyncronizer;
new gHudSyncronizer2;
new gMaxPlayers;
new i;
new g_Coin[33];

new const gCoinClassname[ ] = "MarioCoin$";

new const gCoinModel[ ] = "models/coin/mario_coin.mdl";

new const gCoinGained[ ] = "MarioCoins/coingained.wav";
new const gLifeGained[ ] = "MarioCoins/lifegained.wav";
new const gRespawned[ ] = "MarioCoins/respawned.wav";

new bCountTokenCoins[ MAX_PLAYERS + 1 ];

public plugin_init( )
{
	register_plugin( "Mario Coins", PLUGIN_VERSION, "tuty" );
	
	register_event( "DeathMsg", "Hook_DeathMessage", "a" );
	register_event( "TextMsg", "EVENT_TextMsg", "a", "2&#Game_C", "2&#Game_w", "2&#Game_will_restart_in" );
	
	register_logevent( "LOG_RoundEnd", 2, "1=Round_End" );

	register_touch( gCoinClassname, "player", "Forward_TouchCoin" );
	register_think( gCoinClassname, "Forward_CoinThink" );
	
	gCvarPluginEnable = register_cvar( "mc_enabled", "1" );
	gCvarPluginCoinPerBody = register_cvar( "mc_bodycoin", "1" );
	gCvarPluginMaxCoinsForLife = register_cvar( "mc_maxcoins", "10" );
	gCvarPluginCoinGlow = register_cvar( "mc_glowcoin", "0" );

	gHudSyncronizer = CreateHudSyncObj( );
	gHudSyncronizer2 = CreateHudSyncObj( );
	
	gMaxPlayers = get_maxplayers( );
	
	if( get_pcvar_num( gCvarPluginEnable ) != 0 )
	{
		set_task( __HUD_MAXTIME, "DisplayMarioCoinsHud", __TASKID_HUD_REFRESH, _, _, "b" );
	}
}

public plugin_precache( )
{
	precache_model( gCoinModel );
	
	precache_sound( gCoinGained );
	precache_sound( gLifeGained );
	precache_sound( gRespawned );
}

public client_connect( id )
{
	bCountTokenCoins[ id ] = 0;
}

public client_disconnected( id )
{
	bCountTokenCoins[ id ] = 0;
}


public plugin_natives()
{
	register_native("get_user_coins", "get_user_coins", true);
	register_native("set_user_coins", "set_user_coins", true);
}

public get_user_coins(id) return g_Coin[id];
public set_user_coins(id, iNum) g_Coin[id] = iNum;

public EVENT_TextMsg( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public LOG_RoundEnd( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public Hook_DeathMessage( )
{
	if( get_pcvar_num( gCvarPluginEnable ) != 1 )
	{
		return;
	}

	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );

	if( iKiller == iVictim )
	{
		return;
	}

	if( bCountTokenCoins[ iVictim ] >= get_pcvar_num( gCvarPluginMaxCoinsForLife ) )
	{

		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
	}

	new Float:flPlayerOrigin[ 3 ];
	pev( iVictim, pev_origin, flPlayerOrigin );
	
	flPlayerOrigin[ 2 ] += 4.0;

	new iEntity = create_entity( "info_target" );

	if( !pev_valid( iEntity ) )
	{
		return;
	}
	
	engfunc( EngFunc_SetOrigin, iEntity, flPlayerOrigin );
	set_pev( iEntity, pev_classname, gCoinClassname );

	engfunc( EngFunc_SetModel, iEntity, gCoinModel );

	set_pev( iEntity, pev_solid, SOLID_SLIDEBOX );
	set_pev( iEntity, pev_movetype, MOVETYPE_NONE );
	set_pev( iEntity, pev_framerate, 1.0 );
	set_pev( iEntity, pev_sequence, CoinFloat );

	engfunc( EngFunc_SetSize, iEntity, Float:{ -10.0, -10.0, -10.0 }, Float:{ 10.0, 10.0, 10.0 } );
	engfunc( EngFunc_DropToFloor, iEntity );

	set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );
	
	if( get_pcvar_num( gCvarPluginCoinGlow ) == 1 )
	{
		set_rendering( iEntity, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 30 );
	}
}

public Forward_CoinThink( iEntity )
{
	if( pev_valid( iEntity ) )
	{
		set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );

		set_pev( iEntity, pev_framerate, 1.0 );
		set_pev( iEntity, pev_sequence, CoinFloat );
		
		new Float:flOrigin[ 3 ];
		pev( iEntity, pev_origin, flOrigin );
		
		UTIL_DynamicLight( flOrigin, 255, 255, 0, 50 );
	}
}

public Forward_TouchCoin( iEntity, id )
{
	if( pev_valid( iEntity ) )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );
		new iGainCoins = get_pcvar_num( gCvarPluginCoinPerBody );

		bCountTokenCoins[ id ] += iGainCoins;
		
		if( bCountTokenCoins[ id ] > iMaxCoins )
		{
			// --| Example:
			// --| If player somehow has 3 coins, and the iGainCoins cvar is set to 2, will receive +2
			// --| so, that would be 5. instead of displaying 5/iMaxCoins( which is 4 atm ) will look ugly and unprofessional 5/4 coins.
			// --| so, just in case that the value is higher, will set it to maximum
			bCountTokenCoins[ id ] = iMaxCoins;
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}

		else if( bCountTokenCoins[ id ] == iMaxCoins )
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You have 1 UP [%d/%d Coins]!^nAfter death, you will respawn!", bCountTokenCoins[ id ], iMaxCoins );
			
			emit_sound( id, CHAN_ITEM, gLifeGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	
		else
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You got %d coin%s from this body!", iGainCoins, iGainCoins == 1 ? "" : "s" );
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	}
	
	return PLUGIN_CONTINUE;
}

public DisplayMarioCoinsHud( )
{
	new iPlayerCount, iPlayerId;
	new iPlayers[ MAX_PLAYERS ], szFormatHUDMessage[ 192 ];

	get_players( iPlayers, iPlayerCount, "ac" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		set_hudmessage( 255, 127, 42, 0.0, 0.90, 0, 6.0, __HUD_MAXTIME + 0.1 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );

		if( bCountTokenCoins[ iPlayerId ] >= iMaxCoins )
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "1 UP^nCoins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		else
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "Coins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		ShowSyncHudMsg( iPlayerId, gHudSyncronizer, szFormatHUDMessage );
	}
}

public RespawnPlayerAndResetCoins( iTaskid )
{
	new iVictim = iTaskid - __TASKID_RESPAWN_PLAYER;

	if( is_player( iVictim )
	&& !is_user_alive( iVictim ) 
	&& cs_get_user_team( iVictim ) != CS_TEAM_SPECTATOR )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
		ShowSyncHudMsg( iVictim, gHudSyncronizer2, "You used 1 UP! Go go go!" );

		ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
		emit_sound( iVictim, CHAN_AUTO, gRespawned, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
		
		bCountTokenCoins[ iVictim ] = 0;
		
		remove_task( iVictim + __TASKID_RESPAWN_PLAYER );
	}
}

stock UTIL_DynamicLight( Float:flOrigin[ 3 ], r, g, b, a )
{
	engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin );
	write_byte( TE_DLIGHT );
	engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
	write_byte( 17 );
	write_byte( r );
	write_byte( g );
	write_byte( b );
	write_byte( a );
	write_byte( 10 );
	message_end( );
}

PLEASE HELP

Код за потвърждение: Избери целия код

#if defined _cshop_settings_included
    #endinput
#endif

#define _cshop_settings_included
#define DEFAULT_SOUND "items/gunpickup2.wav"
#define FLAG_ADMIN ADMIN_BAN
#define LANG_TYPE LANG_SERVER
#define MAX_ITEMS 100

/*
	* Change the lines below if you want to use a native for your money currency, e.g. Ammo Packs, BaseBuilder Credits, JBPacks, etc.
	* Example (%1 = id | %2 = amount):
		native zp_get_user_ammo_packs(id)
		native zp_set_user_ammo_packs(id, amount)
		#define get_user_money(%1) zp_get_user_ammo_packs(%1)
		#define set_user_money(%1,%2) zp_set_user_ammo_packs(%1, %2)
*/

native get_user_coins(id)
native set_user_coins(id, iNum)

#define get_user_money(%1) get_user_coins(%1)
#define set_user_money(%1,%2) set_user_coins(%1, %2)

/* Don't touch this line unless you know what you're doing */
#define take_user_money(%1,%2) set_user_money(%1, get_user_money(%1) - %2)
here anything wrong or where????

Добавено преди 32 минути 48 секунди:

Код за потвърждение: Избери целия код

#define get_user_coins(%1, %2)
#define set_user_coins(%1, %2)
????

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Add natives coins from oxi custom shop pls

Мнение от Infamous2018 » 02 Апр 2020, 10:53

really? NO ONE? OciXCrom ?????????? You are the only King here who helps much times.... ahhhhhh =(

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Add natives coins from oxi custom shop pls

Мнение от OciXCrom » 02 Апр 2020, 14:23

Please don't bump.

Did you edit that coins plugin or was it like that? The natives in it won't do anything.
The g_Coin[33] variable is not used anywhere in the code, so using those natives will always return 0, thus why you can't get anything from the shop.
Coins are saved in the bCountTokenCoins variable instead.

Edit it like this:

Код за потвърждение: Избери целия код

public plugin_natives()
{
	register_native("get_user_coins", "_get_user_coins");
	register_native("set_user_coins", "_set_user_coins");
}

public _get_user_coins(iPlugin, iParams) return bCountTokenCoins[get_param(1)];
public _set_user_coins(iPlugin, iParams) bCountTokenCoins[get_param(1)] = iNum;

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Add natives coins from oxi custom shop pls

Мнение от Infamous2018 » 02 Апр 2020, 14:34

i used this plugin https://forums.alliedmods.net/showthread.php?t=150095

Код за потвърждение: Избери целия код


#include < amxmodx >

#include < fakemeta >
#include < hamsandwich >
#include < engine >
#include < cstrike >

#pragma semicolon 1

#define PLUGIN_VERSION		"2.0.6"

#if AMXX_VERSION_NUM < 183
	#define MAX_PLAYERS		32
#endif

#define __HUD_MAXTIME		1.0

#define is_player(%1)    	( 1 <= %1 <= gMaxPlayers ) 

enum _: iCoinSequences
{
	CoinIdle = 0,
	CoinFloat,
	CoinSpin
};

enum _: iTaskIds ( += 128763 )
{
	__TASKID_HUD_REFRESH,
	__TASKID_RESPAWN_PLAYER
};

new gCvarPluginEnable;
new gCvarPluginMaxCoinsForLife;
new gCvarPluginRespawnTime;
new gCvarPluginCoinPerBody;
new gCvarPluginCoinGlow;

new gHudSyncronizer;
new gHudSyncronizer2;
new gMaxPlayers;
new i;

new const gCoinClassname[ ] = "MarioCoin$";

new const gCoinModel[ ] = "models/MarioCoins/mario_coin.mdl";

new const gCoinGained[ ] = "MarioCoins/coingained.wav";
new const gLifeGained[ ] = "MarioCoins/lifegained.wav";
new const gRespawned[ ] = "MarioCoins/respawned.wav";

new bCountTokenCoins[ MAX_PLAYERS + 1 ];

public plugin_init( )
{
	register_plugin( "Mario Coins", PLUGIN_VERSION, "tuty" );
	
	register_event( "DeathMsg", "Hook_DeathMessage", "a" );
	register_event( "TextMsg", "EVENT_TextMsg", "a", "2&#Game_C", "2&#Game_w", "2&#Game_will_restart_in" );
	
	register_logevent( "LOG_RoundEnd", 2, "1=Round_End" );

	register_touch( gCoinClassname, "player", "Forward_TouchCoin" );
	register_think( gCoinClassname, "Forward_CoinThink" );
	
	gCvarPluginEnable = register_cvar( "mc_enabled", "1" );
	gCvarPluginCoinPerBody = register_cvar( "mc_bodycoin", "1" );
	gCvarPluginMaxCoinsForLife = register_cvar( "mc_maxcoins", "4" );
	gCvarPluginRespawnTime = register_cvar( "mc_respawntime", "10" );
	gCvarPluginCoinGlow = register_cvar( "mc_glowcoin", "1" );

	gHudSyncronizer = CreateHudSyncObj( );
	gHudSyncronizer2 = CreateHudSyncObj( );
	
	gMaxPlayers = get_maxplayers( );
	
	if( get_pcvar_num( gCvarPluginEnable ) != 0 )
	{
		set_task( __HUD_MAXTIME, "DisplayMarioCoinsHud", __TASKID_HUD_REFRESH, _, _, "b" );
	}
}

public plugin_precache( )
{
	precache_model( gCoinModel );
	
	precache_sound( gCoinGained );
	precache_sound( gLifeGained );
	precache_sound( gRespawned );
}

public client_connect( id )
{
	bCountTokenCoins[ id ] = 0;
}

public client_disconnect( id )
{
	bCountTokenCoins[ id ] = 0;
}

public EVENT_TextMsg( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public LOG_RoundEnd( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public Hook_DeathMessage( )
{
	if( get_pcvar_num( gCvarPluginEnable ) != 1 )
	{
		return;
	}

	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );

	if( iKiller == iVictim )
	{
		return;
	}

	if( bCountTokenCoins[ iVictim ] >= get_pcvar_num( gCvarPluginMaxCoinsForLife ) )
	{
		new iRespawnTime = get_pcvar_num( gCvarPluginRespawnTime );

		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
		ShowSyncHudMsg( iVictim, gHudSyncronizer2, "You will respawn in %d second%s!", iRespawnTime, iRespawnTime == 1 ? "" : "s" );

		set_task( float( iRespawnTime ), "RespawnPlayerAndResetCoins", iVictim + __TASKID_RESPAWN_PLAYER );
	}

	new Float:flPlayerOrigin[ 3 ];
	pev( iVictim, pev_origin, flPlayerOrigin );
	
	flPlayerOrigin[ 2 ] += 4.0;

	new iEntity = create_entity( "info_target" );

	if( !pev_valid( iEntity ) )
	{
		return;
	}
	
	engfunc( EngFunc_SetOrigin, iEntity, flPlayerOrigin );
	set_pev( iEntity, pev_classname, gCoinClassname );

	engfunc( EngFunc_SetModel, iEntity, gCoinModel );

	set_pev( iEntity, pev_solid, SOLID_SLIDEBOX );
	set_pev( iEntity, pev_movetype, MOVETYPE_NONE );
	set_pev( iEntity, pev_framerate, 1.0 );
	set_pev( iEntity, pev_sequence, CoinFloat );

	engfunc( EngFunc_SetSize, iEntity, Float:{ -10.0, -10.0, -10.0 }, Float:{ 10.0, 10.0, 10.0 } );
	engfunc( EngFunc_DropToFloor, iEntity );

	set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );
	
	if( get_pcvar_num( gCvarPluginCoinGlow ) == 1 )
	{
		set_rendering( iEntity, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 30 );
	}
}

public Forward_CoinThink( iEntity )
{
	if( pev_valid( iEntity ) )
	{
		set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );

		set_pev( iEntity, pev_framerate, 1.0 );
		set_pev( iEntity, pev_sequence, CoinFloat );
		
		new Float:flOrigin[ 3 ];
		pev( iEntity, pev_origin, flOrigin );
		
		UTIL_DynamicLight( flOrigin, 255, 255, 0, 50 );
	}
}

public Forward_TouchCoin( iEntity, id )
{
	if( pev_valid( iEntity ) )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );
		new iGainCoins = get_pcvar_num( gCvarPluginCoinPerBody );

		bCountTokenCoins[ id ] += iGainCoins;
		
		if( bCountTokenCoins[ id ] > iMaxCoins )
		{
			// --| Example:
			// --| If player somehow has 3 coins, and the iGainCoins cvar is set to 2, will receive +2
			// --| so, that would be 5. instead of displaying 5/iMaxCoins( which is 4 atm ) will look ugly and unprofessional 5/4 coins.
			// --| so, just in case that the value is higher, will set it to maximum
			bCountTokenCoins[ id ] = iMaxCoins;
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}

		else if( bCountTokenCoins[ id ] == iMaxCoins )
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You have 1 UP [%d/%d Coins]!^nAfter death, you will respawn!", bCountTokenCoins[ id ], iMaxCoins );
			
			emit_sound( id, CHAN_ITEM, gLifeGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	
		else
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You got %d coin%s from this body!", iGainCoins, iGainCoins == 1 ? "" : "s" );
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	}
	
	return PLUGIN_CONTINUE;
}

public DisplayMarioCoinsHud( )
{
	new iPlayerCount, iPlayerId;
	new iPlayers[ MAX_PLAYERS ], szFormatHUDMessage[ 192 ];

	get_players( iPlayers, iPlayerCount, "ac" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		set_hudmessage( 255, 127, 42, 0.0, 0.90, 0, 6.0, __HUD_MAXTIME + 0.1 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );

		if( bCountTokenCoins[ iPlayerId ] >= iMaxCoins )
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "1 UP^nCoins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		else
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "Coins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		ShowSyncHudMsg( iPlayerId, gHudSyncronizer, szFormatHUDMessage );
	}
}

public RespawnPlayerAndResetCoins( iTaskid )
{
	new iVictim = iTaskid - __TASKID_RESPAWN_PLAYER;

	if( is_player( iVictim )
	&& !is_user_alive( iVictim ) 
	&& cs_get_user_team( iVictim ) != CS_TEAM_SPECTATOR )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
		ShowSyncHudMsg( iVictim, gHudSyncronizer2, "You used 1 UP! Go go go!" );

		ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
		emit_sound( iVictim, CHAN_AUTO, gRespawned, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
		
		bCountTokenCoins[ iVictim ] = 0;
		
		remove_task( iVictim + __TASKID_RESPAWN_PLAYER );
	}
}

stock UTIL_DynamicLight( Float:flOrigin[ 3 ], r, g, b, a )
{
	engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin );
	write_byte( TE_DLIGHT );
	engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
	write_byte( 17 );
	write_byte( r );
	write_byte( g );
	write_byte( b );
	write_byte( a );
	write_byte( 10 );
	message_end( );
}
i tried to add g_Coin[33] i tried to fix it by myself but i sucks.. :/ BTW i want use it with your Shop Plugin when u remember....

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Add natives coins from oxi custom shop pls

Мнение от OciXCrom » 02 Апр 2020, 16:32

Download the original coins plugin from the link and add the code from my previous post. It should work now.

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Add natives coins from oxi custom shop pls

Мнение от Infamous2018 » 02 Апр 2020, 16:50

so then this:

Код за потвърждение: Избери целия код



#include < amxmodx >

#include < fakemeta >
#include < hamsandwich >
#include < engine >
#include < cstrike >

#pragma semicolon 1

#define PLUGIN_VERSION		"2.0.6"

#if AMXX_VERSION_NUM < 183
	#define MAX_PLAYERS		32
#endif

#define __HUD_MAXTIME		1.0

#define is_player(%1)    	( 1 <= %1 <= gMaxPlayers ) 

enum _: iCoinSequences
{
	CoinIdle = 0,
	CoinFloat,
	CoinSpin
};

enum _: iTaskIds ( += 128763 )
{
	__TASKID_HUD_REFRESH,
	__TASKID_RESPAWN_PLAYER
};

new gCvarPluginEnable;
new gCvarPluginMaxCoinsForLife;
new gCvarPluginRespawnTime;
new gCvarPluginCoinPerBody;
new gCvarPluginCoinGlow;

new gHudSyncronizer;
new gHudSyncronizer2;
new gMaxPlayers;
new i;

new const gCoinClassname[ ] = "MarioCoin$";

new const gCoinModel[ ] = "models/MarioCoins/mario_coin.mdl";

new const gCoinGained[ ] = "MarioCoins/coingained.wav";
new const gLifeGained[ ] = "MarioCoins/lifegained.wav";
new const gRespawned[ ] = "MarioCoins/respawned.wav";

new bCountTokenCoins[ MAX_PLAYERS + 1 ];

public plugin_init( )
{
	register_plugin( "Mario Coins", PLUGIN_VERSION, "tuty" );
	
	register_event( "DeathMsg", "Hook_DeathMessage", "a" );
	register_event( "TextMsg", "EVENT_TextMsg", "a", "2&#Game_C", "2&#Game_w", "2&#Game_will_restart_in" );
	
	register_logevent( "LOG_RoundEnd", 2, "1=Round_End" );

	register_touch( gCoinClassname, "player", "Forward_TouchCoin" );
	register_think( gCoinClassname, "Forward_CoinThink" );
	
	gCvarPluginEnable = register_cvar( "mc_enabled", "1" );
	gCvarPluginCoinPerBody = register_cvar( "mc_bodycoin", "1" );
	gCvarPluginMaxCoinsForLife = register_cvar( "mc_maxcoins", "4" );
	gCvarPluginRespawnTime = register_cvar( "mc_respawntime", "10" );
	gCvarPluginCoinGlow = register_cvar( "mc_glowcoin", "1" );

	gHudSyncronizer = CreateHudSyncObj( );
	gHudSyncronizer2 = CreateHudSyncObj( );
	
	gMaxPlayers = get_maxplayers( );
	
	if( get_pcvar_num( gCvarPluginEnable ) != 0 )
	{
		set_task( __HUD_MAXTIME, "DisplayMarioCoinsHud", __TASKID_HUD_REFRESH, _, _, "b" );
	}
}

public plugin_precache( )
{
	precache_model( gCoinModel );
	
	precache_sound( gCoinGained );
	precache_sound( gLifeGained );
	precache_sound( gRespawned );
}

public client_connect( id )
{
	bCountTokenCoins[ id ] = 0;
}

public client_disconnected( id )
{
	bCountTokenCoins[ id ] = 0;
}

public plugin_natives()
{
	register_native("get_user_coins", "_get_user_coins");
	register_native("set_user_coins", "_set_user_coins");
}

public _get_user_coins(iPlugin, iParams) return bCountTokenCoins[get_param(1)];
public _set_user_coins(iPlugin, iParams) bCountTokenCoins[get_param(1)] = iNum];


public EVENT_TextMsg( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public LOG_RoundEnd( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public Hook_DeathMessage( )
{
	if( get_pcvar_num( gCvarPluginEnable ) != 1 )
	{
		return;
	}

	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );

	if( iKiller == iVictim )
	{
		return;
	}

	if( bCountTokenCoins[ iVictim ] >= get_pcvar_num( gCvarPluginMaxCoinsForLife ) )
	{
		new iRespawnTime = get_pcvar_num( gCvarPluginRespawnTime );

		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
		ShowSyncHudMsg( iVictim, gHudSyncronizer2, "You will respawn in %d second%s!", iRespawnTime, iRespawnTime == 1 ? "" : "s" );

		set_task( float( iRespawnTime ), "RespawnPlayerAndResetCoins", iVictim + __TASKID_RESPAWN_PLAYER );
	}

	new Float:flPlayerOrigin[ 3 ];
	pev( iVictim, pev_origin, flPlayerOrigin );
	
	flPlayerOrigin[ 2 ] += 4.0;

	new iEntity = create_entity( "info_target" );

	if( !pev_valid( iEntity ) )
	{
		return;
	}
	
	engfunc( EngFunc_SetOrigin, iEntity, flPlayerOrigin );
	set_pev( iEntity, pev_classname, gCoinClassname );

	engfunc( EngFunc_SetModel, iEntity, gCoinModel );

	set_pev( iEntity, pev_solid, SOLID_SLIDEBOX );
	set_pev( iEntity, pev_movetype, MOVETYPE_NONE );
	set_pev( iEntity, pev_framerate, 1.0 );
	set_pev( iEntity, pev_sequence, CoinFloat );

	engfunc( EngFunc_SetSize, iEntity, Float:{ -10.0, -10.0, -10.0 }, Float:{ 10.0, 10.0, 10.0 } );
	engfunc( EngFunc_DropToFloor, iEntity );

	set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );
	
	if( get_pcvar_num( gCvarPluginCoinGlow ) == 1 )
	{
		set_rendering( iEntity, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 30 );
	}
}

public Forward_CoinThink( iEntity )
{
	if( pev_valid( iEntity ) )
	{
		set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );

		set_pev( iEntity, pev_framerate, 1.0 );
		set_pev( iEntity, pev_sequence, CoinFloat );
		
		new Float:flOrigin[ 3 ];
		pev( iEntity, pev_origin, flOrigin );
		
		UTIL_DynamicLight( flOrigin, 255, 255, 0, 50 );
	}
}

public Forward_TouchCoin( iEntity, id )
{
	if( pev_valid( iEntity ) )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );
		new iGainCoins = get_pcvar_num( gCvarPluginCoinPerBody );

		bCountTokenCoins[ id ] += iGainCoins;
		
		if( bCountTokenCoins[ id ] > iMaxCoins )
		{
			// --| Example:
			// --| If player somehow has 3 coins, and the iGainCoins cvar is set to 2, will receive +2
			// --| so, that would be 5. instead of displaying 5/iMaxCoins( which is 4 atm ) will look ugly and unprofessional 5/4 coins.
			// --| so, just in case that the value is higher, will set it to maximum
			bCountTokenCoins[ id ] = iMaxCoins;
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}

		else if( bCountTokenCoins[ id ] == iMaxCoins )
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You have 1 UP [%d/%d Coins]!^nAfter death, you will respawn!", bCountTokenCoins[ id ], iMaxCoins );
			
			emit_sound( id, CHAN_ITEM, gLifeGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	
		else
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You got %d coin%s from this body!", iGainCoins, iGainCoins == 1 ? "" : "s" );
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	}
	
	return PLUGIN_CONTINUE;
}

public DisplayMarioCoinsHud( )
{
	new iPlayerCount, iPlayerId;
	new iPlayers[ MAX_PLAYERS ], szFormatHUDMessage[ 192 ];

	get_players( iPlayers, iPlayerCount, "ac" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		set_hudmessage( 255, 127, 42, 0.0, 0.90, 0, 6.0, __HUD_MAXTIME + 0.1 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );

		if( bCountTokenCoins[ iPlayerId ] >= iMaxCoins )
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "1 UP^nCoins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		else
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "Coins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		ShowSyncHudMsg( iPlayerId, gHudSyncronizer, szFormatHUDMessage );
	}
}

public RespawnPlayerAndResetCoins( iTaskid )
{
	new iVictim = iTaskid - __TASKID_RESPAWN_PLAYER;

	if( is_player( iVictim )
	&& !is_user_alive( iVictim ) 
	&& cs_get_user_team( iVictim ) != CS_TEAM_SPECTATOR )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
		ShowSyncHudMsg( iVictim, gHudSyncronizer2, "You used 1 UP! Go go go!" );

		ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
		emit_sound( iVictim, CHAN_AUTO, gRespawned, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
		
		bCountTokenCoins[ iVictim ] = 0;
		
		remove_task( iVictim + __TASKID_RESPAWN_PLAYER );
	}
}

stock UTIL_DynamicLight( Float:flOrigin[ 3 ], r, g, b, a )
{
	engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin );
	write_byte( TE_DLIGHT );
	engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
	write_byte( 17 );
	write_byte( r );
	write_byte( g );
	write_byte( b );
	write_byte( a );
	write_byte( 10 );
	message_end( );
}


AMX Mod X Compiler 1.9.0.5263
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Error: Undefined symbol "iNum" on line 110
Error: Invalid function or declaration on line 110

2 Errors.
Could not locate output file C:\Users\randy\Downloads\MarioCoins.amx (compile failed).
Последно промяна от Infamous2018 на 02 Апр 2020, 16:53, променено общо 1 път.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Add natives coins from oxi custom shop pls

Мнение от OciXCrom » 02 Апр 2020, 16:52

My bad. Change the iNum to get_param(2).

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Add natives coins from oxi custom shop pls

Мнение от Infamous2018 » 02 Апр 2020, 17:36

OK THANK YOU i will test it. It is possible to remove then this 1UP about respawn ?

Добавено преди 13 минути 1 секунда:
You are like GOD for me.. WORKS !!!!!!!!!!! Now i need only know and try to remove this RESPAWN shit from this Coins Plugin :D

Код за потвърждение: Избери целия код


#include < amxmodx >

#include < fakemeta >
#include < hamsandwich >
#include < engine >
#include < cstrike >

#pragma semicolon 1

#define PLUGIN_VERSION		"2.0.6"

#if AMXX_VERSION_NUM < 183
	#define MAX_PLAYERS		32
#endif

#define __HUD_MAXTIME		1.0

#define is_player(%1)    	( 1 <= %1 <= gMaxPlayers ) 

enum _: iCoinSequences
{
	CoinIdle = 0,
	CoinFloat,
	CoinSpin
};

enum _: iTaskIds ( += 128763 )
{
	__TASKID_HUD_REFRESH,
	__TASKID_RESPAWN_PLAYER
};

new gCvarPluginEnable;
new gCvarPluginMaxCoinsForLife;
new gCvarPluginRespawnTime;
new gCvarPluginCoinPerBody;
new gCvarPluginCoinGlow;

new gHudSyncronizer;
new gHudSyncronizer2;
new gMaxPlayers;
new i;

new const gCoinClassname[ ] = "MarioCoin$";

new const gCoinModel[ ] = "models/coin/mario_coin.mdl";

new const gCoinGained[ ] = "MarioCoins/coingained.wav";
new const gLifeGained[ ] = "MarioCoins/lifegained.wav";
new const gRespawned[ ] = "MarioCoins/respawned.wav";

new bCountTokenCoins[ MAX_PLAYERS + 1 ];

public plugin_init( )
{
	register_plugin( "Mario Coins", PLUGIN_VERSION, "tuty" );
	
	register_event( "DeathMsg", "Hook_DeathMessage", "a" );
	register_event( "TextMsg", "EVENT_TextMsg", "a", "2&#Game_C", "2&#Game_w", "2&#Game_will_restart_in" );
	
	register_logevent( "LOG_RoundEnd", 2, "1=Round_End" );

	register_touch( gCoinClassname, "player", "Forward_TouchCoin" );
	register_think( gCoinClassname, "Forward_CoinThink" );
	
	gCvarPluginEnable = register_cvar( "mc_enabled", "1" );
	gCvarPluginCoinPerBody = register_cvar( "mc_bodycoin", "1" );
	gCvarPluginMaxCoinsForLife = register_cvar( "mc_maxcoins", "4" );
	gCvarPluginRespawnTime = register_cvar( "mc_respawntime", "10" );
	gCvarPluginCoinGlow = register_cvar( "mc_glowcoin", "1" );

	gHudSyncronizer = CreateHudSyncObj( );
	gHudSyncronizer2 = CreateHudSyncObj( );
	
	gMaxPlayers = get_maxplayers( );
	
	if( get_pcvar_num( gCvarPluginEnable ) != 0 )
	{
		set_task( __HUD_MAXTIME, "DisplayMarioCoinsHud", __TASKID_HUD_REFRESH, _, _, "b" );
	}
}

public plugin_precache( )
{
	precache_model( gCoinModel );
	
	precache_sound( gCoinGained );
	precache_sound( gLifeGained );
	precache_sound( gRespawned );
}

public client_connect( id )
{
	bCountTokenCoins[ id ] = 0;
}

public client_disconnected( id )
{
	bCountTokenCoins[ id ] = 0;
}

public plugin_natives()
{
	register_native("get_user_coins", "_get_user_coins");
	register_native("set_user_coins", "_set_user_coins");
}

public _get_user_coins(iPlugin, iParams) return bCountTokenCoins[get_param(1)];
public _set_user_coins(iPlugin, iParams) bCountTokenCoins[get_param(1)] = get_param(2);


public EVENT_TextMsg( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public LOG_RoundEnd( )
{
	new iPlayers[ MAX_PLAYERS ]; 
	new iPlayerCount, iPlayerId;

	get_players( iPlayers, iPlayerCount, "c" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		remove_task( iPlayerId + __TASKID_RESPAWN_PLAYER );
	}

	remove_entity_name( gCoinClassname );
}

public Hook_DeathMessage( )
{
	if( get_pcvar_num( gCvarPluginEnable ) != 1 )
	{
		return;
	}

	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );

	if( iKiller == iVictim )
	{
		return;
	}

	if( bCountTokenCoins[ iVictim ] >= get_pcvar_num( gCvarPluginMaxCoinsForLife ) )
	{
		new iRespawnTime = get_pcvar_num( gCvarPluginRespawnTime );

		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
		ShowSyncHudMsg( iVictim, gHudSyncronizer2, "You will respawn in %d second%s!", iRespawnTime, iRespawnTime == 1 ? "" : "s" );

		set_task( float( iRespawnTime ), "RespawnPlayerAndResetCoins", iVictim + __TASKID_RESPAWN_PLAYER );
	}

	new Float:flPlayerOrigin[ 3 ];
	pev( iVictim, pev_origin, flPlayerOrigin );
	
	flPlayerOrigin[ 2 ] += 4.0;

	new iEntity = create_entity( "info_target" );

	if( !pev_valid( iEntity ) )
	{
		return;
	}
	
	engfunc( EngFunc_SetOrigin, iEntity, flPlayerOrigin );
	set_pev( iEntity, pev_classname, gCoinClassname );

	engfunc( EngFunc_SetModel, iEntity, gCoinModel );

	set_pev( iEntity, pev_solid, SOLID_SLIDEBOX );
	set_pev( iEntity, pev_movetype, MOVETYPE_NONE );
	set_pev( iEntity, pev_framerate, 1.0 );
	set_pev( iEntity, pev_sequence, CoinFloat );

	engfunc( EngFunc_SetSize, iEntity, Float:{ -10.0, -10.0, -10.0 }, Float:{ 10.0, 10.0, 10.0 } );
	engfunc( EngFunc_DropToFloor, iEntity );

	set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );
	
	if( get_pcvar_num( gCvarPluginCoinGlow ) == 1 )
	{
		set_rendering( iEntity, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 30 );
	}
}

public Forward_CoinThink( iEntity )
{
	if( pev_valid( iEntity ) )
	{
		set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 );

		set_pev( iEntity, pev_framerate, 1.0 );
		set_pev( iEntity, pev_sequence, CoinFloat );
		
		new Float:flOrigin[ 3 ];
		pev( iEntity, pev_origin, flOrigin );
		
		UTIL_DynamicLight( flOrigin, 255, 255, 0, 50 );
	}
}

public Forward_TouchCoin( iEntity, id )
{
	if( pev_valid( iEntity ) )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );
		new iGainCoins = get_pcvar_num( gCvarPluginCoinPerBody );

		bCountTokenCoins[ id ] += iGainCoins;
		
		if( bCountTokenCoins[ id ] > iMaxCoins )
		{
			// --| Example:
			// --| If player somehow has 3 coins, and the iGainCoins cvar is set to 2, will receive +2
			// --| so, that would be 5. instead of displaying 5/iMaxCoins( which is 4 atm ) will look ugly and unprofessional 5/4 coins.
			// --| so, just in case that the value is higher, will set it to maximum
			bCountTokenCoins[ id ] = iMaxCoins;
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}

		else if( bCountTokenCoins[ id ] == iMaxCoins )
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You have 1 UP [%d/%d Coins]!^nAfter death, you will respawn!", bCountTokenCoins[ id ], iMaxCoins );
			
			emit_sound( id, CHAN_ITEM, gLifeGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	
		else
		{
			ShowSyncHudMsg( id, gHudSyncronizer2, "You got %d coin%s from this body!", iGainCoins, iGainCoins == 1 ? "" : "s" );
			
			emit_sound( id, CHAN_ITEM, gCoinGained, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			set_pev( iEntity, pev_flags, FL_KILLME );
		}
	}
	
	return PLUGIN_CONTINUE;
}

public DisplayMarioCoinsHud( )
{
	new iPlayerCount, iPlayerId;
	new iPlayers[ MAX_PLAYERS ], szFormatHUDMessage[ 192 ];

	get_players( iPlayers, iPlayerCount, "ac" );
	
	for( i = 0; i < iPlayerCount; i++ )
	{
   		iPlayerId = iPlayers[ i ];

		set_hudmessage( 255, 127, 42, 0.0, 0.90, 0, 6.0, __HUD_MAXTIME + 0.1 );

		new iMaxCoins = get_pcvar_num( gCvarPluginMaxCoinsForLife );

		if( bCountTokenCoins[ iPlayerId ] >= iMaxCoins )
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "1 UP^nCoins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		else
		{
			formatex( szFormatHUDMessage, charsmax( szFormatHUDMessage ), "Coins: [%d/%d]", bCountTokenCoins[ iPlayerId ], iMaxCoins );
		}
			
		ShowSyncHudMsg( iPlayerId, gHudSyncronizer, szFormatHUDMessage );
	}
}

public RespawnPlayerAndResetCoins( iTaskid )
{
	new iVictim = iTaskid - __TASKID_RESPAWN_PLAYER;

	if( is_player( iVictim )
	&& !is_user_alive( iVictim ) 
	&& cs_get_user_team( iVictim ) != CS_TEAM_SPECTATOR )
	{
		set_hudmessage( 255, 255, 0, 0.08, 0.78, 0, 6.0, 4.0 );
		ShowSyncHudMsg( iVictim, gHudSyncronizer2, "You used 1 UP! Go go go!" );

		ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
		emit_sound( iVictim, CHAN_AUTO, gRespawned, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
		
		bCountTokenCoins[ iVictim ] = 0;
		
		remove_task( iVictim + __TASKID_RESPAWN_PLAYER );
	}
}

stock UTIL_DynamicLight( Float:flOrigin[ 3 ], r, g, b, a )
{
	engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin );
	write_byte( TE_DLIGHT );
	engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
	engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
	write_byte( 17 );
	write_byte( r );
	write_byte( g );
	write_byte( b );
	write_byte( a );
	write_byte( 10 );
	message_end( );
}
Добавено преди 26 минути 54 секунди:
THX OXI thread can be closed.

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 23 госта