AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   About grenade explosion halo (https://forums.alliedmods.net/showthread.php?t=162820)

Osker Lee 07-23-2011 10:10

About grenade explosion halo
 
1 Attachment(s)
I want to creat a explosion halo when the grende is exploding,here is my plugin,but it didn't work in CS1.6,who can help me?
(CS1.6 V4554 + AMXMODX1.8.1 + Metamod1.19)
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
const m_fGrenadeState 114;
new 
exp;
new 
cvar_radius;
 
public 
plugin_init()
 
{
 
        
register_plugin("GrenadeEffect""1.0""xxx");
 
        
cvar_radius register_cvar("explosion_radius""200");
 
        
RegisterHam(Ham_Think"grenade""fw_ThinkGrenade");
 
}
 
public 
plugin_precache()
 
        
exp precache_model("sprites/shockwave.spr");
 
public 
fw_ThinkGrenade(ent)
 
{
 
        
// Invalid entity
 
        
if (!pev_valid(ent))
 
                return 
HAM_IGNORED;
 
 
 
        if (
get_pdata_int(entm_fGrenadeState) & (1<<0))
 
        {
 
                
blastcircles(ent);
 
        }
 
        return 
HAM_IGNORED;
 
}
 
public 
blastcircles(id)
 
{
 
        
client_print(0,print_chat,"blastcircles");
 
        new 
Float:forigin[3];
 
        
pev(idpev_originforigin);
 
        new 
blast get_pcvar_num(cvar_radius);
 
 
 
        
engfunc(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYforigin)
 
        
write_byte(TE_BEAMCYLINDER)
 
        
engfunc(EngFunc_WriteCoord,forigin[0])
 
        
engfunc(EngFunc_WriteCoord,forigin[1])
 
        
engfunc(EngFunc_WriteCoord,forigin[2] - 16)
 
        
engfunc(EngFunc_WriteCoord,forigin[0])
 
        
engfunc(EngFunc_WriteCoord,forigin[1])
 
        
engfunc(EngFunc_WriteCoord,forigin[2] - 16 blast)
 
        
write_short(exp)
 
        
write_byte(6
        
write_byte(2
        
write_byte(6
        
write_byte(90)  //
 
        
write_byte(4)   //
 
        
write_byte(238//
 
        
write_byte(130//
 
        
write_byte(238
        
write_byte(250
        
write_byte(5
        
message_end()
 
        
engfunc(EngFunc_MessageBeginMSG_PVS,SVC_TEMPENTITY,forigin)
 
        
write_byte(TE_PARTICLEBURST// TE id
 
        
engfunc(EngFunc_WriteCoord,forigin[0]) // x
 
        
engfunc(EngFunc_WriteCoord,forigin[1]) // y
 
        
engfunc(EngFunc_WriteCoord,forigin[2]) // z
 
        
write_short(240// 
        
write_byte(140// 
        
write_byte(2// 
        
message_end()
 
        
engfunc(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYforigin)
 
        
write_byte(TE_BEAMCYLINDER)
 
        
engfunc(EngFunc_WriteCoord,forigin[0])
 
        
engfunc(EngFunc_WriteCoord,forigin[1])
 
        
engfunc(EngFunc_WriteCoord,forigin[2] - 16)
 
        
engfunc(EngFunc_WriteCoord,forigin[0])
 
        
engfunc(EngFunc_WriteCoord,forigin[1])
 
        
engfunc(EngFunc_WriteCoord,forigin[2] - 2936 blast /2)
 
        
write_short(exp)
 
        
write_byte(1
        
write_byte(2
        
write_byte(4
        
write_byte(6)
 
        
write_byte(255
        
write_byte(255)
 
        
write_byte(255)
 
        
write_byte(255)
 
        
write_byte(255)  
 
        
write_byte(5
        
message_end()
 
        
engfunc(EngFunc_MessageBeginMSG_PVS,SVC_TEMPENTITY,forigin)
 
        
write_byte(TE_PARTICLEBURST// TE id
 
        
engfunc(EngFunc_WriteCoord,forigin[0]) // x
 
        
engfunc(EngFunc_WriteCoord,forigin[1]) // y
 
        
engfunc(EngFunc_WriteCoord,forigin[2]) // z
 
        
write_short(200// 
        
write_byte(100// 
        
write_byte(4// 
        
message_end()
 



Osker Lee 07-23-2011 16:42

Re: About grenade explosion halo
 
Now I know why,just because it clashs with some plugins.Now no bug! *(^_^)*


All times are GMT -4. The time now is 00:46.

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