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

Undefined symbol 'id'


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FailOverFlow
Member
Join Date: Feb 2012
Location: USA, Detroit
Old 04-17-2012 , 06:47   Undefined symbol 'id'
Reply With Quote #1

Hi! Here the code:
PHP Code:
public grenade_explosion()
{
    if (
get_msg_arg_int) == && get_msg_arg_int ) == 25 && get_msg_arg_int ) == 30 && HasVanguard[id])
    {
        new 
pos[3]
        
pos[0] = floatroundget_msg_arg_float) )
        
pos[1] = floatroundget_msg_arg_float) )
        
pos[2] = floatroundget_msg_arg_float) )

        new 
clusterFloat:vAngle[3], Float:angles[3], Float:velocity[3], Rvelocity[3], Float:distanceFloat:actualDistanceFloat:multiplier

        
new Float:origin[3
        
origin[0] = floatpos[0] )
        
origin[1] = floatpos[1] )
        
origin[2] = floatpos[2] )

        new 
Float:minBox[3] = { -1.0, ... }
        new 
Float:maxBox[3] = { 1.0, ... }
        
        
//This will launch the above specified number of clusters
        
for (new 0CLUSTERSi++)
        {
            
//Create a random direction for the cluster to fly
            
velocity[0] = random_floatfloatMIN_FLY_DISTANCE ), floatMAX_FLY_DISTANCE ) )
            if ( 
random_num0) == velocity[0] = floatmulvelocity[0], -1.0 )
            
velocity[1] = random_floatfloatMIN_FLY_DISTANCE ), floatMAX_FLY_DISTANCE ) )
            if ( 
random_num0) == velocity[1] = floatmulvelocity[1], -1.0 )
            
velocity[2] = floatUPWARD_ARC )

            
Rvelocity[0] = pos[0] + floatroundvelocity[0] )
            
Rvelocity[1] = pos[1] + floatroundvelocity[1] )
            
Rvelocity[2] = pos[2] + floatroundvelocity[2] )

            
//Create the distance the cluster will fly
            
distance random_floatfloatMIN_FLY_DISTANCE ), floatMAX_FLY_DISTANCE ) )
            
actualDistance floatget_distanceposRvelocity ) )
            
multiplier floatdivdistanceactualDistance )
            

            
velocity[0] = floatmulvelocity[0], multiplier )
            
velocity[1] = floatmulvelocity[1], multiplier )
            
velocity[2] = floatmulvelocity[2], multiplier )

            
//Create the angles for the facing of the cluster. PS: I have no idea how to do the angle thing really. This is a blind attempt.
            
vector_to_anglevelocityangles )
            
vector_to_anglevelocityvAngle )

            
//Create the entity of the cluster
            
cluster create_entity"info_target" )

            
//Set the identifying string of the cluster's entity
            
entity_set_stringclusterEV_SZ_classname"grenade_cluster"

            
//Set the model for the cluster's entity
            
entity_set_modelcluster"models/grenade.mdl" )     

            
//Set the bounds for the cluster's entity    
            
entity_set_vectorclusterEV_VEC_minsminBox)
            
entity_set_vectorclusterEV_VEC_maxsmaxBox)

            
//Set the origin for the cluster's entity (NOTE: The clusters will spawn in the same spot, but they will be set to ignore eachother
            
entity_set_originclusterorigin )

            
//Set the angles of the cluster's entity    
            
entity_set_vectorclusterEV_VEC_anglesangles )
            
entity_set_vectorclusterEV_VEC_v_anglevAngle )

            
//Set the behavior specific variables for the cluster's entity
            
entity_set_intclusterEV_INT_movetype//Has gravity and registers collisions
            
entity_set_intclusterEV_INT_solid//Collisions do not block

            //Record who the owner of this nade is
            
entity_set_edictclusterEV_ENT_ownerget_grenade_owner() )

            
//Make the cluster fly!
            
entity_set_vectorclusterEV_VEC_velocityvelocity 
        }
    }

    return 
PLUGIN_CONTINUE

and in plugin_init:
PHP Code:
register_message23"grenade_explosion" 
While compiling i'v got Undefined sumbol 'id'
FailOverFlow is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-17-2012 , 07:05   Re: Undefined symbol 'id'
Reply With Quote #2

because.. id does not exist
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
FailOverFlow
Member
Join Date: Feb 2012
Location: USA, Detroit
Old 04-17-2012 , 07:34   Re: Undefined symbol 'id'
Reply With Quote #3

rak, help please. I need to check if user (id) have HasVanguard
FailOverFlow is offline
FailOverFlow
Member
Join Date: Feb 2012
Location: USA, Detroit
Old 04-17-2012 , 07:50   Re: Undefined symbol 'id'
Reply With Quote #4

