Raised This Month: $ Target: $400
 0% 

need help with smoke from smoke nade


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 11-21-2006 , 13:16   need help with smoke from smoke nade
Reply With Quote #1

hi, i need help with this code(its taken from ghw chronic's nade 'em)
all i wanna do is to connect smoke_explosion1 to a smoke from "smoke nade"(and replace it), so when a "smoke nade" explodes the smoke dont appear(or its deleted) and the new smoke from this plugin is created

the main purpose of this plugin is to fix lags when close to a smoke from "smoke nade"

ps. dont shoot me for the effect, i will finish it when i find a way to replace the smoke, so pls help me guys

Code:

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <fakemeta> new smokesprite new smokespritex public plugin_init() {     register_plugin("SmokeNadeFix","0.1","GHW_Chronic") } public plugin_precache() {     smokesprite = precache_model("sprites/smokepuff.spr")         smokespritex = precache_model("sprites/wall_puff1.spr") } public smoke_explode1(id) {     if(!pev_valid(id))     {         return PLUGIN_HANDLED     }     emit_sound(id,CHAN_WEAPON,"weapons/sg_explode.wav",1.0,ATTN_NORM,0,PITCH_NORM)     set_task(0.6,"smoke_explode",id,"",0,"a",34)     set_task(0.6,"smoke_explodex",id,"",0,"a",34)     set_task(20.5,"smoke_delete",id)     set_task(20.6,"smoke_delete",id)     return PLUGIN_HANDLED } public smoke_explodex(id) {     if(!pev_valid(id))     {         return PLUGIN_HANDLED     }     new Float:origin2[3]     pev(id,pev_origin,origin2)     new origin[3]     origin[0] = floatround(origin2[0]) + random_num(-75,75)     origin[1] = floatround(origin2[1]) + random_num(-75,75)     origin[2] = floatround(origin2[2]) + random_num(0,65)     message_begin( MSG_BROADCAST,SVC_TEMPENTITY,origin)     write_byte( 3 )     write_coord(origin[0])  // start position     write_coord(origin[1])     write_coord(origin[2])     write_short(smokespritex)     write_byte( 60 ) // byte (scale in 0.1's) 188     write_byte( 5 ) // byte (framerate)     write_byte( 14 ) // byte flags     message_end()     return PLUGIN_HANDLED } public smoke_explode(id) {     if(!pev_valid(id))     {         return PLUGIN_HANDLED     }     new Float:origin2[3]     pev(id,pev_origin,origin2)     new origin[3]     origin[0] = floatround(origin2[0]) + random_num(-75,75)     origin[1] = floatround(origin2[1]) + random_num(-75,75)     origin[2] = floatround(origin2[2]) + random_num(0,65)     message_begin( MSG_BROADCAST,SVC_TEMPENTITY,origin)     write_byte( 3 )     write_coord(origin[0])  // start position     write_coord(origin[1])     write_coord(origin[2])     write_short(smokesprite)     write_byte( 30 ) // byte (scale in 0.1's) 188     write_byte( 5 ) // byte (framerate)     write_byte( 14 ) // byte flags     message_end()     return PLUGIN_HANDLED } public smoke_delete(id) {     if(!pev_valid(id))     {         return PLUGIN_HANDLED     }     engfunc(EngFunc_RemoveEntity,id)     return PLUGIN_HANDLED } public set_velocities(id) {     if(!pev_valid(id))     {         return PLUGIN_HANDLED     }     new Float:velocity[3]     pev(id,pev_velocity,velocity)     velocity[0] *= 0.9     velocity[1] *= 0.9     velocity[2] *= 0.9     set_pev(id,pev_velocity,velocity)     return PLUGIN_HANDLED }
__________________
Voi is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode