SQLite 2 problems...
#1

Hi, i have two problems with SQLite DataBase...
i created a db...here it is:
pawn Код:
public OnFilterScriptInit( )
{
    Database = db_open( "Clans.db" );
    strcat( TableS, "CREATE TABLE IF NOT EXISTS `Clans` ", 420 );
    strcat( TableS, "( `ClanSef` varchar(30), \
                     `ClanName` varchar(40), \
                     `Member1` varchar(30), \
                     `Member2` varchar(30), \
                     `Member3` varchar(30), \
                     `Member4` varchar(30), \
                     `Member5` varchar(30), \
                     `Member6` varchar(30), \
                     `Member7` varchar(30), \
                     `Member8` varchar(30), \
                     `Member9` varchar(30) "
, 420 );
    strcat( TableS, "`Member10` varchar(30), \
                     `ClanSkin` INT, \
                     `ClanSefSkin` INT, \
                     `ClanColor` INT, \
                     `Weapon1` INT, \
                     `Weapon2` INT, \
                     `Weapon3` INT, \
                     `Weapon4` INT, \
                     `Weapon5` INT, \
                     `ClanKills` INT, \
                     `ClanDeaths` INT, )"
, 420 );
    db_free_result( db_query( Database, TableS ) );
    return 1;
}
but when i start server.exe...the database is created with 0kbs...and i can't open it...
and a second problem is with an dialog
here it is:
pawn Код:
if ( dialogid == ClanMemSkin )
    {
        if ( response == 1 )
        {
            if ( strlen( inputtext ) )
            {
                if ( IsInvalidSkin ( inputtext ) )
                {
                    format( Query, sizeof( Query ), "INSERT INTO `Clans` ( `ClanSkin` ) VALUES( '%d' )", inputtext );
                    SetPlayerSkin( playerid, inputtext );
                    db_query( Database, Query );
                    db_free_result( db_query( Database, Query ) );
                    ShowPlayerDialog( playerid, ClanLedSkin, DIALOG_STYLE_INPUT, "Leader Skin","{E60000}========{FFFF00}========{00FF00}========\n{FFFFFF}Please enter the leader skin:\n{E60000}========{FFFF00}========{00FF00}========:","OK","Cancel" );
                    return 1;
                }
                else return ShowPlayerDialog( playerid, ClanMemSkin, DIALOG_STYLE_INPUT, "Member Skin","ERROR!\nThat you put there is invalid skin!\n{E60000}========{FFFF00}========{00FF00}========\n{FFFFFF}Please enter the member skin:\n{E60000}========{FFFF00}========{00FF00}========:","OK","Cancel" );
            }
        }
    }
i get these errors:
pawn Код:
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\filterscripts\ccsql.pwn(146) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\filterscripts\ccsql.pwn(149) : error 035: argument type mismatch (argument 2)
line 146 if ( IsInvalidSkin ( inputtext ) )
line 149 SetPlayerSkin( playerid, inputtext );
please help me...
Reply
#2

1. To small TableS and after member9 varchar(30) should be ','
pawn Код:
new DB:Database;
new TableS[480];
public OnFilterScriptInit( )
{
    Database = db_open( "Clans.db" );
    strcat( TableS, "CREATE TABLE IF NOT EXISTS `Clans` ");
    strcat( TableS, "(`ClanSef` varchar(30), \
                     `ClanName` varchar(40), \
                     `Member1` varchar(30), \
                     `Member2` varchar(30), \
                     `Member3` varchar(30), \
                     `Member4` varchar(30), \
                     `Member5` varchar(30), \
                     `Member6` varchar(30), \
                     `Member7` varchar(30), \
                     `Member8` varchar(30), \
                     `Member9` varchar(30),"
);
    strcat( TableS, "`Member10` varchar(30), \
                     `ClanSkin` INT, \
                     `ClanSefSkin` INT, \
                     `ClanColor` INT, \
                     `Weapon1` INT, \
                     `Weapon2` INT, \
                     `Weapon3` INT, \
                     `Weapon4` INT, \
                     `Weapon5` INT, \
                     `ClanKills` INT, \
                     `ClanDeaths` INT)"
);
    db_free_result( db_query( Database, TableS ) );
    return 1;
}
2. strval(inputtext)
Reply
#3

it works thank you very very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)