Raised This Month: $32 Target: $400
 8% 

Subplugin Submission [ZP] Extra Item: Gas Mask


Post New Thread Reply   
 
Thread Tools Display Modes
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 07-11-2012 , 22:29   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #51

Quote:
Originally Posted by micapat View Post
It will be better to have a entity which think ( 1 sec ? ) and loop players than use clientPrethink.
Updated Thank you.

Quote:
Originally Posted by micapat View Post
About the function "NewRound", you clear _bitPlayerInMask. Why not directly do _bitPlayerInMask = 0 instead of a loop ?
Updated Thank you.

Last thing i didn't want to update just that simple edit so i added my chat in the plugin..
I still need to use "client_PreThink" because of the icon if you have any other suggestion post...
I made mistake? Tell me ill fix it .
PS: I didn't tested it don't know if it works.
__________________

Last edited by H.RED.ZONE; 07-11-2012 at 22:29.
H.RED.ZONE is offline
Y060N
BANNED
Join Date: Dec 2011
Location: www.equilibriumcs.com
Old 07-11-2012 , 22:52   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #52

get_user_msgid("StatusIcon")

Stop being lazy and use the search button. Client PreThink is not needed 99% of the time. Use the search button for once in your life.
Y060N is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 07-11-2012 , 23:11   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #53

Quote:
Originally Posted by Y060N View Post
get_user_msgid("StatusIcon")

Stop being lazy and use the search button. Client PreThink is not needed 99% of the time. Use the search button for once in your life.
Lol you should really return to ripping don't you think?
__________________
H.RED.ZONE is offline
Y060N
BANNED
Join Date: Dec 2011
Location: www.equilibriumcs.com
Old 07-11-2012 , 23:29   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #54

Lol you think I rip plugins because I use a create entity code from another plugin? I have created plenty of plugins on my own with no help from other people. At least I know how to create a plugin without using infinite tasks and client prethink, unlike you whose the king at doing so.

I try to offer some help because you can't use the search feature, and think client prethink is needed to set an icon because you are an idiot/noob coder, and you just go out and insult me? You're a joke at coding. I have surpassed your knowledge in 2 months of coding than you have in double the time.

http://forums.alliedmods.net/forumdisplay.php?f=83 you really need to spend a few hours here instead of spending hours in the zombie section giving plugins to people that always have errors and that you never take the time to even look over. Half of them don't even compile...

Edit: As micapat says below is correct, but you don't even need to create the new variables as they are cached already.

Last edited by Y060N; 07-11-2012 at 23:34.
Y060N is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-11-2012 , 23:30   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #55

Quote:
Originally Posted by H.RED.ZONE View Post

Last thing i didn't want to update just that simple edit so i added my chat in the plugin..
I still need to use "client_PreThink" because of the icon if you have any other suggestion post...
I made mistake? Tell me ill fix it .
PS: I didn't tested it don't know if it works.
To display this icon, you need only the player id, and you have it in fw_ThinkGrenade ( with your loop ). So you can remove clientPrethink.

You made one mistake too, if you return a value in the loop, you will forget some players.

And I don't understand why you need to know if the owner is alive.

I think something like that ( untested ) :

PHP Code:
public fw_ThinkGrenadeentity 
{
    if( 
is_valid_ententity ) && zp_get_user_zombie entity_get_edictentityEV_ENT_owner ))) // zombie grenade ?
    
{
        new 
_cvar_range get_pcvar_num_pcvar_range // Maybe cache this cvar in the beginning of the round ? It will be better
        
new _cvar_after_icon_on get_pcvar_num_pcvar_after_icon_on )
        new 
_cvar_after_remove get_pcvar_num_pcvar_after_remove )
        new 
_cvar_icon_status get_pcvar_num_pcvar_icon_status )
        
        for( new 
id id <= g_MaxPlayers id++ ) 
        {
            if( 
_IsPlayerAliveid ) && _IsPlayerInMaskid ))
            {
                if( 
_cvar_after_icon_on == 1
                {
                    
message_beginMSG_ONE_UNRELIABLEg_icon, { 00}, id );
                    
write_byte_cvar_icon_status );
                    
write_string"dmg_gas" );
                    
write_byte);
                    
write_byte255 );
                    
write_byte);
                    
message_end( );
                }    
                
                if( 
get_entity_distanceentityid ) <= _cvar_range )
                {
                    
remove_entityentity )
                    
                    if( 
_cvar_after_remove )
                    {
                        
_ClearPlayerInMaskid )
                        
