Ok, dabar kitas klausymas. ;D
Tai kaip po galais sukurti ta efektą, kad pvz., jis priklausytu nuo to, kaip aš nurodau? Pvz.:
Jeigu darau tik
MakeFx( id, "fxLightning" );
tai imtu default (arba išvis neveiktu, čia nesvarbu), o jeigu darau su savo norimais parametrais tai ir efektas būtų pagal juos (pvz.
MakeFx( id, "fxLightning", "sprites/lgtning.spr", 10.0, 1.0, 1.0, 1.0, 255, 255, 255, 200, 10.0 );
)
Šiuo metu bandau padaryti -->
kodas
Code: Select all
new MultiLightning public MultiLightningFX(id){ new vec[3] get_user_origin(id, vec) emit_sound(id, CHAN_STATIC, "FX/Lightning.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) //play the sound file for(new i; i < 5; i++) //how many lightnings depends on how big the const 'i' is. { message_begin(MSG_PVS, SVC_TEMPENTITY) write_byte(TE_BEAMENTPOINT) write_short(id) //start entity write_coord(vec[0] + random_num(-200, 200)) //end position X write_coord(vec[1] + random_num(-200, 200)) //end position Y write_coord(vec[2] + random_num(-200, 200)) //end position Z write_short(MultiLightning) //set SPR file write_byte(2) //starting frame write_byte(10) //frame rate in 0.1's write_byte(6) //life in 0.1's write_byte(10) //line width in 0.1's write_byte(100) //noise amplitude in 0.01's write_byte(36) //R write_byte(70) //G write_byte(232) //B write_byte(230) //brightness write_byte(30) //scroll speed in 0.1's message_end( ); } set_task(1.5, "MultiLightningFX", id)} public plugin_precache(){ precache_sound("FX/Lightning.wav") MultiLightning = precache_model( "sprites/lgtning.spr" );}