format a big strig SQLite...
#1

hi, as you know i start to script in SQLite...
and i have a question
i have this on OnPlayerConnect!
pawn Код:
public OnPlayerDisconnect(playerid)
{
    format(Query, sizeof(Query), "UPDATE `ClanStats` SET (`ClanKills` = '%d', `ClanDeaths` = '%d') WHERE `ClanName` = '%s'",P_DATA[playerid][ClanKills], P_DATA[playerid][ClanDeaths]);
    db_free_result(db_query(Database, Query));
    format(Query, sizeof(Query), "UPDATE `ClanMembers` SET (`Member1` = '%s', `Member2` = '%s', `Member3` = '%s', `Member4` = '%s', `Member5` = '%s', `Member6` = '%s', `Member7` = '%s', `Member8` = '%s', `Member9` = '%s', `Member10` = '%s') WHERE `ClanSef` = '%s'", P_DATA[[playerid][Member1], P_DATA[[playerid][Member2], P_DATA[[playerid][Member3], P_DATA[[playerid][Member4], P_DATA[[playerid][Member5], P_DATA[[playerid][Member6], P_DATA[[playerid][Member7], P_DATA[[playerid][Member8], P_DATA[[playerid][Member9], P_DATA[[playerid][Member10], P_DATA[playerid][ClanSef]);
    db_free_result(db_query(Database, Query));
    return 1;
}
and takes me this errors:
pawn Код:
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\filterscripts\ccsql.pwn(68) : error 075: input line too long (after substitutions)
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\filterscripts\ccsql.pwn(69) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\filterscripts\ccsql.pwn(69) : warning 215: expression has no effect
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\filterscripts\ccsql.pwn(69) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\filterscripts\ccsql.pwn(69) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\filterscripts\ccsql.pwn(69) : fatal error 107: too many error messages on one line
i know that line is too long but how i can decrease this query:
pawn Код:
format(Query, sizeof(Query), "UPDATE `ClanMembers` SET (`Member1` = '%s', `Member2` = '%s', `Member3` = '%s', `Member4` = '%s', `Member5` = '%s', `Member6` = '%s', `Member7` = '%s', `Member8` = '%s', `Member9` = '%s', `Member10` = '%s') WHERE `ClanSef` = '%s'", P_DATA[[playerid][Member1], P_DATA[[playerid][Member2], P_DATA[[playerid][Member3], P_DATA[[playerid][Member4], P_DATA[[playerid][Member5], P_DATA[[playerid][Member6], P_DATA[[playerid][Member7], P_DATA[[playerid][Member8], P_DATA[[playerid][Member9], P_DATA[[playerid][Member10], P_DATA[playerid][ClanSef]);
pls help me...!
Reply
#2

Try seperating lines with \
For example
pawn Код:
SendClientMessage( playerid, -1, "Hello \
there. "
);
Shows:
Код:
Hello there.
Reply
#3

use strcat
Reply
#4

Quote:
Originally Posted by Mean
Посмотреть сообщение
Try seperating lines with \
For example
pawn Код:
SendClientMessage( playerid, -1, "Hello \
there. "
);
Shows:
Код:
Hello there.
It also shows that error!
Reply
#5

From the second format, I spotted this:
pawn Код:
P_DATA[[playerid][Member10]
You've got [ twice ([[playerid])
Reply
#6

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
From the second format, I spotted this:
pawn Код:
P_DATA[[playerid][Member10]
You've got [ twice ([[playerid])
i don't understand what do you say...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)