like that? ))
new id[32];
get_players( id );
FailOverFlow is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-17-2012 , 08:22   Re: Undefined symbol 'id'
Reply With Quote #5

yeah loop through players and check if user hasvanguard
EpicMonkey is offline
Deidara
Member
Join Date: Jul 2010
Location: Romania
Old 04-17-2012 , 08:23   Re: Undefined symbol 'id'
Reply With Quote #6

Code:
public grenade_explosion()
Not

Code:
public grenade_explosion(id)
?
Deidara is offline
Send a message via Yahoo to Deidara Send a message via Skype™ to Deidara
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-17-2012 , 09:46   Re: Undefined symbol 'id'
Reply With Quote #7

Quote:
Originally Posted by FailOverFlow View Post
like that? ))
new id[32];
get_players( id );
No.

Quote:
Originally Posted by EpicMonkey View Post
yeah loop through players and check if user hasvanguard
No.

Quote:
Originally Posted by Deidara View Post
Code:
public grenade_explosion()
Not

Code:
public grenade_explosion(id)
?
No.

PHP Code:
public grenade_explosion()
{
    if (
get_msg_arg_int) == && get_msg_arg_int ) == 25 && get_msg_arg_int ) == 30)
    {
        new 
id get_grenade_owner()
        if(!
HasVanguard[id]) return PLUGIN_CONTINUE
        
        
new pos[3]
        
pos[0] = floatroundget_msg_arg_float) )
        
pos[1] = floatroundget_msg_arg_float) )
        
pos[2] = floatroundget_msg_arg_float) )

        new 
clusterFloat:vAngle[3], Float:angles[3], Float:velocity[3], Rvelocity[3], Float:distanceFloat:actualDistanceFloat:multiplier

        
new Float:origin[3
        
origin[0] = floatpos[0] )
        
origin[1] = floatpos[1] )
        
origin[2] = floatpos[2] )

        new 
Float:minBox[3] = { -1.0, ... }
        new 
Float:maxBox[3] = { 1.0, ... }
        
        
//This will launch the above specified number of clusters
        
for (new 0CLUSTERSi++)
        {
            
//Create a random direction for the cluster to fly
            
velocity[0] = random_floatfloatMIN_FLY_DISTANCE ), floatMAX_FLY_DISTANCE ) )
            if ( 
random_num0) == velocity[0] = floatmulvelocity[0], -1.0 )
            
velocity[1] = random_floatfloatMIN_FLY_DISTANCE ), floatMAX_FLY_DISTANCE ) )
            if ( 
random_num0) == velocity[1] = floatmulvelocity[1], -1.0 )
            
velocity[2] = floatUPWARD_ARC )

            
Rvelocity[0] = pos[0] + floatroundvelocity[0] )
            
Rvelocity[1] = pos[1] + floatroundvelocity[1] )
            
Rvelocity[2] = pos[2] + floatroundvelocity[2] )

            
//Create the distance the cluster will fly
            
distance random_floatfloatMIN_FLY_DISTANCE ), floatMAX_FLY_DISTANCE ) )
            
actualDistance floatget_distanceposRvelocity ) )
            
multiplier floatdivdistanceactualDistance )
            

            
velocity[0] = floatmulvelocity[0], multiplier )
            
velocity[1] = floatmulvelocity[1], multiplier )
            
velocity[2] = floatmulvelocity[2], multiplier )

            
//Create the angles for the facing of the cluster. PS: I have no idea how to do the angle thing really. This is a blind attempt.
            
vector_to_anglevelocityangles )
            
vector_to_anglevelocityvAngle )

            
//Create the entity of the cluster
            
cluster create_entity"info_target" )

            
//Set the identifying string of the cluster's entity
            
entity_set_stringclusterEV_SZ_classname"grenade_cluster"

            
//Set the model for the cluster's entity
            
entity_set_modelcluster"models/grenade.mdl" )     

            
//Set the bounds for the cluster's entity    
            
entity_set_vectorclusterEV_VEC_minsminBox)
            
entity_set_vectorclusterEV_VEC_maxsmaxBox)

            
//Set the origin for the cluster's entity (NOTE: The clusters will spawn in the same spot, but they will be set to ignore eachother
            
entity_set_originclusterorigin )

            
//Set the angles of the cluster's entity    
            
entity_set_vectorclusterEV_VEC_anglesangles )
            
entity_set_vectorclusterEV_VEC_v_anglevAngle )

            
//Set the behavior specific variables for the cluster's entity
            
entity_set_intclusterEV_INT_movetype//Has gravity and registers collisions
            
entity_set_intclusterEV_INT_solid//Collisions do not block

            //Record who the owner of this nade is
            
entity_set_edictclusterEV_ENT_ownerget_grenade_owner() )

            
//Make the cluster fly!
            
entity_set_vectorclusterEV_VEC_velocityvelocity 
        }
    }

    return 
