AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   ...classname problem ! (https://forums.alliedmods.net/showthread.php?t=40561)

ZerroQ 06-29-2006 13:22

...classname problem !
 
Hello there!
I saw the plugin ( Glow weapons ) posted by ( Schnitzelmaker )
And i realised, i would like to remake this plugin so that it makes to glow only the Bomb ( map type's de_ ) what Terrorist team has to plant.

Here's the plugin code, i removed some weapon glow lines, so it makes to glow only one item... but the problem for me now is.. what's the classname for Bomb ?

Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <ns>
#include <fun>

#define PLUGIN "Glow Weapons"
#define VERSION "1.0"
#define AUTHOR "Schnitzelmaker"

new max_entities

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        set_task(0.1,"glow",_,_,_,"b")
        max_entities = get_global_int(GL_maxEntities)
        register_cvar("amx_glowbuild" ,"1")
}

public glow(){
glowbuildings("phasegate")
glowbuildings("team_turretfactory")
glowbuildings("team_observatory")
glowbuildings("team_infportal")
glowbuildings("team_prototypelab")
glowbuildings("team_command")
glowbuildings("team_armslab")
glowbuildings("siegeturret")
glowbuildings("resourcetower")
glowbuildings("turret")
glowbuildings("team_armory")
new i
for(i = 1 ; i <= max_entities ; i++){
        if (is_valid_ent(i) && ( entity_get_edict(i, EV_ENT_owner) == 0 )){
                new classname[64]
                entity_get_string(i, EV_SZ_classname, classname, 63)
                if (equal(classname , "weapon_bomb") ){
                        set_rendering(i,kRenderFxGlowShell,188,220,255,kRenderNormal,25)
                        }
                }
        }
}

public glowbuildings(name[]){
new i
new count = ns_get_build(name,0,0)
new temp
for (i = 1;i<=count;i++){
        temp = ns_get_build(name,0,i)
        if (ns_get_build(name,0,i) != ns_get_build(name,1,i)){
                set_rendering(temp,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
                }
        }
new count1 = ns_get_build(name,1,0)
new temp1
for (j = 1;j<=count1;j++){
temp1 = ns_get_build(name,1,j)
if (ns_get_build(name,1,j)){
        if (ns_get_mask(temp1,MASK_ELECTRICITY))
        {}
        else set_rendering(temp1,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
                }
        }
}


Hawk552 06-30-2006 12:13

Re: ...classname problem !
 
The bomb's classname is grenade. You should also check the model, which I think is w_backpack when not planted and w_c4 when planted.


All times are GMT -4. The time now is 08:05.

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