Raised This Month: $12 Target: $400
 3% 

rash the server when call function.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fl0werD
Senior Member
Join Date: May 2011
Old 02-17-2013 , 07:56   rash the server when call function.
Reply With Quote #1

PHP Code:
void RemovePlayerLaserMines(edict_t *pPlayer)
{
    static 
edict_t *pEntity;
    
pEntity NULL;

    while((
pEntity FIND_ENTITY_BY_STRING(pEntity"classname""LaserMine")))
    {
        if(
pEntity->v.iuser2 != ENTINDEX(pPlayer))
            continue;

        if(!
FClassnameIs(pEntity"LaserMine"))
            continue;

        
EMIT_SOUND_DYN2(pEntity4"weapons/mine_charge.wav"0.20.80, (1<<5), 100);
        
EMIT_SOUND_DYN2(pEntity2"weapons/mine_activate.wav"0.50.80, (1<<5), 75);

        
pEntity->v.flags FL_KILLME;
    }

    
g_iDeployed[ENTINDEX(pPlayer)] = 0;

I am confident that the error in the loop. How to do it right?
fl0werD is offline
Send a message via ICQ to fl0werD
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 02-17-2013 , 12:17   Re: rash the server when call function.
Reply With Quote #2

maybe (=) to (==) ?
TheDS1337 is offline
fl0werD
Senior Member
Join Date: May 2011
Old 02-17-2013 , 13:03   Re: rash the server when call function.
Reply With Quote #3

No.
PHP Code:
void RemovePlayerLaserMines(int iPlayer)
{
    
int iEntity = -1;

    while((
iEntity ENTINDEX(FIND_ENTITY_BY_STRING(INDEXENT(iEntity), "classname""LaserMine"))))
    {
        if(
INDEXENT(iEntity)->v.iuser2 != iPlayer)
            continue;

        if(!
FClassnameIs(INDEXENT(iEntity), "LaserMine"))
            continue;

        
EMIT_SOUND_DYN2(INDEXENT(iEntity), 4"weapons/mine_charge.wav"0.20.80, (1<<5), 100);
        
EMIT_SOUND_DYN2(INDEXENT(iEntity), 2"weapons/mine_activate.wav"0.50.80, (1<<5), 75);

        
INDEXENT(iEntity)->v.flags FL_KILLME;
    }

    
g_iDeployed[iPlayer] = 0;

fl0werD is offline
Send a message via ICQ to fl0werD
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 02-17-2013 , 13:35   Re: rash the server when call function.
Reply With Quote #4

it's work ?
TheDS1337 is offline
fl0werD
Senior Member
Join Date: May 2011
Old 02-17-2013 , 14:15   Re: rash the server when call function.
Reply With Quote #5

Yes.
fl0werD is offline
Send a message via ICQ to fl0werD
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-17-2013 , 15:10   Re: rash the server when call function.
Reply With Quote #6

Try that :

Code:
edict_t *pEntity=  NULL; 

    while( ( pEntity = FIND_ENTITY_BY_STRING( pEntity, "classname", "LaserMine" ) ) != NULL ) 
    {
__________________
Arkshine is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 02-17-2013 , 15:53   Re: rash the server when call function.
Reply With Quote #7

@ Arkshine
You like to help peoples very much, and thank you very much
TheDS1337 is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 02-17-2013 , 16:08   Re: rash the server when call function.
Reply With Quote #8

PHP Code:
edict_t UTIL_FindEntityByClassedict_t *pEntity, const char *szClassname )
{
    
edict_t *pNewEntity FIND_ENTITY_BY_CLASSNAMEpEntityszClassname );
    return 
FNullEntpNewEntity ) ? NULL pNewEntity;

__________________

Last edited by micapat; 02-18-2013 at 07:04.
micapat is offline
fl0werD
Senior Member
Join Date: May 2011
Old 02-18-2013 , 05:36   Re: rash the server when call function.
Reply With Quote #9

LOL's.
fl0werD is offline
Send a message via ICQ to fl0werD
Mark Jean
New Member
Join Date: Feb 2013
Old 02-21-2013 , 13:20   Re: rash the server when call function.
Reply With Quote #10

PHP Code:
edict_t pEdict NULL;

while( !
FNullEnt( ( pEdict g_engfuncs.pfnFindEntityByStringpEdict"classname""weapon_ak47" ) ) ) )
  
g_engfuncs.pfnRemoveEntitypEdict ); 
PHP Code:
/* Static data is not required as usual! */
static edict_t pEdict;
pEdict NULL

Last edited by Mark Jean; 02-21-2013 at 13:22.
Mark Jean 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 05:18.


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