Raised This Month: $ Target: $400
 0% 

Stop Healthkit from Reappearing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 02-16-2009 , 19:47   Stop Healthkit from Reappearing
Reply With Quote #1

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

Last edited by Mlk27; 02-16-2009 at 20:01.
Mlk27 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-16-2009 , 21:18   Re: Stop Healthkit from Reappearing
Reply With Quote #2

Try to add :
Code:
set_pev( iEnt, pev_spawnflags, pev( iEnt, pev_spawnflags ) | SF_NORESPAWN );

Last edited by Arkshine; 02-16-2009 at 21:38.
Arkshine is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 02-16-2009 , 21:37   Re: Stop Healthkit from Reappearing
Reply With Quote #3

set_pev( iEnt, pev_spawnflags, pev( iEnt, pev_spawnflags ) | SF_NORESPAWN );
@arkshine typ0
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-16-2009 , 21:38   Re: Stop Healthkit from Reappearing
Reply With Quote #4

Where?
Arkshine is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 02-16-2009 , 22:21   Re: Stop Healthkit from Reappearing
Reply With Quote #5

hey thanks..what about getting the id of players that touch or collect the healthkit?
Mlk27 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-17-2009 , 03:09   Re: Stop Healthkit from Reappearing
Reply With Quote #6

For what you need to know the player's id ?
Arkshine is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 02-17-2009 , 03:55   Re: Stop Healthkit from Reappearing
Reply With Quote #7

i need to block it from being collected by some players..
Mlk27 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-17-2009 , 04:01   Re: Stop Healthkit from Reappearing
Reply With Quote #8

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 ).

Last edited by Arkshine; 02-17-2009 at 04:05.
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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