PLUGIN_CONTINUE

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 04-17-2012 at 10:06.
Exolent[jNr] is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-17-2012 , 09:54   Re: Undefined symbol 'id'
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
PHP Code:
public grenade_explosion()
{
    if (
get_msg_arg_int) == && get_msg_arg_int ) == 25 && get_msg_arg_int ) == 30)
    {
        new 
id get_grenade_owner()
        if(!
HasVanguard[id]) return
        
        new 
pos[3]
        
pos[0] = floatroundget_msg_arg_float) )
        
pos[1] = floatroundget_msg_arg_float) )
        
pos[2] = floatroundget_msg_arg_float) )

        new 
clusterFloat:vAngle[3], Float:angles[3], Float:velocity[3], Rvelocity[3], Float:distanceFloat:actualDistanceFloat:multiplier

        
new Float:origin[3
        
origin[0] = floatpos[0] )
        
origin[1] = floatpos[1] )
        
origin[2] = floatpos[2] )

        new 
Float:minBox[3] = { -1.0, ... }
        new 
Float:maxBox[3] = { 1.0, ... }
        
        
//This will launch the above specified number of clusters
        
for (new 0CLUSTERSi++)
        {
            
//Create a random direction for the cluster to fly
            
velocity[0] = random_floatfloatMIN_FLY_DISTANCE ), floatMAX_FLY_DISTANCE ) )
            if ( 
random_num0) == velocity[0] = floatmulvelocity[0], -1.0 )
            
velocity[1] = random_floatfloatMIN_FLY_DISTANCE ), floatMAX_FLY_DISTANCE ) )
            if ( 
random_num0) == velocity[1] = floatmulvelocity[1], -1.0 )
            
velocity[2] = floatUPWARD_ARC )

            
Rvelocity[0] = pos[0] + floatroundvelocity[0] )
            
Rvelocity[1] = pos[1] + floatroundvelocity[1] )
            
Rvelocity[2] = pos[2] + floatroundvelocity[2] )

            
//Create the distance the cluster will fly
            
distance random_floatfloatMIN_FLY_DISTANCE ), floatMAX_FLY_DISTANCE ) )
            
actualDistance floatget_distanceposRvelocity ) )
            
multiplier floatdivdistanceactualDistance )
            

            
velocity[0] = floatmulvelocity[0], multiplier )
            
velocity[1] = floatmulvelocity[1], multiplier )
            
velocity[2] = floatmulvelocity[2], multiplier )

            
//Create the angles for the facing of the cluster. PS: I have no idea how to do the angle thing really. This is a blind attempt.
            
vector_to_anglevelocityangles )
            
vector_to_anglevelocityvAngle )

            
//Create the entity of the cluster
            
cluster create_entity"info_target" )

            
//Set the identifying string of the cluster's entity
            
entity_set_stringclusterEV_SZ_classname"grenade_cluster"

            
//Set the model for the cluster's entity
            
entity_set_modelcluster"models/grenade.mdl" )     

            
//Set the bounds for the cluster's entity    
            
entity_set_vectorclusterEV_VEC_minsminBox)
            
entity_set_vectorclusterEV_VEC_maxsmaxBox)

            
//Set the origin for the cluster's entity (NOTE: The clusters will spawn in the same spot, but they will be set to ignore eachother
            
entity_set_originclusterorigin )

            
//Set the angles of the cluster's entity    
            
entity_set_vectorclusterEV_VEC_anglesangles )
            
entity_set_vectorclusterEV_VEC_v_anglevAngle )

            
//Set the behavior specific variables for the cluster's entity
            
entity_set_intclusterEV_INT_movetype//Has gravity and registers collisions
            
entity_set_intclusterEV_INT_solid//Collisions do not block

            //Record who the owner of this nade is
            
entity_set_edictclusterEV_ENT_ownerget_grenade_owner() )

            
//Make the cluster fly!
            
entity_set_vectorclusterEV_VEC_velocityvelocity 
        }
    }

    return 
PLUGIN_CONTINUE

^ Yes! yes! yes!
EpicMonkey is offline
FailOverFlow
Member
Join Date: Feb 2012
Location: USA, Detroit
Old 04-17-2012 , 10:05   Re: Undefined symbol 'id'
Reply With Quote #9

PHP Code:
cluster_grenade/main.inl(21) : warning 209: function "grenade_explosion" should return a value
cluster_grenade
/main.inl(96) : error 078: function uses both "return" and "return <value>" 
Something wrong
Maybe need to remove return PLUGIN_CONTINUE?

Last edited by FailOverFlow; 04-17-2012 at 10:06.
FailOverFlow is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-17-2012 , 10:06   Re: Undefined symbol 'id'
Reply With Quote #10

You should be able to fix that yourself. Anyway, I fixed it in my previous post.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 18:21.


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