Xmas Fireworks
#26
(12/12/2016, 10:16 AM)smurfavr escribió: I do not understand how to do it.

Install the plugin, inside the map you write /getmenu and you get the origins of where you want the fireworks to come out then copies what will come out and paste it in the .ini.

example: de_dust2 origins.
[de_dust2]
-1807.375854, 2206.531250, 36.031250
-1635.235107, 1853.161376, 36.031250
-1576.815429, 2686.399169, 36.031250
-603.653442, 2321.659667, -89.799728
-395.735931, 1882.453857, -91.968750
1387.429809, 2176.344970, 36.031250
1171.636108, 2421.072265, 132.031250

[Imagen: 20161212115030_1.jpg]
Responder
#27
Thank you all. I understand how it works.
Responder
#28
Why the plugin does not work on MAP with long names? Those not working.
hlk_ultimate_crossfire
hlk_crossfire_edition1

xmas_fireworks.ini

[hlk_crossfire_edition1]
-511.765625, 941.032592, -1659.968750
-550.533569, 592.835144, -1659.968750
-191.392868, 52.485973, -1819.968750
-455.156433, -832.039916, -1659.968750
200.076919, -871.182067, -1659.968750

amx_plugins
Xmas Fireworks 1.0 Milashkasiya xmas_fireworks. stopped
Responder
#29
(12/12/2016, 09:18 PM)smurfavr escribió: Why the plugin does not work on MAP with long names? Those not working.
hlk_ultimate_crossfire
hlk_crossfire_edition1

I dont know.

You can change the name of the map to a shorter one and try.
Responder
#30
If you change the name of MAP players will give them the error and should again bring down the MAP.

This is a problem with the plugin can it be fixed?
Responder
#31
Código PHP:
#define VERSION "1.0"

#include <amxmodx>
#include <engine>

// const
const HUD_COLOR 22 + ( 166 << ) + ( 60 << 16 // B + ( G << 8 ) + ( R << 16 )

// resources
new const mdl_rpgammo  [ ] = "models/w_rpgammo.mdl"
new const mdl_rpgrocket[ ] = "models/rpgrocket.mdl"
new const s_weapondrop1[ ] = "items/weapondrop1.wav"
new const s_rocket1    [ ] = "fireworks/rocket1.wav"
new const spr_laserbeam[ ] = "sprites/laserbeam.spr"
new const spr_flare6   [ ] = "sprites/flare6.spr"
new const spr_lgtning  [ ] = "sprites/lgtning.spr"
new const spr_explode1 [ ] = "sprites/explode1.spr"
new const spr_steam1   [ ] = "sprites/steam1.spr"

new const spr_flares[ ][ ] =
{
    
"sprites/fireworks/bflare.spr",
    
"sprites/fireworks/rflare.spr",
    
"sprites/fireworks/gflare.spr",
    
"sprites/fireworks/tflare.spr",
    
"sprites/fireworks/oflare.spr",
    
"sprites/fireworks/pflare.spr",
    
"sprites/fireworks/yflare.spr"
}

// resources index
new spr_laserbeam_id
new spr_flare6_id
new spr_lgtning_id
new spr_explode1_id
new spr_steam1_id
new spr_flares_idsizeof spr_flares ]

// entity
new const xmas_shooter  [ ] = "xmas_shooter" // shooter classname
new const xmas_fireworks[ ] = "xmas_fireworks" // firework classname
new const Float:vecMins] = { -4.0, -4.0, -1.0 }
new const 
Float:vecMaxs] = { 4.0 4.0 12.0 }

// arrays
new Array:aOrigins

// cvars
new cvar_enable
new cvar_times
new cvar_shots
new cvar_lights

// global
new g_originsnum
new g_rocketsnum
new g_showhudmsg

public plugin_precache( )
{
    
precache_modelmdl_rpgammo )
    
precache_model"models/w_rpgammot.mdl" )
    
precache_modelmdl_rpgrocket )    
    
precache_sounds_weapondrop1 )
    
precache_sounds_rocket1 )
    
    
spr_laserbeam_id precache_modelspr_laserbeam )
    
spr_flare6_id precache_modelspr_flare6 )
    
spr_lgtning_id precache_modelspr_lgtning )
    
spr_explode1_id precache_modelspr_explode1 )
    
spr_steam1_id precache_modelspr_steam1 )
    
    for( new 
isizeof spr_flaresi++ )
    {
        
spr_flares_id] = precache_modelspr_flares[i] )
    }
}

public 
plugin_init( )
{
    
// original plugin: https://forums.alliedmods.net/showthread.php?t=3638
    
register_plugin"Xmas Fireworks"VERSION"Milashkasiya" )
    
    
register_thinkxmas_fireworks"think_fireworks" )
    
