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

Everyone has a Santa Hat


Post New Thread Reply   
 
Thread Tools Display Modes
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 11-29-2008 , 13:01   Re: Everyone have Santa Hat :)
Reply With Quote #21

Fixed

I did something rong while compiling
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
koleos
Senior Member
Join Date: Jul 2008
Old 11-29-2008 , 13:25   Re: Everyone have Santa Hat :)
Reply With Quote #22

This is cute
+karma
koleos is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-29-2008 , 13:51   Re: Everyone have Santa Hat :)
Reply With Quote #23

I think a better way would be to reserve ( create ) all hats ( 1 -> max server slot ) at once, hiding them, then when a player spawns, you have just to show the hat. I will avoid to remove/create each times, will be more faster and safe.

Something that is enough ( don't hate me. ) :
[ Edit : the plugin compiles fine, the webcompiler seems to be broken, you may want to try this one instead ]
Attached Files
File Type: sma Get Plugin or Get Source (santa_hat.sma - 1231 views - 2.0 KB)
__________________

Last edited by Arkshine; 11-29-2008 at 14:01.
Arkshine is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-29-2008 , 13:57   Re: Everyone have Santa Hat :)
Reply With Quote #24

arkshine ur epic! but ye cool plugin haha I love hats o.0
Styles is offline
Send a message via AIM to Styles
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-29-2008 , 14:04   Re: Everyone have Santa Hat :)
Reply With Quote #25

arkshine you wanted to say what my method sux ?
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-29-2008 , 14:12   Re: Everyone have Santa Hat :)
Reply With Quote #26

Actually, I think I've misread your code. . I was thinking that you create/remove the hat each time. -_-' . But your method is fine, though the client_connect/disconnect part is not needed. ( even if I prefer my method :p )

If we keep your code, something like should be enough :

Code:
public fwHamPlayerSpawnPost( const player ) {     if ( get_pcvar_num( g_Enable ) && is_user_alive( player ) && !g_bwEnt[ player ] )     {         g_bwEnt[ player ] = engfunc ( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );         set_pev( g_bwEnt[ player ], pev_movetype, MOVETYPE_FOLLOW );         set_pev( g_bwEnt[ player ], pev_aiment, player );         engfunc( EngFunc_SetModel, g_bwEnt[ player ], "models/santa_hat.mdl" );     } }

Though, replacing !g_bwEnt[ player ] by !pev_valid ( g_bwEnt[ player ] ) would not be a bad idea.
__________________

Last edited by Arkshine; 11-29-2008 at 14:28.
Arkshine is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 11-29-2008 , 14:37   Re: Everyone have Santa Hat :)
Reply With Quote #27

Got already an idea for easter,

The same plugin but with Bunnyears xD
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-29-2008 , 14:41   Re: Everyone have Santa Hat :)
Reply With Quote #28

thanks. code updated.
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-29-2008 , 14:43   Re: Everyone have Santa Hat :)
Reply With Quote #29

client_connect is not needed.
__________________
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-29-2008 , 14:47   Re: Everyone have Santa Hat :)
Reply With Quote #30

reupdated
__________________
xPaw is offline
Reply


Thread Tools
Display Modes

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