ProtoChat(id"Infect nade is removed, you don't have mask anymore.")
                    }
                }
            }
        }
    }
    
    return 
HAM_IGNORED;

__________________
micapat is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 07-11-2012 , 23:34   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #56

Quote:
Originally Posted by Y060N View Post
Lol you think I rip plugins because I use a create entity code from another plugin? I have created plenty of plugins on my own with no help from other people. At least I know how to create a plugin without using infinite tasks and client prethink, unlike you whose the king at doing so.

I try to offer some help because you can't use the search feature, and think client prethink is needed to set an icon because you are an idiot/noob coder, and you just go out and insult me? You're a joke at coding. I have surpassed your knowledge in 4 months of coding than you have in double the time.

http://forums.alliedmods.net/forumdisplay.php?f=83 you really need to spend a few hours here instead of spending hours in the zombie section giving plugins to people that always have errors and that you never take the time to even look over. Half of them don't even compile...
Lol you did ripped it and now you just told us here that you took the code from a friend that was a lie you used it from lucas.

Quote:
Originally Posted by micapat View Post
To display this icon, you need only the player id, and you have it in fw_ThinkGrenade ( with your loop ). So you can remove clientPrethink.

You made one mistake too, if you return a value in the loop, you will forget some players.

And I don't understand why you need to know if the owner is alive.

I think something like that ( untested ) :

PHP Code:
public fw_ThinkGrenadeentity 
{
    if( 
is_valid_ententity ) && zp_get_user_zombie entity_get_edictentityEV_ENT_owner ))) // zombie grenade ?
    
{
        new 
_cvar_range get_pcvar_num_pcvar_range // Maybe cache  this cvar in the beginning of the round ? It will be better
        
new _cvar_after_icon_on get_pcvar_num_pcvar_after_icon_on )
        new 
_cvar_after_remove get_pcvar_num_pcvar_after_remove )
        new 
_cvar_icon_status get_pcvar_num_pcvar_icon_status )
        
        for( new 
id id <= g_MaxPlayers id++ ) 
        {
            if( 
_IsPlayerAliveid ) && _IsPlayerInMaskid ))
            {
                if( 
_cvar_after_icon_on == 1
                {
                    
message_beginMSG_ONE_UNRELIABLEg_icon, { 00}, id );
                    
write_byte_cvar_icon_status );
                    
write_string"dmg_gas" );
                    
write_byte);
                    
write_byte255 );
                    
write_byte);
                    
message_end( );
                }    
                
                if( 
get_entity_distanceentityid ) <= _cvar_range )
                {
                    
remove_entityentity )
                    
                    if( 
_cvar_after_remove )
                    {
                        
_ClearPlayerInMaskid )
                        
ProtoChat(id"Infect nade is removed, you don't have mask anymore.")
                    }
                }
            }
        }
    }
    
    return 
HAM_IGNORED;

Im not shure if it will work ill need to test that.
Didnt even tested 2.0 _._ Any way thanks for helping (:

EDIT: Ah yes i was getting invalid player if i don't check if owner is alive have no idea why.
From version 1.3 or something like that can't remember :S
__________________

Last edited by H.RED.ZONE; 07-12-2012 at 00:07.
H.RED.ZONE is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-12-2012 , 00:20   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #57

We can avoid the problem of the owner and do something like that too, it will be better :

PHP Code:
// ZP 4.3
#define EV_INT_nadetype     EV_INT_flTimeStepSound
#define NADETYPE_INFECTION  1111

...

public 
fw_ThinkGrenadeentity 
{
    if( 
is_valid_ententity ) && entity_get_intentityEV_INT_nadetype ) == NADETYPE_INFECTION  )) // zombie grenade ?
    
{
        
// ... 
__________________
micapat is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 07-12-2012 , 00:35   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #58

Yes yes true that would work for zp 5.0 same as zp 4.3. The thing im not shure is the icon, would it show if we removed it from prethink.....it would show only when grenade prethink is called, In this case we need to show the icon to the player if he has gas mask whole time. :S
__________________

Last edited by H.RED.ZONE; 07-12-2012 at 00:36.
H.RED.ZONE is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-12-2012 , 00:38   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #59

Aahh Ok. So create a entity which think all seconds, loop players and show the sprite
__________________
micapat is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 07-12-2012 , 00:39   Re: [ZP] Extra Item: Gas Mask
Reply With Quote #60

Lol i don't like doing that :S i would rather remove the icon from the code. ~_~
__________________
H.RED.ZONE is offline
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:56.


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