Raised This Month: $ Target: $400
 0% 

Number of arguments does not match definition.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-04-2009 , 11:45   Number of arguments does not match definition.
Reply With Quote #1

I've tryied to convert random spawn to fakemeta.
The probelm is here:
PHP Code:
fm_find_sphere_class(id"player"200.0iEnts1
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define MAP_MAX         3800.0

#define fm_find_ent_in_sphere(%1,%2,%3) engfunc(EngFunc_FindEntityInSphere, %1, %2, %3)

#define PLUGIN "biohazard: Buy_spawn"
#define VERSION "1.0"
#define AUTHOR "ds811888"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /spawn""cmd_buyspawn")
}
public 
cmd_buyspawn(id)
{
        
// spawn
        
random_spawn(id)
}

public 
random_spawn(id)
{
    static 
Float:vOrigin[3],iContents
    
    vOrigin
[0] = random_float(-MAP_MAX,MAP_MAX)
    
vOrigin[1] = random_float(-MAP_MAX,MAP_MAX)    
    
vOrigin[2] = -MAP_MAX
    
    
do
    {
        if(
vOrigin[2] > MAP_MAX)
            return 
random_spawn(id)
            
        
vOrigin[2] += 10.0
        iContents 
EF_PointContents(vOrigin)
    }
    while(
iContents != CONTENTS_EMPTY)
    
    
vOrigin[2] += 200.0
    
if(EF_PointContents(vOrigin) != CONTENTS_EMPTY)
        return 
random_spawn(id)
    
vOrigin[2] -= 160.0
    
    
for(new iCount 0;iCount 2;iCount++)
    {
        for(new 
Float:flDist = -36.0;flDist 36.0;flDist += 36.0)
        {
            
vOrigin[2] += flDist
            
            vOrigin
[iCount] += 33.0
            
if(EF_PointContents(vOrigin) != CONTENTS_EMPTY)
                return 
random_spawn(id)
            
vOrigin[iCount] -= 33.0
            
            vOrigin
[iCount] -= 33.0
            
if(EF_PointContents(vOrigin) != CONTENTS_EMPTY)
                return 
random_spawn(id)
            
vOrigin[iCount] += 33.0        
            
            vOrigin
[2] -= flDist
        
}
    }
    
    new 
iEnt
    
while((iEnt fm_find_ent_in_sphere(iEnt,vOrigin,20.0)) != 0)
        if(
pev(iEntpev_solid) != SOLID_NOT && pev(idpev_solid) != SOLID_TRIGGER)
            return 
random_spawn(id)
    
    
set_pev(idpev_origin,vOrigin)
    
    if(
pev(idpev_flags) & FL_INWATER)
        return 
PLUGIN_CONTINUE
        
    
new iEnts[1]
    
fm_find_sphere_class(id"player"200.0iEnts1)
    
    if(
iEnts[0])
        return 
random_spawn(id)
        
    
set_task(0.1,"fnCheckLocation",id)
    
    return 
PLUGIN_CONTINUE
}
public 
random_spawn_location(id)
{
    new 
iFlags
    pev
(idpev_flagsiFlags)
    if(
iFlags FL_INWATER || iFlags FL_SWIM || iFlags FL_FLOAT)
        
random_spawn(id)
}
stock fm_find_sphere_class(aroundent, const _lookforclassname[], Float:radiusentlist[], maxents, const Float:_origin[3])
{
    static 
Float:origin[3]
    if(!
pev_valid(aroundent))
    {
        
origin[0] = _origin[0]
        
origin[1] = _origin[1]
        
origin[2] = _origin[2]
    }
    else
        
pev(aroundentpev_originorigin)
 
    new 
ent 0foundents 0
    
while((ent engfunc(EngFunc_FindEntityInSpherearoundentoriginradius)) != 0)
    {
        if(!
pev_valid(ent))
            continue;
 
        if(
foundents >= maxents)
            break;
 
        static 
classname[32]
        
pev(entpev_classnameclassname31)
 
        if(
equal(classname_lookforclassname))
        
entlist[foundents++] = ent
    
}
    return 
foundents;

stock EF_PointContents(const Float:VECTOR[3])
{
    return 
engfunc(EngFunc_PointContentsVECTOR);

xbatista is offline
Send a message via Skype™ to xbatista
 


Thread Tools
Display Modes

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:06.


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