sma plugin furien invasion

secundele de freeztime se pot modifica de la linia:

new SecondsUntillInvasion = 6;

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

#include < amxmodx >
#include < dhudmessage >
#include < csx >

#pragma semicolon 1

#define PLUGIN "Furien Invasion "
#define VERSION "1.0"
#define AUTHOR "Askhanar | Adventx"

new const InvasionSounds[ 6 ][ ] = {

"timestart",
"timer01",
"timer02",
"timer03",
"timer04",
"timer05"
};

new SecondsUntillInvasion = 6;
new mp_freezetime, g_TextMsg;

new const g_szSound_tero[ ] = "misc/furien_win1.wav";
new const g_szSound_ctero[ ] = "misc/antifurien_win1.wav";

public plugin_init( )
{
register_plugin( PLUGIN, VERSION, AUTHOR );

register_event( "HLTV", "ev_HookRoundStart", "a", "1=0", "2=0" );
register_event( "SendAudio","ev_TerroWin","a","2=%!MRAD_terwin");
register_event( "SendAudio","ev_CounterWin","a","2=%!MRAD_ctwin");

mp_freezetime = get_cvar_pointer( "mp_freezetime" );
set_pcvar_num( mp_freezetime, 5 );

g_TextMsg = get_user_msgid( "TextMsg" );
register_message( g_TextMsg, "Hook_TextMessages" );
}

public plugin_precache( )
{
new soundpath[ 64 ];
for( new i = 0 ; i < 6 ; i++ )
{
formatex( soundpath, sizeof ( soundpath ) -1 , "misc/%s.wav", InvasionSounds[ i ] );
precache_sound( soundpath );
}

precache_sound(g_szSound_tero);
precache_sound(g_szSound_ctero);
}


public ev_HookRoundStart( )
{

SecondsUntillInvasion = 5;
set_task( 0.1, "CountDown" );
}
public CountDown( )
{
if( SecondsUntillInvasion > 0 )
{
TerroTeamEffects();
CounterTeamEffects();

set_dhudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 0.3, 0.0, 1.0);
client_cmd(0,"spk misc/%s",InvasionSounds[ SecondsUntillInvasion ] );
static const Seconds[6][ ] = { "","o","doua","trei","patru","cinci" };
show_dhudmessage( 0, "Furienii vor invada planeta in %s secund%s !",Seconds[ SecondsUntillInvasion ] , SecondsUntillInvasion == 1? "a" : "e");

}

else if( SecondsUntillInvasion <= 0 )
{
set_dhudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 2.0, 0.0, 1.0 );
show_dhudmessage( 0, "Furienii au invadat planeta !");
client_cmd(0,"spk misc/%s",InvasionSounds[ SecondsUntillInvasion ] );
return 1;
}

SecondsUntillInvasion -= 1;
set_task( 1.0, "CountDown");

return 0;
}

public ev_TerroWin( )
{
client_cmd(0, "stopsound;mp3 stop");
client_cmd(0,"spk %s", g_szSound_tero);

set_dhudmessage( 200, 10, 10, -1.0, 0.20, 0, 0.0, 2.0, 0.0, 5.0);
show_dhudmessage( 0, "Furienii au castigat !^nPlaneta a fost cucerita!" );

return 1;
}

public ev_CounterWin( )
{
client_cmd(0, "stopsound;mp3 stop");
client_cmd(0,"spk %s", g_szSound_ctero);

set_dhudmessage( 10, 10, 200, -1.0, 0.20, 0, 0.0, 2.0, 0.0, 5.0);
show_dhudmessage( 0, "AntiFurienii au castigat !^nPlaneta a fost salvata !" );

return 1;
}

public Hook_TextMessages( iMsgId, iMsgDest, id )
{
static szMsg[ 64 ];
get_msg_arg_string( 2, szMsg, sizeof ( szMsg ) - 1 );

if(equal( szMsg, "#Game_bomb_drop" ) )
{

set_dhudmessage( 255, 0, 0, -1.0, 0.30, 0, 0.0, 3.5, 0.1, 0.1 );
show_dhudmessage( 0, "" );
return PLUGIN_HANDLED;
}

if(equal( szMsg, "#Game_bomb_pickup" ) || equal( szMsg, "#Got_bomb" ) )
{
set_dhudmessage( 255, 0, 0, -1.0, 0.40, 0, 0.0, 3.5, 0.1, 0.1 );
show_dhudmessage( 0, "" );
return PLUGIN_HANDLED;
}

else if(equal(szMsg, "#Bomb_Planted"))
{
set_dhudmessage(255, 0, 0, -1.0, 0.29, 0, 0.0, 3.0, 0.0, 1.0);
show_dhudmessage(0, "Bomba a fost Plantata!");
return PLUGIN_HANDLED;
}

return PLUGIN_CONTINUE;
}

public TerroTeamEffects( )
{
new iPlayers[32];
new iPlayersNum;

get_players(iPlayers, iPlayersNum, "aceh", "TERRORIST");

for( new i = 0 ; i < iPlayersNum ; i++ )
{
if( is_user_connected(iPlayers[i]) )
{
ShakeScreen(iPlayers[i], 1.0);
}
}
}
public CounterTeamEffects( )
{
new iPlayers[32];
new iPlayersNum;

get_players(iPlayers, iPlayersNum, "aceh", "CT");

for( new i = 0; i < iPlayersNum ; i++ )
{
if( is_user_connected(iPlayers[i]) )
{
ShakeScreen(iPlayers[i], 1.0);
}
}
}

public ShakeScreen(id, const Float:seconds)
{
message_begin(MSG_ONE, get_user_msgid("ScreenShake"), {0, 0, 0}, id);
write_short(floatround(4096.0 * seconds, floatround_round));
write_short(floatround(4096.0 * seconds, floatround_round));
write_short(1<<9);
message_end( );
}

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Compilare sma se face de pe PC, intrucat aveti nevoie de include, acesta il descarcati de aici:  https://forums.alliedmods.net/showthread.php?s=b2adaa24fca7b939d326746ee06c9da0&t=149210

Sursa : internet

 

Comentarii

Trebuie să fii autentificat pentru a adăuga un comentariu!

Nu a fost făcut nici un comentariu.

FidelityWorks.ro foloseste cookies pentru a-ti oferi o experienta cat mai placuta. Mai multe detalii