Raised This Month: $120 Target: $400
 30% 

help cant ciompile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
benmassey
Junior Member
Join Date: Dec 2018
Old 12-08-2018 , 09:03   help cant ciompile
Reply With Quote #1

Old Today , 08:02 AM help i cant compile files
Edit/Delete Message Reply With Quote Multi-Quote This Message Quick reply to this message #1
when i try to compil files with compiler.exe
its make me a lot of error's
even when i have the inculde that i need
if i try to compile file name adversite.sp
its showes me a lot of errrors

//// advertisements.sp
// advertisements/topcolors.sp(1) : error 010: invalid function or declaration
// advertisements/topcolors.sp(3) : error 010: invalid function or declaration
// advertisements/topcolors.sp(5) : error 010: invalid function or declaration
// advertisements/topcolors.sp(9) : error 010: invalid function or declaration
// advertisements/topcolors.sp(9) : error 010: invalid function or declaration
// advertisements/topcolors.sp(10) : error 010: invalid function or declaration
// advertisements/topcolors.sp(11) : error 010: invalid function or declaration
// advertisements/topcolors.sp(12) : error 010: invalid function or declaration
// advertisements/topcolors.sp(13) : error 010: invalid function or declaration
// advertisements/topcolors.sp(14) : error 010: invalid function or declaration
// advertisements/topcolors.sp(15) : error 010: invalid function or declaration
// advertisements/topcolors.sp(16) : error 010: invalid function or declaration
// advertisements/topcolors.sp(17) : error 010: invalid function or declaration
// advertisements/topcolors.sp(1 : error 010: invalid function or declaration
// advertisements/topcolors.sp(19) : error 010: invalid function or declaration
// advertisements/topcolors.sp(20) : error 010: invalid function or declaration
// advertisements/topcolors.sp(21) : error 010: invalid function or declaration
// advertisements/topcolors.sp(22) : error 010: invalid function or declaration
// advertisements/topcolors.sp(23) : error 010: invalid function or declaration
// advertisements/topcolors.sp(24) : error 010: invalid function or declaration
// advertisements/topcolors.sp(25) : error 010: invalid function or declaration
// advertisements/topcolors.sp(26) : error 010: invalid function or declaration
// advertisements/topcolors.sp(27) : error 010: invalid function or declaration
// advertisements/topcolors.sp(2 : error 010: invalid function or declaration
// advertisements/topcolors.sp(29) : error 010: invalid function or declaration
// advertisements/topcolors.sp(30) : error 010: invalid function or declaration

thats one for exmple thats happend to me for all of scripts i try to comple
any help??
benmassey is offline
Whai
Member
Join Date: Jul 2018
Location: In Hell
Old 12-08-2018 , 09:07   Re: help cant ciompile
Reply With Quote #2

Hm...

How can we help you if we don't show the source code ?
__________________
A non-professional TF2 coder

My GitHub repo. (My plugins are often up to date on GitHub than here)

Last edited by Whai; 12-08-2018 at 09:07.
Whai is offline
benmassey
Junior Member
Join Date: Dec 2018
Old 12-08-2018 , 09:11   Re: help cant ciompile
Reply With Quote #3

Quote:
Originally Posted by Whai View Post
Hm...

How can we help you if we don't show the source code ?
here is the code

PHP Code:
#include <sourcemod>
#include <colorvariables>
#undef REQUIRE_PLUGIN
#include <updater>
#include "advertisements/topcolors.sp"

#pragma newdecls required
#pragma semicolon 1

#define PL_VERSION    "2.0.2"
#define UPDATE_URL    "http://ErikMinekus.github.io/sm-advertisements/update.txt"

public Plugin myinfo =
{
    
name        "Advertisements",
    
author      "Tsunami",
    
description "Display advertisements",
    
version     PL_VERSION,
    
url         "http://www.tsunami-productions.nl"
};


/**
 * Globals
 */
KeyValues g_hAdvertisements;
ConVar g_hEnabled;
ConVar g_hFile;
ConVar g_hInterval;
Handle g_hTimer;


/**
 * Plugin Forwards
 */
