Raised This Month: $ Target: $400
 0% 

check if entity exist on coordinates


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 08-02-2013 , 09:55   Re: check if entity exist on coordinates
Reply With Quote #1

You are checking if entity exists in world or not. You have to check if the both origins, Origin and flOrigin are equal or not. Call this function before Create_Items().
PHP Code:
CheckEntities()
{
    new 
temp_ent engfunc(EngFunc_FindEntityByString0"classname""dm_ammo_grenade");

    while( 
temp_ent 0
    {
        
get_brush_entity_origin(temp_ent,flOrigin);
        for( 
0sizeof(g_MapItemOrgins); i++ )
        {
            if( (
g_MapItemOrgins[i][0] == flOrigin[0]) && (g_MapItemOrgins[i][1] == flOrigin[1]) && (g_MapItemOrgins[i][2] == flOrigin[2])) 
            {
                
g_MapItemOrgins[i][3] = 1;
            }
        }
        
temp_ent engfunc(EngFunc_FindEntityByStringtemp_ent"classname""dm_ammo_grenade");
    }

Quote:
Originally Posted by Shooting King View Post
While spawning Items check if g_MapItemOrgins[X][3] is 0/1.
If 0 spawn.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 08-02-2013 at 09:57.
Shooting King is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-03-2013 , 12:15   Re: check if entity exist on coordinates
Reply With Quote #2

Why would items be spawned twice if you spawn them only once at map start ?

Also, use str_to_float instead of str_to_num
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 15:58.


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