register_touch"*"xmas_fireworks"touch_fireworks" )
    
    
cvar_enable register_cvar"xfireworks_enable""1" )
    
cvar_times register_cvar"xfireworks_times""2" )
    
cvar_shots register_cvar"xfireworks_shots""8" )
    
cvar_lights register_cvar"xfireworks_lights""1" )
    
    
load_origins( )
    
set_task0.8"task_realtime" )
}

public 
task_realtime( )
{
    
#define T_COMPENSATION 10.0
    #define EF_DURATION 10.0
    
    
new Float:flTimeleft floatget_timeleft() )
    new 
Float:flTimes get_pcvar_floatcvar_times )
    new 
Float:flTimer
    
    
if( !flTimeleft )
    {
        
flTimer random_float600.0900.0 )
    }
    else
    {
        
flTimer = ( flTimeleft flTimes ) - ( T_COMPENSATION flTimes )
        
        if( 
flTimer EF_DURATION )
        {
            
flTimes flTimeleft EF_DURATION 
            flTimer 
= ( flTimeleft flTimes ) - ( T_COMPENSATION flTimes )
        }
    }    
    
set_taskflTimer"task_prepare_shooter"___"a"floatround(flTimes) )
}

public 
task_prepare_shooter( )
{
    if( !
get_pcvar_num(cvar_enable) )
        return
    
    
create_shooter( )
}

create_shooter( )
{
    new 
entity
    
new Float:vecOrigin]
    
    new 
shots get_pcvar_numcvar_shots )
    
g_rocketsnum shots g_originsnum
    g_showhudmsg 
g_originsnum 2
    
    
for( new ig_originsnumi++ )
    {
        
entity create_entity"info_target" )
        
assert entity
        
        entity_set_string
entityEV_SZ_classnamexmas_shooter )
        
entity_set_modelentitymdl_rpgammo )
    
        
entity_set_intentityEV_INT_movetypeMOVETYPE_TOSS )
        
entity_set_intentityEV_INT_iuser1shots )
        
        
ArrayGetArrayaOriginsivecOrigin )
        
entity_set_originentityvecOrigin )
        
DispatchSpawnentity )
        
        
emit_soundentityCHAN_WEAPONs_weapondrop1VOL_NORMATTN_NORM0PITCH_NORM )
        
        
set_taskrandom_float(0.11.5), "task_prepare_fireworks"entity_:vecOrigin 3"a"shots )
    }    
}

public 
task_prepare_fireworksorigin[3], shooter )
{
    
create_fireworksshooterFloat:origin )
    
    new 
iShots entity_get_intshooterEV_INT_iuser1 ) - 1
    
if( !iShots )
    {
        
remove_entityshooter )
    }
    else
    {
        
entity_set_intshooterEV_INT_iuser1iShots )
    }
}

create_fireworksshooterFloat:origin[3] )
{
    new 
entity create_entity"info_target" )
    
assert entity
    
    entity_set_string
entityEV_SZ_classnamexmas_fireworks )
    
entity_set_modelentitymdl_rpgrocket )
    
entity_set_sizeentityvecMinsvecMaxs )
    
    
entity_set_intentityEV_INT_solidSOLID_SLIDEBOX )
    
entity_set_intentityEV_INT_movetypeMOVETYPE_TOSS )
    
entity_set_floatentityEV_FL_fuser1get_gametime() + random_float(2.04.0) + 0.1 )
    
entity_set_edictentityEV_ENT_ownershooter )
    
entity_set_vectorentityEV_VEC_anglesFloat:{90.00.00.0} )
    
entity_set_originentityorigin )
    
DispatchSpawnentity )
    
    
// beamfollow effect
    
message_beginMSG_BROADCASTSVC_TEMPENTITY )
    
write_byteTE_BEAMFOLLOW )
    
write_shortentity )
    
write_shortspr_laserbeam_id )
    
write_byte60 )
    
write_byte)
    
write_byterandom(256) )
    
write_byterandom(256) )
    
write_byterandom(256) )
    
write_byterandom_num(200255) )
    
message_end( )
    
    
emit_soundentityCHAN_WEAPONs_rocket1VOL_NORMATTN_NORM0PITCH_NORM )
    
entity_set_floatentityEV_FL_nextthinkget_gametime() + 0.1 )
}

public 
think_fireworks( const entity )
{
    static 
Float:flGametime
    flGametime 
get_gametime( )
    
    if( 
entity_get_float(entityEV_FL_fuser1) <= flGametime )
    {
        
explode_rocketentity )
    }
    else
    {
        static 
Float:vecVelocity]
        
vecVelocity] = random_float( -100.0100.0 )
        
vecVelocity] = random_float( -100.0100.0 )
        
vecVelocity] = random_float800.01800.0 )
        
entity_set_vectorentityEV_VEC_velocityvecVelocity )
        
