AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   best way to catch when player shoots a nade (https://forums.alliedmods.net/showthread.php?t=189910)

One 07-12-2012 10:23

best way to catch when player shoots a nade
 
tittle.

hleV 07-12-2012 11:35

Re: best way to catch when player shoots a nade
 
Code:
#include <csx> public grenade_throw(client, ent, weap) {     if (weap == CSW_HEGRENADE)     {         // Etc     } }

meTaLiCroSS 07-12-2012 13:11

Re: best way to catch when player shoots a nade
 
When a player "throws" a nade, or when you try to attack a nade?

One 07-12-2012 14:18

Re: best way to catch when player shoots a nade
 
ty hlev.
when the player throws the nade.
wanted to cache attack & check if user has a nade :-P haha

One 07-15-2012 07:16

Re: best way to catch when player shoots a nade
 
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);



<VeCo> 07-15-2012 07:17

Re: best way to catch when player shoots a nade
 
weapon_hergrenade

One 07-15-2012 07:19

Re: best way to catch when player shoots a nade
 
hahaha =)))

i will try it again. i tested it with m4a1 but ...
ill post the resault. ty

ConnorMcLeod 07-15-2012 07:23

Re: best way to catch when player shoots a nade
 
Do NEVER use fm_ stuff.

One 07-15-2012 10:18

Re: best way to catch when player shoots a nade
 
hmmm. its now workin. ty

oki connor. was just a test


All times are GMT -4. The time now is 09:38.

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