public void OnPluginStart()
{
    
CreateConVar("sm_advertisements_version"PL_VERSION"Display advertisements"FCVAR_NOTIFY);
    
g_hEnabled  CreateConVar("sm_advertisements_enabled",  "1",                  "Enable/disable displaying advertisements.");
    
g_hFile     CreateConVar("sm_advertisements_file",     "advertisements.txt""File to read the advertisements from.");
    
g_hInterval CreateConVar("sm_advertisements_interval""30",                 "Amount of seconds between advertisements.");

    
g_hFile.AddChangeHook(ConVarChange_File);
    
g_hInterval.AddChangeHook(ConVarChange_Interval);

    
RegServerCmd("sm_advertisements_reload"Command_ReloadAds"Reload the advertisements");

    
AddTopColors();

    if (
LibraryExists("updater")) {
        
Updater_AddPlugin(UPDATE_URL);
    }
}

public 
void OnMapStart()
{
    
ParseAds();

    
g_hTimer CreateTimer(g_hInterval.IntValue 1.0Timer_DisplayAd_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public 
void OnLibraryAdded(const char[] name)
{
    if (
StrEqual(name"updater")) {
        
Updater_AddPlugin(UPDATE_URL);
    }
}

public 
void ConVarChange_File(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
ParseAds();
}

public 
void ConVarChange_Interval(ConVar convar, const char[] oldValue, const char[] newValue)
{
    if (
g_hTimer) {
        
KillTimer(g_hTimer);
    }

    
g_hTimer CreateTimer(g_hInterval.IntValue 1.0Timer_DisplayAd_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}


/**
 * Commands
 */
public Action Command_ReloadAds(int args)
{
    
ParseAds();
    return 
Plugin_Handled;
}


/**
 * Menu Handlers
 */
public int Handler_DoNothing(Menu menuMenuAction actionint param1int param2) {}


/**
 * Timers
 */
public Action Timer_DisplayAd(Handle timer)
{
    if (!
g_hEnabled.BoolValue) {
        return;
    }

    
char sCenter[1024], sChat[1024], sHint[1024], sMenu[1024], sTop[1024], sFlags[16];
    
g_hAdvertisements.GetString("center"sCentersizeof(sCenter));
    
g_hAdvertisements.GetString("chat",   sChat,   sizeof(sChat));
    
g_hAdvertisements.GetString("hint",   sHint,   sizeof(sHint));
    
g_hAdvertisements.GetString("menu",   sMenu,   sizeof(sMenu));
    
g_hAdvertisements.GetString("top",    sTop,    sizeof(sTop));
    
g_hAdvertisements.GetString("flags",  sFlags,  sizeof(sFlags), "none");
    
int iFlags   ReadFlagString(sFlags);
    
bool bAdmins StrEqual(sFlags""),
         
bFlags  = !StrEqual(sFlags"none");

    if (
sCenter[0]) {
        
ProcessVariables(sCenter);
        
CRemoveColors(sCentersizeof(sCenter));

        for (
int i 1<= MaxClientsi++) {
            if (
IsClientInGame(i) && !IsFakeClient(i) &&
                ((!
bAdmins && !(bFlags && (GetUserFlagBits(i) & (iFlags|ADMFLAG_ROOT)))) ||
                 (
bAdmins && (GetUserFlagBits(i) & (ADMFLAG_GENERIC|ADMFLAG_ROOT))))) {
                
PrintCenterText(isCenter);

                
DataPack hCenterAd;
                
CreateDataTimer(1.0Timer_CenterAdhCenterAdTIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
                
hCenterAd.WriteCell(i);
                
hCenterAd.WriteString(sCenter);
            }
        }
    }
    if (
sHint[0]) {
        
ProcessVariables(sHint);
        
CRemoveColors(sHintsizeof(sHint));

        for (
int i 1<= MaxClientsi++) {
            if (
IsClientInGame(i) && !IsFakeClient(i) &&
                ((!
bAdmins && !(bFlags && (GetUserFlagBits(i) & (iFlags|ADMFLAG_ROOT)))) ||
                 (
bAdmins && (GetUserFlagBits(i) & (ADMFLAG_GENERIC|ADMFLAG_ROOT))))) {
                
PrintHintText(isHint);
            }
        }
    }
    if (
sMenu[0]) {
        
ProcessVariables(sMenu);
        
CRemoveColors(sMenusizeof(sMenu));

        
Panel hPl = new Panel();
        
hPl.DrawText(sMenu);
        
hPl.CurrentKey 10;

        for (
int i 1<= MaxClientsi++) {
            if (
IsClientInGame(i) && !IsFakeClient(i) &&
                ((!
bAdmins && !(bFlags && (GetUserFlagBits(i) & (iFlags|ADMFLAG_ROOT)))) ||
                 (
bAdmins && (GetUserFlagBits(i) & (ADMFLAG_GENERIC|ADMFLAG_ROOT))))) {
                
hPl.Send(iHandler_DoNothing10);
            }
        }

        
delete hPl;
    }
    if (
sChat[0]) {
        
bool bTeamColor StrContains(sChat"{teamcolor}"false) != -1;

        
ProcessVariables(sChat);
        
CProcessVariables(sChatsizeof(sChat));
        
CAddWhiteSpace(sChatsizeof(sChat));

        for (
int i 1<= MaxClientsi++) {
            if (
IsClientInGame(i) && !IsFakeClient(i) &&
                ((!
bAdmins && !(bFlags && (GetUserFlagBits(i) & (iFlags|ADMFLAG_ROOT)))) ||
                 (
bAdmins && (GetUserFlagBits(i) & (ADMFLAG_GENERIC|ADMFLAG_ROOT))))) {
                if (
bTeamColor) {
                    
CSayText2(isChati);
                } else {
                    
PrintToChat(isChat);
                }
            }
        }
    }
    if (
sTop[0]) {
        
int iStart    0,
            
aColor[4] = {255255255255};

        
ParseTopColor(sTopiStartaColor);
        
ProcessVariables(sTop[iStart]);

        
KeyValues hKv = new KeyValues("Stuff""title"sTop[iStart]);
        
hKv.SetColor4("color"aColor);
        
hKv.SetNum("level",    1);
        
hKv.SetNum("time",     10);

        for (
int i 1<= MaxClientsi++) {
            if (
IsClientInGame(i) && !IsFakeClient(i) &&
                ((!
bAdmins && !(bFlags && (GetUserFlagBits(i) & (iFlags|ADMFLAG_ROOT)))) ||
                 (
bAdmins && (GetUserFlagBits(i) & (ADMFLAG_GENERIC|ADMFLAG_ROOT))))) {
                
CreateDialog(ihKvDialogType_Msg);
            }
        }

        
delete hKv;
    }

    if (!
g_hAdvertisements.GotoNextKey()) {
        
g_hAdvertisements.Rewind();
        
g_hAdvertisements.GotoFirstSubKey();
    }
}

public 
Action Timer_CenterAd(Handle timerDataPack pack)
{
    
char sCenter[1024];
    static 
int iCount 0;

    
pack.Reset();
    
int iClient pack.ReadCell();
    
pack.ReadString(sCentersizeof(sCenter));

    if (!
IsClientInGame(iClient) || ++iCount >= 5) {
        
iCount 0;
        return 
Plugin_Stop;
    }

    
PrintCenterText(iClientsCenter);
    return 
Plugin_Continue;
}


/**
 * Stocks
 */
void ParseAds()
{
    
delete g_hAdvertisements;
    
g_hAdvertisements CreateKeyValues("Advertisements");

    
char sFile[64], sPath[PLATFORM_MAX_PATH];
    
g_hFile.GetString(sFilesizeof(sFile));
    
BuildPath(Path_SMsPathsizeof(sPath), "configs/%s"sFile);

    if (!
FileExists(sPath)) {
        
SetFailState("File Not Found: %s"sPath);
    }

    
g_hAdvertisements.ImportFromFile(sPath);
    
g_hAdvertisements.GotoFirstSubKey();
}

void ProcessVariables(char sText[1024])
{
    
char sBuffer[64];
    if (
StrContains(sText"\\n") != -1) {
        
Format(sBuffersizeof(sBuffer), "%c"13);
        
ReplaceString(sTextsizeof(sText), "\\n"sBuffer);
    }

    if (
StrContains(sText"{currentmap}"false) != -1) {
        
GetCurrentMap(sBuffersizeof(sBuffer));
        
ReplaceString(sTextsizeof(sText), "{currentmap}"sBufferfalse);
    }

    if (
StrContains(sText"{date}"false) != -1) {
        
FormatTime(sBuffersizeof(sBuffer), "%m/%d/%Y");
        
ReplaceString(sTextsizeof(sText), "{date}"sBufferfalse);
    }

    if (
StrContains(sText"{time}"false) != -1) {
        
FormatTime(sBuffersizeof(sBuffer), "%I:%M:%S%p");
        
ReplaceString(sTextsizeof(sText), "{time}"sBufferfalse);
    }

    if (
StrContains(sText"{time24}"false) != -1) {
        
FormatTime(sBuffersizeof(sBuffer), "%H:%M:%S");
        
ReplaceString(sTextsizeof(sText), "{time24}"sBufferfalse);
    }

    if (
StrContains(sText"{timeleft}"false) != -1) {
        
int iMinsiSecsiTimeLeft;
        if (
GetMapTimeLeft(iTimeLeft) && iTimeLeft 0) {
            
iMins iTimeLeft 60;
            
iSecs iTimeLeft 60;
        }

        
Format(sBuffersizeof(sBuffer), "%d:%02d"iMinsiSecs);
        
ReplaceString(sTextsizeof(sText), "{timeleft}"sBufferfalse);
    }

    
ConVar hConVar;
    
char sConVar[64], sSearch[64], sReplace[64];
    
int iEnd = -1iStart StrContains(sText"{"), iStart2;
    while (
iStart != -1) {
        
iEnd StrContains(sText[iStart 1], "}");
        if (
iEnd == -1) {
            break;
        }

        
strcopy(sConVariEnd 1sText[iStart 1]);
        
Format(sSearchsizeof(sSearch), "{%s}"sConVar);

        if ((
hConVar FindConVar(sConVar))) {
            
hConVar.GetString(sReplacesizeof(sReplace));
            
ReplaceString(sTextsizeof(sText), sSearchsReplacefalse);
        }

        
iStart2 StrContains(sText[iStart 1], "{");
        if (
iStart2 == -1) {
            break;
        }

        
iStart += iStart2 1;
    }


Last edited by benmassey; 12-08-2018 at 15:03.
benmassey is offline
Whai
Member
Join Date: Jul 2018
Location: In Hell
Old 12-08-2018 , 13:33   Re: help cant ciompile
Reply With Quote #4

Well if you take a look on your compile errors you will see it's not advertisements.sp but topcolors.sp

Also please, quote your code into PHP block, for example :

PHP Code:
This 
__________________
A non-professional TF2 coder

My GitHub repo. (My plugins are often up to date on GitHub than here)
Whai is offline
benmassey
Junior Member
Join Date: Dec 2018
Old 12-08-2018 , 14:30   Re: help cant ciompile
Reply With Quote #5

Quote:
Originally Posted by Whai View Post
Well if you take a look on your compile errors you will see it's not advertisements.sp but topcolors.sp

Also please, quote your code into PHP block, for example :

PHP Code:
This 

i still didnt understand the problem becuse the include name? that diffrent?
benmassey is offline
Whai
Member
Join Date: Jul 2018
Location: In Hell
Old 12-08-2018 , 14:45   Re: help cant ciompile
Reply With Quote #6

Quote:
Originally Posted by benmassey View Post
i still didnt understand the problem becuse the include name? that diffrent?
The script you sent, is on advertisements.sp file.

Theses errors are about on topcolors.sp file

What I need is topcolors.sp file.

Also, here is something if you don't know how to do the PHP block, there are also other things.
__________________
A non-professional TF2 coder

My GitHub repo. (My plugins are often up to date on GitHub than here)
Whai is offline
benmassey
Junior Member
Join Date: Dec 2018
Old 12-08-2018 , 15:03   Re: help cant ciompile
Reply With Quote #7

Quote:
Originally Posted by Whai View Post
The script you sent, is on advertisements.sp file.

Theses errors are about on topcolors.sp file

What I need is topcolors.sp file.

Also, here is something if you don't know how to do the PHP block, there are also other things.
can you help me there?

https://forums.alliedmods.net/showthread.php?t=312568
benmassey is offline
Reply


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 13:52.


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