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

"Error 010: Invalid function or declaration" on include line


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geel9
Senior Member
Join Date: Mar 2009
Old 04-02-2011 , 19:36   "Error 010: Invalid function or declaration" on include line
Reply With Quote #1

The line that the error is on is ALWAYS the same line, no matter what is there.

The line is an #include line.
Geel9 is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 04-02-2011 , 20:10   Re: "Error 010: Invalid function or declaration" on include line
Reply With Quote #2

Show code for example.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Geel9
Senior Member
Join Date: Mar 2009
Old 04-02-2011 , 20:14   Re: "Error 010: Invalid function or declaration" on include line
Reply With Quote #3

Code:
#pragma semicolon 1

// include
#include <sourcemod>
#include <sdktools>
#include <tf2>
#include <tf2_stocks>
#include <colors>
#include <sdkhooks>

#define TEAM_GOOD 2

#include tf2adventure/misc
#include tf2adventure/camera
#include tf2adventure/npc_base

#include tf2adventure/npc_talk
#include tf2adventure/npc_actors
#include tf2adventure/npc_ai
#include tf2adventure/npc_characters
#include tf2adventure/maps
#include tf2adventure/playerinput
#include tf2adventure/debug
#include tf2adventure/parsing
#include tf2adventure/player_idle
#include tf2adventure/party_variables
#include tf2adventure/maps_information
#include tf2adventure/speechsystem
#include tf2adventure/conditionals
#include tf2adventure/variable_assignments

public Plugin:myinfo =
{
	name = "TF2 Adventure",
	author = "Mecha the Slag",
	description = "Adventure Time!",
	version = "1.0",
	url = "http://www.mechaware.net/"
};

public OnPluginStart() {
    Variables_Setup();
    Maps_Setup();
    NPC_Setup();
    NPC_TalkStopAll();
    Debug_Setup();

    RegConsoleCmd("sm_talk", NPC_TalkCommand);
    RegAdminCmd("tf2a_mapinit", MapInit_Command, ADMFLAG_SLAY);
    RegConsoleCmd("voicemenu", PlayerInputMedic);
    RegConsoleCmd("kill", PlayerCommandDeny);
    RegConsoleCmd("explode", PlayerCommandDeny);
    RegConsoleCmd("jointeam", PlayerCommandDeny);
    RegConsoleCmd("joinclass", PlayerCommandDeny);
    RegConsoleCmd("taunt", PlayerCommandTaunt);
    
    HookEvent("player_spawn", Event_PlayerReset);
    HookEvent("player_death", Event_PlayerReset);
    
    HookEvent("teamplay_round_start", MapRefresh);
    
    for (new iClient = 0; iClient <= MaxClients; iClient++) {
        if (IsValidClient(iClient)) OnClientInit(iClient);
    }
    
    SetConVarBool(FindConVar("mp_disable_respawn_times"), true);
    SetConVarInt(FindConVar("mp_teams_unbalance_limit"), 0);
    SetConVarInt(FindConVar("mp_waitingforplayers_time"), 0);
    SetConVarInt(FindConVar("mp_timelimit"), 999999);
    SetConVarInt(FindConVar("mp_winlimit"), 0);
    SetConVarInt(FindConVar("mp_maxrounds"), 0);
    SetConVarInt(FindConVar("mp_idledealmethod"), 0);
}

public Action:OnGetGameDescription(String:strDesc[64]) {
    Format(strDesc, sizeof(strDesc), "TF2 Adventure");
    return Plugin_Changed;
}

public OnPluginEnd() {
    NPC_RemoveAll();
    CameraDestroyAll();
}

public OnClientPostAdminCheck(iClient) {
    MapInit();
    OnClientInit(iClient);
    CreateTimer(0.1, PutClientIn, iClient);
}

public OnClientDisconnect(iClient) {
    NPC_TalkStop(iClient, false);
}

public Action:PutClientIn(Handle:hTimer, any:iClient) {
    ChangeClientTeam(iClient, TEAM_GOOD);
    TF2_SetPlayerClass(iClient, TFClassType:TFClass_DemoMan, true, true);
    TF2_RespawnPlayer(iClient);
    
    Player_Idle_Set(iClient);
    
    CreateTimer(0.0, PlayerSetView, iClient);
    CreateTimer(0.1, PlayerSetView, iClient);
    CreateTimer(0.3, PlayerSetView, iClient);
    CreateTimer(0.5, PlayerSetView, iClient);
    for (new i = 1; i <= 10; i++) {
        CreateTimer(float(i), PlayerSetView, iClient);
    }
}

public Action:Event_PlayerReset(Handle:hEvent, String:strName[], bool:bDontBroadcast) {
    new iClient = GetClientOfUserId(GetEventInt(hEvent, "userid"));
    if (!IsValidClient(iClient)) return Plugin_Continue;
    
    NPC_TalkStop(iClient, false);
    CreateTimer(0.0, PlayerSetView, iClient);
    CreateTimer(0.1, PlayerSetView, iClient);
    CreateTimer(0.3, PlayerSetView, iClient);
    CreateTimer(0.5, PlayerSetView, iClient);
    for (new i = 1; i <= 10; i++) {
        CreateTimer(float(i), PlayerSetView, iClient);
    }
    decl String:mapName[255];
    decl String:mapFile[255];
    Maps_Get_Current_Map(mapFile, sizeof(mapFile));
    Maps_Get_Name(mapFile, mapName, sizeof(mapName));
    
    PrintCenterTextAll("%s", mapName);
    
    return Plugin_Continue;
}

OnClientInit(iClient) {
    NPC_TalkStop(iClient, false);
    if (!IsFakeClient(iClient)) {
        SendConVarValue(iClient, FindConVar("sv_cheats"), "1");
    }
    SDKHook(iClient, SDKHook_PreThink, OnClientPreThink);
}

public OnClientPreThink(iClient) {
    Player_Idle_Prethink(iClient);
}
Geel9 is offline
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 04-02-2011 , 21:36   Re: "Error 010: Invalid function or declaration" on include line
Reply With Quote #4

I do believe you need quotes when including files not in the /include/ folder?

PHP Code:
#include "tf2adventure/npc_talk"
#include "tf2adventure/npc_actors" 
etc
Luke Penny is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 04-04-2011 , 01:27   Re: "Error 010: Invalid function or declaration" on include line
Reply With Quote #5

Actually as it turns out, there was a syntax error in conditionals.inc

SourcePawn just has weird error reporting at times
__________________
Mecha the Slag 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 02:24.


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