entity_set_floatentityEV_FL_nextthinkflGametime random_float0.11.5) )
    }
}

public 
touch_fireworks( const touched, const toucher )
{
    
explode_rockettoucher )
}

explode_rocket( const rocket )
{
    new 
output64 ]
    if( 
get_pcvar_num(cvar_lights) )
    {        
        if( --
g_rocketsnum )
        {
            
formatexoutputcharsmax(output), "%c"random_num('d','z') )
        }
        else
        {
            
formatexoutputcharsmax(output), "#OFF" )
        }
        
set_lightsoutput )
    }
    
    if( 
g_rocketsnum <= g_showhudmsg )
    {
        new 
len formatexoutputcharsmax(output), "FELIZ NAVIDAD Y PROSPERO AÑO NUEVO :)" ) + 31
        __show__dhudmessage
outputlen_:-1.0_:0.28 )
    }
    
    new 
Float:vecOrigin]
    
entity_get_vectorrocketEV_VEC_originvecOrigin )

    
//////////////////////////////////////////////
    
message_begin_fMSG_PVSSVC_TEMPENTITYvecOrigin )
    
write_byteTE_BEAMDISK )
    
write_coord_fvecOrigin[0] )
    
write_coord_fvecOrigin[1] )
    
write_coord_fvecOrigin[2] )
    
write_coord)
    
write_coord)
    
write_coord100 )
    
write_shortrandom(2) ? spr_flare6_id spr_lgtning_id )
    
write_byte100 )
    
write_byte)
    
write_byte35 // life
    
write_byte// line width
    
write_byte150 // noise
    
write_byterandom(256) )
    
write_byterandom(256) )
    
write_byterandom(256) )
    
write_byte255 )
    
write_byte)
    
message_end( )

    
//////////////////////////////////////////////
    
message_beginMSG_BROADCASTSVC_TEMPENTITY )
    
write_byteTE_SPRITETRAIL )
    
write_coord_fvecOrigin[0] )
    
write_coord_fvecOrigin[1] )
    
write_coord_fvecOrigin[2] - 20 )
    
write_coord_fvecOrigin[0] )
    
write_coord_fvecOrigin[1] )
    
write_coord_fvecOrigin[2] + 20 )
    
write_shortspr_flares_idrandom(sizeof spr_flares) ] )
    
write_byterandom_num(50100) ) // count
    
write_byte10 // life in 0.1's
    
write_byte10 // scale in 0.1's
    
write_byterandom_num(40100) ) // velocity along vector in 10's
    
write_byte60 // randomness of velocity in 10's
    
message_end( )
    
    
////////////////////////////////////////////// 
    
message_begin_fMSG_PASSVC_TEMPENTITYvecOrigin )
    
write_byteTE_EXPLOSION 
    
write_coord_fvecOrigin[0] )
    
write_coord_fvecOrigin[1] )
    
write_coord_fvecOrigin[2] )
    
write_shortspr_explode1_id 
    
write_byterandom_num(1020) ) // byte (scale in 0.1's) 188 
    
write_byte10 // byte (framerate) 
    
write_byte// byte flags 
    
message_end( )
    
    
//////////////////////////////////////////////    
    
message_begin_fMSG_PASSVC_TEMPENTITYvecOrigin )
    
write_byteTE_TAREXPLOSION )
    
write_coord_fvecOrigin[0] )
    
write_coord_fvecOrigin[1] )
    
write_coord_fvecOrigin[2] - 40.0 )
    
message_end( )
    
    
////////////////////////////////////////////// 
    
message_begin_fMSG_PVSSVC_TEMPENTITYvecOrigin 
    
write_byteTE_SMOKE )
    
write_coord_fvecOrigin[0] )
    
write_coord_fvecOrigin[1] )
    
write_coord_fvecOrigin[2] )
    
write_shortspr_steam1_id 
    
write_byterandom_num(2040) )
    
write_byte12 )
    
message_end( )
    
    
//////////////////////////////////////////////
    
message_begin_fMSG_PVSSVC_TEMPENTITYvecOrigin )
    
write_byteTE_DLIGHT )
    
write_coord_fvecOrigin[0] )
    
write_coord_fvecOrigin[1] )
    
write_coord_fvecOrigin[2] )
    
write_byterandom_num(2050) )
    
write_byterandom(256) )
    
write_byterandom(256) )
    
write_byterandom(256) )
    
write_byte100 )
    
write_byte15 )
    
message_end( )
    
    
remove_entityrocket )
}

// http://forums.alliedmods.net/showthread.php?t=149210
__show__dhudmessage( const szMessage[], iLenx)
{
    
message_beginMSG_BROADCAST SVC_DIRECTOR )
    
write_byteiLen )
    
