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

FF2 [SOLVED] Help me with compiling!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Maximilian_
Veteran Member
Join Date: Oct 2014
Old 03-08-2015 , 11:12   [SOLVED] Help me with compiling!
Reply With Quote #1

Hey guys, i working under my first subplugin for FF2, but compiler gives me error : "error 017: undefined symbol "Event_RoundStart""

My .sp file :

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>
#include <morecolors>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin>
#define ME 2048

public Plugin:myinfo = {
name = "",
author = "",
};

public OnPluginStart2()
{
HookEvent("arena_round_start", Event_RoundStart, EventHookMode_PostNoCopy);
}

/*
//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
if(!strcmp(ability_name, "start_goldpan"))
ServerCommand("sm_givew @blue 9001");
else if(!strcmp(ability_name, "start_cop_stick"))
ServerCommand("sm_givew @blue 9992");
else if(!strcmp(ability_name, "start_HL2_shotgun"))
ServerCommand("sm_givew @blue 9993");
return Plugin_Continue;
}


public Action:Timer_GetBossTeam(Handle:hTimer)
{
BossTeam=FF2_GetBossTeam();
return Plugin_Continue;
}
*/
public Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
new slot=FF2_GetAbilityArgument(index,this_plugin _name,ability_name,0);
/*
// Uncomment it if you want use this rage as "true rage"m like Saxton's stun
if (!slot)
{
if (index == 0) //Starts VSH rage ability forward
{
new Action:act = Plugin_Continue;
Call_StartForward(OnHaleRage);
new Float:dist=FF2_GetRageDist(index,this_plugin_ name,ability_name);
new Float:newdist=dist;
Call_PushFloatRef(newdist);
Call_Finish(act);
if (act != Plugin_Continue && act != Plugin_Changed)
return Plugin_Continue;
if (act == Plugin_Changed) dist = newdist;
}
}
*/
if(!strcmp(ability_name, "rage_goldpan"))
ServerCommand("sm_givew @blue 9001");
else if(!strcmp(ability_name, "rage_cop_stick"))
ServerCommand("sm_givew @blue 9992");
else if(!strcmp(ability_name, "rage_HL2_shotgun"))
ServerCommand("sm_givew @blue 9993");
return Plugin_Stop;
}

Last edited by Wliu; 03-08-2015 at 12:23.
Maximilian_ is offline
sarysa
Senior Member
Join Date: Mar 2014
Old 03-08-2015 , 11:22   Re: Help me with compiling!
Reply With Quote #2

That would be because you have the roundstart event commented out.

/* begins a block comment
*/ ends a block comment

If you don't have prior general programming experience (including stuff like C#, java, obj-c, c++) you will have a difficult time with Sourcemod.
__________________
sarysa is offline
Maximilian_
Veteran Member
Join Date: Oct 2014
Old 03-08-2015 , 11:24   Re: Help me with compiling!
Reply With Quote #3

Quote:
Originally Posted by sarysa View Post
That would be because you have the roundstart event commented out.

/* begins a block comment
*/ ends a block comment

If you don't have prior general programming experience (including stuff like C#, java, obj-c, c++) you will have a difficult time with Sourcemod.
can fix please for beginner?

Last edited by Maximilian_; 03-08-2015 at 11:25.
Maximilian_ is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 03-08-2015 , 11:44   Re: Help me with compiling!
Reply With Quote #4

sarysa already gave you the fix. I will give you a break down, since you are new to coding.

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>
#include <morecolors>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin> 
#define ME 2048

public Plugin:myinfo = {
    
name "",
    
author "",
};

public 
OnPluginStart2()
{
    
HookEvent("arena_round_start"Event_RoundStartEventHookMode_PostNoCopy);
}

/*
//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!strcmp(ability_name, "start_goldpan"))
        ServerCommand("sm_givew @blue 9001");
    else if(!strcmp(ability_name, "start_cop_stick"))
        ServerCommand("sm_givew @blue 9992");
    else if(!strcmp(ability_name, "start_HL2_shotgun"))
        ServerCommand("sm_givew @blue 9993");
        return Plugin_Continue;
}


public Action:Timer_GetBossTeam(Handle:hTimer)
{
    BossTeam=FF2_GetBossTeam();
    return Plugin_Continue;
}
*/
public Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
    new 
slot=FF2_GetAbilityArgument(index,this_plugin  _name,ability_name,0);
    
