Raised This Month: $ Target: $400
 0% 

Solved, delete this.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 01-01-2010 , 12:44   Solved, delete this.
Reply With Quote #1

I want to add a model to a plugin, I found an easy code from xPaw that adds santa hat to everyone. But I cant get every function and it uses.

Can some one explain this better to me so I could add models more easyli to any other plugins.
PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <hamsandwich> 
new g_Enable;
new 
g_bwEnt[33];
new 
g_CachedStringInfoTarget;
public 
plugin_init() {
 
register_plugin"Santa Hat""1.2""xPaw" );
 
register_cvar("santa_hat""1.2"FCVAR_SERVER);
 
g_Enable register_cvar("amx_santahat""1");
 
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
 
g_CachedStringInfoTarget engfuncEngFunc_AllocString"info_target" );
}
public 
plugin_precache()
 
precache_model("models/santa_hat.mdl");
public 
fwHamPlayerSpawnPost( const player ) {
 if ( 
get_pcvar_numg_Enable ) && is_user_aliveplayer ) ) {
  new 
iEnt g_bwEntplayer ];
  if( !
pev_validiEnt ) ) {
   
g_bwEntplayer ] = iEnt engfunc EngFunc_CreateNamedEntityg_CachedStringInfoTarget );
   
set_peviEntpev_movetypeMOVETYPE_FOLLOW );
   
set_peviEntpev_aimentplayer );
   
engfuncEngFunc_SetModeliEnt"models/santa_hat.mdl" );
  }
 }

__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it

Last edited by benamo6; 01-01-2010 at 14:46.
benamo6 is offline
Send a message via MSN to benamo6
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 01-02-2010 , 20:33   Re: Solved, delete this.
Reply With Quote #2

That's great, how about you explain to everyone else how you fixed your problem. People might search here and look at this post for your example.
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
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 04:14.


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