format(query, sizeof(query), "INSERT INTO playerdata (user, password, score, money, level, vip, kma, rank, kills, deaths, muted, jailed, frozen, mutedtimes, jailedtimes, frozentimes, banned, bannedby, logins, cookies, warn1, warn2, warn3, warn1reason, warn2reason, warn3reason, dateregisterd, kickedtimes, restorepos, slapedtimes, posx, posy, posz, posa, IP) VALUES('%s', SHA1('%s'), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '%s', 017, 0, 0, 0, 0, 'No Warn', 'No Warn', 'No Warn', '%s', 0, 0, 0, 0, 0, 0, 0, '%s')", pname, passwordstring, Bannedby, ReggedDate, IP);
mysql_query(query);
C:\Users\iMarkx\Desktop\CAS v5.0\gamemodes\CAS - Copy1.pwn(597) : error 075: input line too long (after substitutions) C:\Users\iMarkx\Desktop\CAS v5.0\gamemodes\CAS - Copy1.pwn(598) : error 037: invalid string (possibly non-terminated string) C:\Users\iMarkx\Desktop\CAS v5.0\gamemodes\CAS - Copy1.pwn(598) : error 017: undefined symbol "INSERT" C:\Users\iMarkx\Desktop\CAS v5.0\gamemodes\CAS - Copy1.pwn(598) : error 017: undefined symbol "INTO" C:\Users\iMarkx\Desktop\CAS v5.0\gamemodes\CAS - Copy1.pwn(598) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
format(query, sizeof(query),
"INSERT INTO playerdata (user, password, score, money, level, vip, kma, rank, kills, deaths, muted, jailed, frozen, mutedtimes, jailedtimes, frozentimes, banned, bannedby, logins, cookies, warn1, warn2, warn3, warn1reason, warn2reason, warn3reason, dateregisterd, kickedtimes, restorepos, slapedtimes, posx, posy, posz, posa, IP) VALUES('%s', SHA1('%s'), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '%s', 017, 0, 0, 0, 0, 'No Warn', 'No Warn', 'No Warn', '%s', 0, 0, 0, 0, 0, 0, 0, '%s')",
pname, passwordstring, Bannedby, ReggedDate, IP);
format(query, sizeof(query), "INSERT INTO playerdata (user, password, score, money, level, vip, kma, rank, kills, deaths, muted, jailed, frozen, mutedtimes, jailedtimes, frozentimes, banned, bannedby, logins,");
format(query, sizeof(query), "%s cookies, warn1, warn2, warn3, warn1reason, warn2reason, warn3reason, dateregisterd, kickedtimes, restorepos, slapedtimes, posx, posy, posz, posa, IP)", query);
format(query, sizeof(query), "%s VALUES('%s', SHA1('%s'), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '%s', 017, 0, 0, 0, 0, 'No Warn', 'No Warn', 'No Warn', '%s', 0, 0, 0, 0, 0, 0, 0, '%s')", query, pname, passwordstring, Bannedby, ReggedDate, IP);
pawn Code:
|
Format is for formating only! Use https://sampwiki.blast.hk/wiki/Strpack instead. Also he doesn't need to do that at all becouse the string isn't so long so you can just do like my first post in here.
|
format(query, sizeof(query), "INSERT INTO playerdata (user, password, score, money, level, vip, kma, rank, kills, deaths, muted, jailed, frozen, mutedtimes, jailedtimes, frozentimes, banned, bannedby, logins, cookies, warn1, warn2, warn3, warn1reason, warn2reason, warn3reason, dateregisterd, kickedtimes, restorepos, slapedtimes, posx, posy, posz, posa, IP) VALUES('%s', SHA1('%s'), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '%s', 017, 0, 0, 0, 0, 'No Warn', 'No Warn', 'No Warn', '%s', 0, 0, 0, 0, 0, 0, 0, '%s'", pname, passwordstring, Bannedby, ReggedDate, IP);
Actually, he is formatting the string.
Also, in the case you should concatenate the string, not pack it: https://sampwiki.blast.hk/wiki/Strcat |
format(query, sizeof(query),
"INSERT INTO playerdata (user, password, score, money, level, vip, kma, rank, kills, deaths, muted, jailed, \
frozen, mutedtimes, jailedtimes, frozentimes, banned, bannedby, logins, cookies, warn1, warn2, warn3, \
warn1reason, warn2reason, warn3reason, dateregisterd, kickedtimes, restorepos, slapedtimes, posx, posy, \
posz, posa, IP) VALUES('%s', SHA1('%s'), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '%s', 017, 0, 0, 0, \
0, 'No Warn', 'No Warn', 'No Warn', '%s', 0, 0, 0, 0, 0, 0, 0, '%s')",
pname, passwordstring, Bannedby, ReggedDate, IP);
mysql_query(query);
If you're still interested there's another way. Just add '\' where you go to a new line:
pawn Code:
|