Quote:
Originally Posted by retoxx
I can hold a dodgeball and see other players have the dodgball but when we throw the dodgeball it becomes a hegrenade in air and then just lay on the ground.
I have tried Everything to make the w_hegrenade turn into a w_dodgeball but it just dosn't work.
PHP Code:
public think_grenade(ent)
{ new model[32]; entity_get_string(ent, EV_SZ_model, model, 31) if(equali(model,"models/OGDaysMenu/w_dodgeball.mdl")) { return PLUGIN_CONTINUE } // stop grenade from blowing up return PLUGIN_HANDLED }
|
I know you're making a game menu, i used this:
These "GAME_DODGEBALL" are builded up in an enum, only if you want to have more than one game in ur game menu ;)
PHP Code:
public Ham_Touch_Grenade_Pre( iEntity, id )
{
if( GAME_DODGEBALL )
{
static i_owner
i_owner = pev(iEntity, pev_owner)
if(is_user_alive(id) && cs_get_user_team(i_owner) == CS_TEAM_T && cs_get_user_team(id) == CS_TEAM_T) /*<-- T vs T*/
{
ExecuteHamB(Ham_Killed, id, i_owner, 0)
}
else remove_entity(iEntity) /*<-- Removes the dodgeball*/
}
}
And about the w_ model:
(You need to edit it a little depending on how you did setting up your code..)
PHP Code:
public fwdSetModel(ent,const model[])
{
if(g_iCurrentGame == GAME_NONE || !pev_valid(ent) || !equal(model,"models/w_hegrenade.mdl"))
return FMRES_IGNORED
switch(g_iCurrentGame)
{
case GAME_DODGE: engfunc(EngFunc_SetModel, ent, g_szBall_w)
}
return FMRES_SUPERCEDE
}
__________________