/*
    //                Uncomment it if you want use this rage as "true rage"m like Saxton's stun
    if (!slot)
    {
        if (index == 0)        //Starts VSH rage ability forward
        {
            new Action:act = Plugin_Continue;
            Call_StartForward(OnHaleRage);
            new Float:dist=FF2_GetRageDist(index,this_plugin_  name,ability_name);
            new Float:newdist=dist;
            Call_PushFloatRef(newdist);
            Call_Finish(act);
            if (act != Plugin_Continue && act != Plugin_Changed)
                return Plugin_Continue;
            if (act == Plugin_Changed) dist = newdist;    
        }
    }
    */
    
if(!strcmp(ability_name"rage_goldpan"))
        
ServerCommand("sm_givew @blue 9001");
    else if(!
strcmp(ability_name"rage_cop_stick"))
        
ServerCommand("sm_givew @blue 9992");
    else if(!
strcmp(ability_name"rage_HL2_shotgun"))
        
ServerCommand("sm_givew @blue 9993");
        return 
Plugin_Stop;

Look at this part of the above code.

PHP Code:
/*
//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!strcmp(ability_name, "start_goldpan"))
        ServerCommand("sm_givew @blue 9001");
    else if(!strcmp(ability_name, "start_cop_stick"))
        ServerCommand("sm_givew @blue 9992");
    else if(!strcmp(ability_name, "start_HL2_shotgun"))
        ServerCommand("sm_givew @blue 9993");
        return Plugin_Continue;
}


public Action:Timer_GetBossTeam(Handle:hTimer)
{
    BossTeam=FF2_GetBossTeam();
    return Plugin_Continue;
}
*/ 
Notice how it starts with /* and ends with */. This indicated that all the lines in between are a comment. You simple need to remove the /* and */ symbols from code to make it executable.

Your whole code will look like this now.

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>
#include <morecolors>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin> 
#define ME 2048

public Plugin:myinfo = {
    
name "",
    
author "",
};

public 
OnPluginStart2()
{
    
HookEvent("arena_round_start"Event_RoundStartEventHookMode_PostNoCopy);
}

//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!
strcmp(ability_name"start_goldpan"))
        
ServerCommand("sm_givew @blue 9001");
    else if(!
strcmp(ability_name"start_cop_stick"))
        
ServerCommand("sm_givew @blue 9992");
    else if(!
strcmp(ability_name"start_HL2_shotgun"))
        
ServerCommand("sm_givew @blue 9993");
        return 
Plugin_Continue;
}


public 
Action:Timer_GetBossTeam(Handle:hTimer)
{
    
BossTeam=FF2_GetBossTeam();
    return 
Plugin_Continue;
}

public 
Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
    new 
slot=FF2_GetAbilityArgument(index,this_plugin  _name,ability_name,0);
    
/*
    //                Uncomment it if you want use this rage as "true rage"m like Saxton's stun
    if (!slot)
    {
        if (index == 0)        //Starts VSH rage ability forward
        {
            new Action:act = Plugin_Continue;
            Call_StartForward(OnHaleRage);
            new Float:dist=FF2_GetRageDist(index,this_plugin_  name,ability_name);
            new Float:newdist=dist;
            Call_PushFloatRef(newdist);
            Call_Finish(act);
            if (act != Plugin_Continue && act != Plugin_Changed)
                return Plugin_Continue;
            if (act == Plugin_Changed) dist = newdist;    
        }
    }
    */
    
if(!strcmp(ability_name"rage_goldpan"))
        
ServerCommand("sm_givew @blue 9001");
    else if(!
strcmp(ability_name"rage_cop_stick"))
        
ServerCommand("sm_givew @blue 9992");
    else if(!
strcmp(ability_name"rage_HL2_shotgun"))
        
ServerCommand("sm_givew @blue 9993");
        return 
Plugin_Stop;


Last edited by Spirit_12; 03-08-2015 at 11:46.
Spirit_12 is offline
Maximilian_
Veteran Member
Join Date: Oct 2014
Old 03-08-2015 , 11:59   Re: Help me with compiling!
Reply With Quote #5

Quote:
Originally Posted by Spirit_12 View Post
sarysa already gave you the fix. I will give you a break down, since you are new to coding.

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>
#include <morecolors>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin> 
#define ME 2048

public Plugin:myinfo = {
    
name "",
    
author "",
};

public 
OnPluginStart2()
{
    
HookEvent("arena_round_start"Event_RoundStartEventHookMode_PostNoCopy);
}

/*
//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!strcmp(ability_name, "start_goldpan"))
        ServerCommand("sm_givew @blue 9001");
    else if(!strcmp(ability_name, "start_cop_stick"))
        ServerCommand("sm_givew @blue 9992");
    else if(!strcmp(ability_name, "start_HL2_shotgun"))
        ServerCommand("sm_givew @blue 9993");
        return Plugin_Continue;
}


public Action:Timer_GetBossTeam(Handle:hTimer)
{
    BossTeam=FF2_GetBossTeam();
    return Plugin_Continue;
}
*/
public Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
    new 
