SA-MP Forums Archive
Clan un-expainable error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Clan un-expainable error (/showthread.php?tid=587369)



Clan un-expainable error - TitanForceGeneral - 30.08.2015

Hey guys, hope your well. I'm really new to pawno scripting so i need some help here with this clan system.
First of all: This is not my script. I'm just editing it to my needs. The original script's pastebin link is here > > Click Here
These are the errors which I'm getting ATM.
Код:
C:\Users\Damman\Desktop\SA-MP Test\filterscripts\test123.pwn(137) : error 075: input line too long (after substitutions)
C:\Users\Damman\Desktop\SA-MP Test\filterscripts\test123.pwn(138) : error 037: invalid string (possibly non-terminated string)
C:\Users\Damman\Desktop\SA-MP Test\filterscripts\test123.pwn(138) : error 017: undefined symbol "CREATE"
C:\Users\Damman\Desktop\SA-MP Test\filterscripts\test123.pwn(138) : error 017: undefined symbol "TABLE"
C:\Users\Damman\Desktop\SA-MP Test\filterscripts\test123.pwn(138) : fatal error 107: too many error messages on one line
The lines which are causing the error are colored in Red:
Код:
    public OnFilterScriptInit()
    {
            //--------------------------------------------------------------------------
            AntiDeAMX0();
            print("\n");
            print("+=================================+");
            print("+ System Clan Successfully Loaded +");
            print("+=================================+");
            //--------------------------------------------------------------------------
            Database = db_open("CSystem.db");
            //--------------------------------------------------------------------------
        db_query(Database, "CREATE TABLE IF NOT EXISTS clans(`ID` INTEGER PRIMARY KEY AUTOINCREMENT,\
                                                    clanname VARCHAR(30),\
                                                    clantag VARCHAR(5),\
                                                    clanleader VARCHAR(100),\
                                                    clandes VARCHAR(100),\
                                                    clanmotd VARCHAR(50),\
                                                    clankills INT(5),\
                                                    clandeaths INT(5),\
                                                    clancolor VARCHAR(50),\
                                                    clanposx float NOT NULL,\
                                                    clanposy float NOT NULL,\
                                                    clanposz float NOT NULL,\
                                                    lskin INT(3),\
                                                    mskin INT(3),\
                                                    weap1 INT(3),\
                                                    weap2 INT(3),\
                                                    weap3 INT(3),\
                                                    weap4 INT(3),\
                                                    weap5 INT(3),\   //Line # 137
                                                    weap6 INT(3))");   //Line #138
            //--------------------------------------------------------------------------
            db_query(Database, "CREATE TABLE IF NOT EXISTS members(`ID` INTEGER PRIMARY KEY AUTOINCREMENT,\
                                                    clanname VARCHAR(30),\
                                                    playername VARCHAR(30),\
                                                    playerclanrank INT(5),\
                                                    isinclan INT(2),\
                                                    IsOnline INT(2))");
            return 1;
    }



Re: Clan un-expainable error - Vince - 30.08.2015

Honestly, you shouldn't be doing DDL instructions (create, drop, alter) in code. Create a separate .sql file with the definition statements and run it against your database. Chances are you only have to do this once in the entire lifetime of the server so it seems stupid to code it in.


Re: Clan un-expainable error - TitanForceGeneral - 30.08.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
Honestly, you shouldn't be doing DDL instructions (create, drop, alter) in code. Create a separate .sql file with the definition statements and run it against your database. Chances are you only have to do this once in the entire lifetime of the server so it seems stupid to code it in.
Like i said, I'm just editing this script. It's made by i think someone called Teddy. I'm just editing it to my needs.
Can you please solve this error? Or can you do something? I'm really new to pawno.