Raised This Month: $ Target: $400
 0% 

[REQ] Santa Hat: Command to enable and disable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pacheco
Senior Member
Join Date: Jul 2011
Old 12-12-2012 , 15:04   [REQ] Santa Hat: Command to enable and disable
Reply With Quote #1

Someone can add one command to players 'say /hat' to enable and disable Santa Hat ?

Thanks!

Plugin: https://forums.alliedmods.net/showth...ta+hat+command
__________________




Last edited by pacheco; 12-12-2012 at 15:30.
pacheco is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 12-12-2012 , 15:18   Re: [REQ] Santa Hat: Command to enable and disable
Reply With Quote #2

Quote:
Originally Posted by pacheco View Post
Someone can add one command 'say /hat' to enable and disable Santa ?

Thanks!

Plugin: https://forums.alliedmods.net/showth...ta+hat+command
omg your can just write this is in console amx_santahat 0 to disable santa hats
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
pacheco
Senior Member
Join Date: Jul 2011
Old 12-12-2012 , 15:28   Re: [REQ] Santa Hat: Command to enable and disable
Reply With Quote #3

Quote:
Originally Posted by ironskillz1 View Post
omg your can just write this is in console amx_santahat 0 to disable santa hats
No.. If player want to enable his Hat, he has to say: /hat. If he want to disable, say /hat again.
__________________




Last edited by pacheco; 12-12-2012 at 15:30.
pacheco is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 12-12-2012 , 15:48   Re: [REQ] Santa Hat: Command to enable and disable
Reply With Quote #4

Although I don't support Christmas stuff, I just want to improve my knowledge about entities ..

Try this
Spoiler


If it didn't work then try this:

Spoiler
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 12-12-2012 , 17:34   Re: [REQ] Santa Hat: Command to enable and disable
Reply With Quote #5

pokemonmaster Thank u!

Sorry, i forgot to say one thing, sorry..
Can you make Hat for CT (blue) and TR (red)?
http://forums.alliedmods.net/showthr...594#post993594
__________________




Last edited by pacheco; 12-13-2012 at 19:15.
pacheco is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 12-14-2012 , 10:17   Re: [REQ] Santa Hat: Command to enable and disable
Reply With Quote #6

Try this then ..
PHP Code:
#include <amxmodx>  
#include <fakemeta> 

new gHatBit 
#define AddToBit(%0)        ( gHatBit |= (1<<%0) )  
#define RemoveFromBit(%0)    ( gHatBit &= ~(1<<%0) )  
#define IsInBit(%0)        ( gHatBit & (1<<%0) ) 

#define CreateEntity    (engfunc( EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target") ) ); 

new g_pEnabled 
#define ENABLED        (get_pcvar_num(g_pEnabled) ) 

new const CT_MODEL[] = "models/santa_hat_ct.mdl"
new const 
T_MODEL[] = "models/santa_hat_t.mdl"


public plugin_precache( ) 

    
precache_modelCT_MODEL ); 
    
precache_modelT_MODEL ); 


public 
plugin_init( ) 

    new const 
VERSION[ ] = "1.3"
    
    
register_plugin"Santa Hat"VERSION"xPaw" ); 
    
    
set_pcvar_stringregister_cvar"santa_hat"VERSIONFCVAR_SERVER ), VERSION ); 
    
    
register_clcmd("say /hat""ToggleHat"
    
register_event("DeathMsg""eDeath""a")
    
    
g_pEnabled register_cvar("hats_enabled""1"


public 
eDeath()
{
    new 
iVictim read_data(2)
    
    if(
IsInBit(iVictim))
    {
        
RemoveFromBit(iVictim)
        static 
szClassName[32]
        
formatex(szClassNamecharsmax(szClassName), "santa_hat_%d"iVictim)

        
remove_entity(szClassName)
    }
}
    

public 
ToggleHat(id

    if(!
ENABLED
        return 
client_print(idprint_chat"Santa hat is disabled.."
    
    new 
iEnt 
    
new szClassName[32]; formatex(szClassNamecharsmax(szClassName), "santa_hat_%d"id
    if(!
IsInBit(id)) 
    { 
        
AddToBit(id
        
        
iEnt CreateEntity 
        
        
if(!pev_valid(iEnt)) 
        { 
            return 
client_print(idprint_chat"Couldn't create entity"
        } 
        
        
set_pev(iEntpev_classnameszClassName

        
engfuncEngFunc_SetModeliEntget_user_team(id) == T_MODEL CT_MODEL); 
        
set_peviEntpev_movetypeMOVETYPE_FOLLOW ); 
        
set_peviEntpev_aimentid ); 
        
set_peviEntpev_ownerid ); 
        
        
client_print(idprint_chat"YAY! You got your own santa hat .."
        return 
PLUGIN_HANDLED 
    

    
    
RemoveFromBit(id
    
    
remove_entity(szClassName)
    
    
client_print(idprint_chat"Your hat has been removed"
    return 
PLUGIN_HANDLED 
}  

remove_entity(szClassName[])
{
    new 
iEnt = -
    iEnt 
engfunc(EngFunc_FindEntityByStringiEnt"classname"szClassName
    
    
engfunc(EngFunc_RemoveEntityiEnt

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 12-14-2012 at 10:22.
pokemonmaster 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 01:16.


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