slot=FF2_GetAbilityArgument(index,this_plugin  _name,ability_name,0);
    
/*
    //                Uncomment it if you want use this rage as "true rage"m like Saxton's stun
    if (!slot)
    {
        if (index == 0)        //Starts VSH rage ability forward
        {
            new Action:act = Plugin_Continue;
            Call_StartForward(OnHaleRage);
            new Float:dist=FF2_GetRageDist(index,this_plugin_  name,ability_name);
            new Float:newdist=dist;
            Call_PushFloatRef(newdist);
            Call_Finish(act);
            if (act != Plugin_Continue && act != Plugin_Changed)
                return Plugin_Continue;
            if (act == Plugin_Changed) dist = newdist;    
        }
    }
    */
    
if(!strcmp(ability_name"rage_goldpan"))
        
ServerCommand("sm_givew @blue 9001");
    else if(!
strcmp(ability_name"rage_cop_stick"))
        
ServerCommand("sm_givew @blue 9992");
    else if(!
strcmp(ability_name"rage_HL2_shotgun"))
        
ServerCommand("sm_givew @blue 9993");
        return 
Plugin_Stop;

Look at this part of the above code.

PHP Code:
/*
//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!strcmp(ability_name, "start_goldpan"))
        ServerCommand("sm_givew @blue 9001");
    else if(!strcmp(ability_name, "start_cop_stick"))
        ServerCommand("sm_givew @blue 9992");
    else if(!strcmp(ability_name, "start_HL2_shotgun"))
        ServerCommand("sm_givew @blue 9993");
        return Plugin_Continue;
}


public Action:Timer_GetBossTeam(Handle:hTimer)
{
    BossTeam=FF2_GetBossTeam();
    return Plugin_Continue;
}
*/ 
Notice how it starts with /* and ends with */. This indicated that all the lines in between are a comment. You simple need to remove the /* and */ symbols from code to make it executable.

Your whole code will look like this now.

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>
#include <morecolors>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin> 
#define ME 2048

public Plugin:myinfo = {
    
name "",
    
author "",
};

public 
OnPluginStart2()
{
    
HookEvent("arena_round_start"Event_RoundStartEventHookMode_PostNoCopy);
}

//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!
strcmp(ability_name"start_goldpan"))
        
ServerCommand("sm_givew @blue 9001");
    else if(!
strcmp(ability_name"start_cop_stick"))
        
ServerCommand("sm_givew @blue 9992");
    else if(!
strcmp(ability_name"start_HL2_shotgun"))
        
ServerCommand("sm_givew @blue 9993");
        return 
Plugin_Continue;
}


public 
Action:Timer_GetBossTeam(Handle:hTimer)
{
    
BossTeam=FF2_GetBossTeam();
    return 
Plugin_Continue;
}

public 
Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
    new 
slot=FF2_GetAbilityArgument(index,this_plugin  _name,ability_name,0);
    
/*
    //                Uncomment it if you want use this rage as "true rage"m like Saxton's stun
    if (!slot)
    {
        if (index == 0)        //Starts VSH rage ability forward
        {
            new Action:act = Plugin_Continue;
            Call_StartForward(OnHaleRage);
            new Float:dist=FF2_GetRageDist(index,this_plugin_  name,ability_name);
            new Float:newdist=dist;
            Call_PushFloatRef(newdist);
            Call_Finish(act);
            if (act != Plugin_Continue && act != Plugin_Changed)
                return Plugin_Continue;
            if (act == Plugin_Changed) dist = newdist;    
        }
    }
    */
    
if(!strcmp(ability_name"rage_goldpan"))
        
ServerCommand("sm_givew @blue 9001");
    else if(!
strcmp(ability_name"rage_cop_stick"))
        
ServerCommand("sm_givew @blue 9992");
    else if(!
strcmp(ability_name"rage_HL2_shotgun"))
        
ServerCommand("sm_givew @blue 9993");
        return 
Plugin_Stop;

on compiling i have 8 errors... :\

Last edited by Maximilian_; 03-08-2015 at 12:03.
Maximilian_ is offline
Maximilian_
Veteran Member
Join Date: Oct 2014
Old 03-08-2015 , 12:14   Re: Help me with compiling!
Reply With Quote #6

Quote:
Originally Posted by Spirit_12 View Post
sarysa already gave you the fix. I will give you a break down, since you are new to coding.

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>
#include <morecolors>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin> 
#define ME 2048

public Plugin:myinfo = {
    
name "",
    
author "",
};

public 
OnPluginStart2()
{
    
HookEvent("arena_round_start"Event_RoundStartEventHookMode_PostNoCopy);
}

