Raised This Month: $12 Target: $400
 3% 

Laser green in class human


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuTo
Senior Member
Join Date: Mar 2010
Location: Brazil - SP
Old 09-30-2017 , 12:43   Laser green in class human
Reply With Quote #1

hello, the part code green laser code, it does not work, I can not fix somebody can help me?

PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

    #include < zp50_core >
    #include < zp50_class_human >

#define _PLUGIN     "[ZP50] Human Class: Tatico"
#define _VERSION                 "1.0"
#define _AUTHOR               "H.RED.ZONE"

#define flag_get(%1,%2)            (%1 & (1 << (%2 & 31)))
#define flag_get_boolean(%1,%2)    (flag_get(%1,%2) ? true : false)
#define flag_set(%1,%2)            %1 |= (1 << (%2 & 31))
#define flag_unset(%1,%2)          %1 &= ~(1 << (%2 & 31))

#define PISTOL_WEAPONS_BIT        (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_DEAGLE|1<<CSW_P228|1<<CSW_FIVESEVEN|1<<CSW_ELITE)
#define PISTOL_WEAPONS_BIT        (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_DEAGLE|1<<CSW_P228|1<<CSW_FIVESEVEN|1<<CSW_ELITE)
#define SHOTGUN_WEAPONS_BIT       (1<<CSW_M3|1<<CSW_XM1014)
#define SUBMACHINE_WEAPONS_BIT    (1<<CSW_TMP|1<<CSW_MAC10|1<<CSW_MP5NAVY|1<<CSW_UMP45|1<<CSW_P90)
#define RIFLE_WEAPONS_BIT         (1<<CSW_FAMAS|1<<CSW_GALIL|1<<CSW_AK47|1<<CSW_SCOUT|1<<CSW_M4A1|1<<CSW_SG550|1<<CSW_SG552|1<<CSW_AUG|1<<CSW_AWP|1<<CSW_G3SG1)
#define MACHINE_WEAPONS_BIT       (1<<CSW_M249)

#define PRIMARY_WEAPONS_BIT       (SHOTGUN_WEAPONS_BIT|SUBMACHINE_WEAPONS_BIT|RIFLE_WEAPONS_BIT|MACHINE_WEAPONS_BIT)
#define SECONDARY_WEAPONS_BIT     (PISTOL_WEAPONS_BIT)

#define IsPrimaryWeapon(%1)       ((1<<%1) & PRIMARY_WEAPONS_BIT)
#define IsSecondaryWeapon(%1)     ((1<<%1) & PISTOL_WEAPONS_BIT)

new g_HumanClassID

new g_LaserSprite

new _bitPlayerLaserSight

new const g_szLaserSprite[ ] = "sprites/zbeam4.spr"

new const humanclass1_name[] = "Humano Tatico"
new const humanclass1_info[] = "\y[\dCOM MIRA LASER\y]"
new const humanclass1_models[][] = { "arctic" "guerilla" "leet" "terror" "gign" "gsg9" "sas" "urban" }
const 
humanclass1_health 100
const Float:humanclass1_speed 0.90
const Float:humanclass1_gravity 1.0

public plugin_init( ) {
    
register_plugin_PLUGIN_VERSION_AUTHOR)
    
    
// Prethink Needs To Be Used For Laser.
    
register_forwardFM_PlayerPreThink"FW__PlayerPreThink"false )
    
    
// Register New Round.
    
register_event"HLTV""Event_HLTV_New_Round""a""1=0""2=0" )
    
    
RegisterHamHam_Killed"player""FW__PlayerKilled_Post")
}

public 
plugin_precache( ) {
    
    
g_LaserSprite precache_modelg_szLaserSprite )
    
    
g_HumanClassID zp_class_human_registerhumanclass1_namehumanclass1_infohumanclass1_healthhumanclass1_speedhumanclass1_gravity )
    
    for ( new 
index 0index sizeof humanclass1_modelsindex++ )
        
zp_class_human_register_modelg_HumanClassIDhumanclass1_models[index] )
}  

