View Single Post
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 07-15-2012 , 07:16   Re: best way to catch when player shoots a nade
Reply With Quote #5

ehemmm. sry 4 double post.
i think i forgot all about amxxxx....

knows anyone whats here the problem ?

PHP Code:
public grenade_throw(identweap)
{
    if (
weap == CSW_HEGRENADE && nadewars == )//&& cs_get_user_team(id) == CS_TEAM_T)
    
{
        
set_task(3.0,"give_nade",id)
    }
}    
public 
give_nade(id)
{
    if(
is_user_alive(id))
    {
        
give_item(id"weapon_hergrenade" )
    }
    
client_print(id,print_chat,"DEBUG : TASK WORKS. YOU GOT 1 HE")

problem : user dosent get any HEs.. my task/debug print works.

tried with fm_give_item too but the same :

PHP Code:
stock fm_give_item(id,const item[]){
    static 
ent;
    
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem));
    if(!
pev_valid(ent)) return;
   
    static 
Float:originF[3];
    
pev(idpev_originoriginF);
    
set_pev(entpev_originoriginF);
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN);
    
dllfunc(DLLFunc_Spawnent);
   
    static 
save;
    
save pev(entpev_solid);
    
dllfunc(DLLFunc_Touchentid);
    if(
pev(ent,pev_solid) != save)
        return;
      
    
engfunc(EngFunc_RemoveEntityent);

__________________

Last edited by One; 07-15-2012 at 07:16.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One