write_byteDRC_CMD_MESSAGE )
    
write_byte// effect
    
write_longHUD_COLOR )
    
write_long)
    
write_long)
    
write_long0x3F800000 // fadeintime
    
write_long0x3F800000 // fadeouttime
    
write_long0x40A00000 // holdtime
    
write_long// fxtime
    
write_stringszMessage )
    
message_end( )
}

load_origins( )
{    
    new 
output128 ]
    
get_localinfo"amxx_configsdir"outputcharsmax(output) )
    
addoutputcharsmax(output), "/xmas_fireworks.ini" )
    
    if( !
file_exists(output) )
    {
        
set_fail_state"xmas_fireworks.ini doesn't exist" )
        return
    }
    
    
aOrigins ArrayCreate)
    
    new 
map35 ]
    new 
len get_mapnamemapcharsmax(map) )
    
    new 
bool:match
    
    
new origin][ 35 ]
    new 
Float:vecOrigin]
    
    new 
file fopenoutput"rt" )
    while( !
feof(file) )
    {
        
fgetsfileoutputcharsmax(output) )
        
trimoutput )
        
        if( !
output[0] || output[0] == ';' )
            continue
        
        if( !
match )
        {
            if( 
output[0] == '[' && equal(output[1], maplen) && output[len 1] == ']' )
            {
                
match true
            
}
        }
        else
        {
            if( 
output[0] == '[' )
                break
            
            if( 
parse(outputorigin[0], charsmax(origin[]), origin[1], charsmax(origin[]), origin[2], charsmax(origin[])) < )
                continue
            
            
vecOrigin] = str_to_floatorigin[0] )
            
vecOrigin] = str_to_floatorigin[1] )
            
vecOrigin] = str_to_floatorigin[2] )
            
            
ArrayPushArrayaOriginsvecOrigin )
            
g_originsnum++
        }
    }
    
fclosefile )
    
    if( !
g_originsnum )
    {
        
log_amx"%s doesn't exist in the xmas_fireworks.ini file"map )
        
pause"ad" )
    }


Try with this.
Responder
#32
Error

[ 24] unknown unknown unknown xmas_fireworks. bad load

( 24) Load fails: Plugin uses an unknown function (name "write_coord_f") - check your modules.ini.
Responder
#33
(12/12/2016, 09:57 PM)smurfavr escribió: Error

[ 24] unknown unknown unknown xmas_fireworks. bad load

( 24) Load fails: Plugin uses an unknown function (name "write_coord_f") - check your modules.ini.

https://amxmodx-es.com/Thread-Xmas-Firew...7#pid49507
[Imagen: b_350_20_323957_202743_f19a15_111111.png]

(18/11/2014, 05:47 PM)Neeeeeeeeeel.- escribió: Por qué necesitan una guía para todo? Meté mano y que salga lo que salga... es la mejor forma de aprender.

(16/05/2016, 11:08 PM)kikizon2 escribió: No cabe duda que tienen mierda en vez de cerebro, par de pendejos v:
Responder
#34
OsweRRR
I'm using this version, but have a problem with it.

https://amxmodx-es.com/Thread-Xmas-Firew...#pid148163
Responder
#35
(13/12/2016, 06:41 AM)smurfavr escribió: OsweRRR
I'm using this version, but have a problem with it.

https://amxmodx-es.com/Thread-Xmas-Firew...#pid148163

Just change the name of the map to a shorter and ready one. No errors and only have to download the map again.
Responder
#36
The problem comes from the plugin. I asked Lev(author of dproto.) and he told me how to fix the problem.

Lev escribió:Change
Código:
    new map[ 16 ]
    new len = get_mapname( map, charsmax(map) )
into
Código:
    new map[ 64 ]
    new len = get_mapname( map, charsmax(map) )
Responder
#37
Oigan pero en que parte del sma puedo editarlo para que los cohetes no exploten tan arriba por que de verdad es molesto ya que hay mapas que el cielo es muy bajo como ya explicaron allá arriba, de_dust2, es uno de tantos mapas, entonces mi pregunta en si es... abra forma de que los cohetes no exploten tan arriba? si se pudiera bajar seria exelente Gran sonrisa Whatever
Responder
#38
[de_dust2]
-615.102111, 2368.267578, -83.991500
-1633.607055, 2061.891845, 36.031250
1070.965576, 2588.162841, 132.031250
1505.086791, 1741.692260, 36.031250
1085.048828, 929.781799, 36.031250
463.504272, -18.031536, 36.031250
-1160.620239, -774.261840, 164.031250
-1672.725830, 192.770233, 36.031250
-302.410552, 559.187927, 36.031250

Anyone have this better? The Rockets are to high and dont explode there. Triste

see here https://www.youtube.com/watch?v=ZNqxdslB...e=youtu.be
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)