[Plugin AmxModX] Smoke Explode

Pluginuri pentru Counter Strike 1.6
Avatar utilizator
Duracel
Membru
Mesaje: 109

[Plugin AmxModX] Smoke Explode

Mesaj de Duracel » Vin Oct 28, 2016 2:40 pm

Descriere: Acest plugin este facut special pentru ZP, si anume, cand arunci cu smoke, el va explode si ii va face un anumit damage jucatorului. + Printare in chat.

Descarcare:

[spoiler]#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < engine >
#include < zombieplague >

#define PLUGIN "Smoke Explode"
#define VERSION "1.0"
#define AUTHOR "LondoN eXtream"

#define CHAT_PREFIX "ZM"

// pev types
const PEV_NADE_TYPE = pev_flTimeStepSound;
const PEV_NADE_TYPE_SMOKE = 681856;

// Variables
new g_Explo = 0;

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

RegisterHam ( Ham_Think, "grenade", "HamThink" );
}

public HamThink ( entity )
{
if ( !pev_valid ( entity ) )
return HAM_IGNORED;

new Float:dmgtime;
pev ( entity, pev_dmgtime, dmgtime );
if ( dmgtime > get_gametime ( ) )
return HAM_IGNORED;


if ( pev ( entity, PEV_NADE_TYPE ) != PEV_NADE_TYPE_SMOKE )
return HAM_IGNORED;

SmokeExplode ( entity );

engfunc ( EngFunc_RemoveEntity, entity );
return HAM_SUPERCEDE;
}

SmokeExplode ( entity ) {
new Float: Origin [ 3 ], Float: clOrigin [ 3 ], Float: Velocity [ 3 ], Float: Distance, Float: Damage;
new Special [ 3 ], szName [ 32 ];
new health, owner, i;

pev ( entity, pev_origin, Origin );
FVecIVec ( Origin, Special );

owner = pev ( entity, pev_owner );

if ( !pev_valid ( owner ) || !is_user_connected ( owner ) )
{
engfunc ( EngFunc_RemoveEntity, entity );
return;
}


message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte ( TE_EXPLOSION );
write_coord ( Special [ 0 ] );
write_coord ( Special [ 1 ] );
write_coord ( Special [ 2 ] );
write_short ( g_Explo );
write_byte ( 32 );
write_byte ( 16 );
write_byte ( 0 );
message_end ( );

for ( i = 1; i <= get_maxplayers ( ); i++ )
{
if ( !is_user_alive ( i ) )
continue;
if ( !zp_get_user_zombie ( i ) )
continue;

pev ( i, pev_origin, clOrigin );
Distance = get_distance_f ( Origin, clOrigin );
if ( Distance < 330 )
{
Damage = 700.0 - Distance;
health = get_user_health ( i );
Damage = float ( floatround ( Damage ) );
pev ( i, pev_velocity, Velocity );

Velocity [ 0 ] += random_float ( -230.0, 230.0 );
Velocity [ 1 ] += random_float ( -230.0, 230.0 );
Velocity [ 2 ] += random_float ( 60.0, 129.0 );

set_pev ( i, pev_velocity, Velocity );

message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, i );
write_short ( 4096 );
write_short ( 4096 );
write_short ( 0x0000 );
write_byte ( 225 );
write_byte ( 0 );
write_byte ( 0 );
write_byte ( 220 );
message_end ( );

message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, i );
write_short ( 4096 * 6 );
write_short ( 4096 * random_num ( 4, 12 ) );
write_short ( 4096 * random_num ( 4, 12 ) );
message_end ( );

if ( health - floatround ( Damage ) < 0 )
{
ExecuteHamB ( Ham_Killed, i, owner, 2 );
}
else
{
ExecuteHamB ( Ham_TakeDamage, i, entity, owner, Damage, DMG_MORTAR );
}

get_user_name ( i, szName, sizeof ( szName ) -1 );
ColorChat ( owner, "!x04[%s] !x03Damage to !x04%s !x03:: !x04%d", CHAT_PREFIX, szName, floatround ( Damage ) );

}
}
}

stock ColorChat(const id, const input[], any:...) {
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);

replace_all(msg, 190, "!x04", "^4");
replace_all(msg, 190, "!x03", "^3");

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, get_user_msgid("SayText"), _, players);
write_byte(players);
write_string(msg);
message_end();
}
}
}
}[/spoiler]

Nume: [ZP] Smoke Explode
Versiune: 1.0
Link oficial: aici
Autor:: LondoN
Credite:

^ionutz^ - m-a ajutat cu un stock colorchat bun.
MzQ* - mi-a dat o parte din cod mai demult.

Instalare:
1. Fisierul SmokeExplode.sma il puneti in addons/amxmodx/scripting
2. Fisierul SmokeExplode.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Cod: Selectaţi tot

SmokeExplode.amxx
4. Intrati in zombieplague.cfg si dezactivati napalm nade.

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
nu sunt

Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
nu sunt

Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
nu sunt

Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
fakemeta
engine
hamsandwich[/b]

Înapoi la “Pluginuri”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 1 vizitator