/*
//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!strcmp(ability_name, "start_goldpan"))
        ServerCommand("sm_givew @blue 9001");
    else if(!strcmp(ability_name, "start_cop_stick"))
        ServerCommand("sm_givew @blue 9992");
    else if(!strcmp(ability_name, "start_HL2_shotgun"))
        ServerCommand("sm_givew @blue 9993");
        return Plugin_Continue;
}


public Action:Timer_GetBossTeam(Handle:hTimer)
{
    BossTeam=FF2_GetBossTeam();
    return Plugin_Continue;
}
*/
public Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
    new 
slot=FF2_GetAbilityArgument(index,this_plugin  _name,ability_name,0);
    
/*
    //                Uncomment it if you want use this rage as "true rage"m like Saxton's stun
    if (!slot)
    {
        if (index == 0)        //Starts VSH rage ability forward
        {
            new Action:act = Plugin_Continue;
            Call_StartForward(OnHaleRage);
            new Float:dist=FF2_GetRageDist(index,this_plugin_  name,ability_name);
            new Float:newdist=dist;
            Call_PushFloatRef(newdist);
            Call_Finish(act);
            if (act != Plugin_Continue && act != Plugin_Changed)
                return Plugin_Continue;
            if (act == Plugin_Changed) dist = newdist;    
        }
    }
    */
    
if(!strcmp(ability_name"rage_goldpan"))
        
ServerCommand("sm_givew @blue 9001");
    else if(!
strcmp(ability_name"rage_cop_stick"))
        
ServerCommand("sm_givew @blue 9992");
    else if(!
strcmp(ability_name"rage_HL2_shotgun"))
        
ServerCommand("sm_givew @blue 9993");
        return 
Plugin_Stop;

Look at this part of the above code.

PHP Code:
/*
//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!strcmp(ability_name, "start_goldpan"))
        ServerCommand("sm_givew @blue 9001");
    else if(!strcmp(ability_name, "start_cop_stick"))
        ServerCommand("sm_givew @blue 9992");
    else if(!strcmp(ability_name, "start_HL2_shotgun"))
        ServerCommand("sm_givew @blue 9993");
        return Plugin_Continue;
}


public Action:Timer_GetBossTeam(Handle:hTimer)
{
    BossTeam=FF2_GetBossTeam();
    return Plugin_Continue;
}
*/ 
Notice how it starts with /* and ends with */. This indicated that all the lines in between are a comment. You simple need to remove the /* and */ symbols from code to make it executable.

Your whole code will look like this now.

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>
#include <morecolors>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin> 
#define ME 2048

public Plugin:myinfo = {
    
name "",
    
author "",
};

public 
OnPluginStart2()
{
    
HookEvent("arena_round_start"Event_RoundStartEventHookMode_PostNoCopy);
}

//Uncomment it, if you want to use check players' Team

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!
strcmp(ability_name"start_goldpan"))
        
ServerCommand("sm_givew @blue 9001");
    else if(!
strcmp(ability_name"start_cop_stick"))
        
ServerCommand("sm_givew @blue 9992");
    else if(!
strcmp(ability_name"start_HL2_shotgun"))
        
ServerCommand("sm_givew @blue 9993");
        return 
Plugin_Continue;
}


public 
Action:Timer_GetBossTeam(Handle:hTimer)
{
    
BossTeam=FF2_GetBossTeam();
    return 
Plugin_Continue;
}

public 
Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
    new 
slot=FF2_GetAbilityArgument(index,this_plugin  _name,ability_name,0);
    
/*
    //                Uncomment it if you want use this rage as "true rage"m like Saxton's stun
    if (!slot)
    {
        if (index == 0)        //Starts VSH rage ability forward
        {
            new Action:act = Plugin_Continue;
            Call_StartForward(OnHaleRage);
            new Float:dist=FF2_GetRageDist(index,this_plugin_  name,ability_name);
            new Float:newdist=dist;
            Call_PushFloatRef(newdist);
            Call_Finish(act);
            if (act != Plugin_Continue && act != Plugin_Changed)
                return Plugin_Continue;
            if (act == Plugin_Changed) dist = newdist;    
        }
    }
    */
    
if(!strcmp(ability_name"rage_goldpan"))
        
ServerCommand("sm_givew @blue 9001");
    else if(!
strcmp(ability_name"rage_cop_stick"))
        
ServerCommand("sm_givew @blue 9992");
    else if(!
strcmp(ability_name"rage_HL2_shotgun"))
        
ServerCommand("sm_givew @blue 9993");
        return 
Plugin_Stop;

but thanks anyway, i compiled it
Maximilian_ 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 19:35.


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