PDA

View Full Version : Player spawn


Dr.G
03-23-2009, 05:50 PM
this is how you catch when a player spawn with hamsandwich:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "Spawn test"
#define VERSION "1.0"
#define AUTHOR "Dr.G"


public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

/* reg. ham_spawn */
RegisterHam(Ham_Spawn,"player","func_HamSpawn")
/* *1 *2 *3

*1 - Register an entity spawn = Ham_Spawn
*2 - Entity named: player
*3 - Function to forward to: func_HamSpawn */
}

public func_HamSpawn(id)
{
if(get_user_team(id))
client_print(id, 3, "***Spawn")
}

where did your post about this go D-O?????

diamond-optic
03-23-2009, 06:28 PM
ehhh i think i posted it in Wilson's Spawn Forward fix thread.. where no one probably would ever see it :P

Dr.G
03-23-2009, 06:32 PM
hehehe ok.. well another thing...do you know why all ham functions need that team check? or have an idea about it..

diamond-optic
03-23-2009, 06:59 PM
i havent noticed they all need it, tho i havent checked for it either.... but i did notice a lot of them get triggered at wierd times and sometimes they pass strange variables too

Dr.G
03-23-2009, 07:16 PM
ok well i played around with Ham_TakeDamage again yesterday and this function needed it aswell to work:

public func_TakeDamage(id, idinflictor, idattacker, Float:damage, damagebits)
{
if( is_user_alive(id) && get_user_team(id) && (damagebits & DMG_BURN))
{
damage = (get_pcvar_float(p_percent) / 100 * damage)

SetHamParamFloat(4,damage)

client_print(id,3,"fire dmg??")
return HAM_HANDLED
}
return HAM_IGNORED
}