// Player PreThink Needs To Be Used For Sprite To Be Strong.
public FW__PlayerPreThinkid ) {
    
    
// If Has Laser Sight.
    
if( flag_get(_bitPlayerLaserSightid
    
    
// And Is Alive.
    
&& is_user_alive(id) ) {
        
        
// Statics.    
        
static iTarget
            
iBody
            
iRed
            
iGreen
            
iBlue
            
iWeapon
        
        
// Get User Aim.
        
get_user_aimingidiTargetiBody )
        
        
// Get Weapon.
        
iWeapon get_user_weaponid )
        
        
// If Weapon Is Primary Weapon (Useing Bits).
        
if( IsPrimaryWeaponiWeapon 
        
        
// Or Secondary Weapons.
        
|| IsSecondaryWeaponiWeapon ) ) {
            
            
// Jogador vivo
            
if( is_user_alive(id) )
            
            
// If Target Is Alive.
            
if( is_user_aliveiTarget 
            
            
// And Target Is Zombie.
            
&& zp_core_is_zombieiTarget )) {
                
                
// Set Color Red.
                
iRed 10
                iGreen 
0
                iBlue 
0
                
                set_hudmessage
(255000.410.2106.05.0)
                
show_hudmessage(id"CUIDADO!!!")
                
                
                
            } 
            
            
// Else If Its Normal Human.
            
else if( !zp_core_is_zombieiTarget 
            
            
// If Target Is Alive.
            
&& is_user_alive(id)) {
                
                
// Color Will Be Green.
                
iRed 0
                iGreen 
10
                iBlue 
0
                
                set_hudmessage
(7177470.380.2706.012.0)
                
show_hudmessage(id"PROCURANDO...")
                
            }
                
            
// If Target Is Alive.
            
&& is_user_alive(iTarget)) {
                
                
// Set Color Red.
                
iRed 0
                iGreen 
0
                iBlue 
10
                
                set_hudmessage
(421702550.340.2706.05.0)
                
show_hudmessage(id"AMIGO LOCALIZADO...")
                
            }
            
            
// Else If Not Zombie On Aim.
            
else {
                
                
// Color Will Be Green.
                
iRed 0
                iGreen 
10
                iBlue 
0
                
                set_hudmessage
(7177470.380.2706.012.0)
                
show_hudmessage(id"PROCURANDO...")
                
            }
            
            
// Static Origin 3D
            
static iOrigin]
            
            
// Get Origin.
            
get_user_originidiOrigin);
            
            
// Show Sprite.
            
message_beginMSG_BROADCASTSVC_TEMPENTITY )
            
            
// Sprite As Beam.
            
write_byteTE_BEAMENTPOINT )
            
write_shortid 0x1000 )
            
write_coordiOrigin] )
            
write_coordiOrigin] )
            
write_coordiOrigin] )
            
write_shortg_LaserSprite )
            
write_byte)
            
write_byte10 )
            
write_byte)
            
write_byte)
            
write_byte)
            
write_byteiRed )
            
write_byteiGreen )
            
write_byteiBlue )
            
write_byte150 )
            
write_byte25 )
            
message_end( )    
        }
    }
}

public 
zp_fw_core_spawn_post(id) {
    if(
zp_class_human_get_current(id) == g_HumanClassID ) {
        if(!
zp_core_is_zombie(id)) { 
            
flag_set(_bitPlayerLaserSightid)
        }
    }
}

public 
zp_fw_core_cure_post(id) { 
    if(
zp_class_human_get_current(id) == g_HumanClassID) { 
        
flag_set(_bitPlayerLaserSightid)
    } 
}  

public 
zp_fw_core_infect(id) {
    if(
zp_class_human_get_current(id) == g_HumanClassID) { 
        
flag_unset(_bitPlayerLaserSightid)
    } 
}

public 
FW__PlayerKilled_Post(id) {
    
    
// If Player Is Connected.
    
if( is_user_connected(id) ) {
        
        
flag_unset(_bitPlayerLaserSightid)
    }
}

// New Round Started.
public Event_HLTV_New_Round() {
    
    
// Set Bits To Zero.
    
_bitPlayerLaserSight 0

NOT FUNCTIONAL

PHP Code:
// Else If Not Zombie On Aim.
            
else {
                
                
// Color Will Be Green.
                
iRed 0
                iGreen 
10
                iBlue 
0
                
                set_hudmessage
(7177470.380.2706.012.0)
                
show_hudmessage(id"PROCURANDO...")
                
            } 
__________________

Last edited by GuTo; 09-30-2017 at 12:44.
GuTo is offline
Send a message via Skype™ to GuTo
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 09-30-2017 , 13:11   Re: Laser green in class human
Reply With Quote #2

is the laser not showing at all, or is it not green?
__________________
retired chump

Last edited by DjSoftero; 09-30-2017 at 13:16. Reason: missunderstood.
DjSoftero is offline
GuTo
Senior Member
Join Date: Mar 2010
Location: Brazil - SP
Old 09-30-2017 , 13:19   Re: Laser green in class human
Reply With Quote #3

Quote:
Originally Posted by DjSoftero View Post
is the laser not showing at all, or is it not green?
yeah,
it's not even showing
__________________
GuTo is offline
Send a message via Skype™ to GuTo
Reply



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 18:54.


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