AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Stop Healthkit from Reappearing (https://forums.alliedmods.net/showthread.php?t=85832)

Mlk27 02-16-2009 19:47

Stop Healthkit from Reappearing
 
how do we make the healthkit that we spawn to stop re-appearing after we collect it?

Code:
    // .......     new Float:fOrigin[3]     pev(id, pev_origin, fOrigin)     new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString , "item_healthkit"))     engfunc(EngFunc_SetOrigin, iEnt, fOrigin)     dllfunc(DLLFunc_Spawn, iEnt)     return PLUGIN_HANDLED

Arkshine 02-16-2009 21:18

Re: Stop Healthkit from Reappearing
 
Try to add :
Code:

set_pev( iEnt, pev_spawnflags, pev( iEnt, pev_spawnflags ) | SF_NORESPAWN );

jim_yang 02-16-2009 21:37

Re: Stop Healthkit from Reappearing
 
set_pev( iEnt, pev_spawnflags, pev( iEnt, pev_spawnflags ) | SF_NORESPAWN );
@arkshine typ0 :)

Arkshine 02-16-2009 21:38

Re: Stop Healthkit from Reappearing
 
Where? :mrgreen:

Mlk27 02-16-2009 22:21

Re: Stop Healthkit from Reappearing
 
hey thanks..what about getting the id of players that touch or collect the healthkit?

Arkshine 02-17-2009 03:09

Re: Stop Healthkit from Reappearing
 
For what you need to know the player's id ?

Mlk27 02-17-2009 03:55

Re: Stop Healthkit from Reappearing
 
i need to block it from being collected by some players..

Arkshine 02-17-2009 04:01

Re: Stop Healthkit from Reappearing
 
Hook Ham_Touch with "item_healthkit" :

Code:
    #include <amxmodx>     #include <hamsandwich>         new g_MaxClients;     #define IsPlayer(%1)  ( 1 <= %1 <= g_MaxClients )         public plugin_init()     {         RegisterHam( Ham_Touch, "item_healthkit", "Forward_Touch" );         g_MaxClients = get_maxplayers();     }         public Forward_Touch ( const EntIndex, const OtherIndex )     {         if ( IsPlayer ( OtherIndex ) )         {             //         }     }

A player is touching the healthkit ( OtherIndex ).


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

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