AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved, delete this. (https://forums.alliedmods.net/showthread.php?t=114033)

benamo6 01-01-2010 12:44

Solved, delete this.
 
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" );
  }
 }



Dygear 01-02-2010 20:33

Re: Solved, delete this.
 
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.


All times are GMT -4. The time now is 04:14.

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