Szerző Téma: Sor törés probléma  (Megtekintve 1247 alkalommal)

Sor törés probléma
« Dátum: 2014. november 20. - 14:03:22 »
0 Show voters
Sziasztok!
Valaki megtudná mondani hogy miért ír erre hosszú sor hibát?
Pedig tettem bele sor töréseket.
 
new query[2000];
mysql_format(mysql_kapcs, query, 384, \"UPDATE users SET Money=\'%d\',Score=\'%d\',Kills=\'%d\',Deaths=\'%d\',HomeWeapons=\'%d\',Wanted=\'%d\',Level=\'%d\',\\
Weapon1=\'%d\',Weapon1a=\'%d\',Weapon2=\'%d\',Weapon2a=\'%d\',Weapon3=\'%d\',Weapon3a=\'%d\',Weapon4=\'%d\',Weapon4a=\'%d\',Weapon5=\'%d\',Weapon5a=\'%d\',\\
Weapon6=\'%d\',Weapon6a=\'%d\',Weapon7=\'%d\',Weapon7a=\'%d\',Weapon8=\'%d\',Weapon8a=\'%d\',Weapon9=\'%d\',Weapon9a=\'%d\',Weapon10=\'%d\',Weapon10a=\'%d\',\\
Weapon11=\'%d\',Weapon11a=\'%d\',Weapon12=\'%d\',Weapon12a=\'%d\' WHERE Name=\'%s\'\", Money[playerid], Score[playerid], Kills[playerid], Deaths[playerid],\\
HomeWeapons[playerid], Wanted[playerid], Level[playerid], Weapon1[playerid], Weapon1a[playerid], Weapon2[playerid], Weapon2a[playerid],\\
Weapon3[playerid], Weapon3a[playerid], Weapon4[playerid], Weapon4a[playerid], Weapon5[playerid], Weapon5a[playerid], Weapon6[playerid],\\
Weapon6a[playerid], Weapon7[playerid], Weapon7a[playerid], Weapon8[playerid], Weapon8a[playerid], Weapon9[playerid], Weapon9a[playerid],\\
Weapon10[playerid], Weapon10a[playerid], Weapon11[playerid], Weapon11a[playerid], Weapon12[playerid], Weapon12a[playerid], GetName(playerid));
mysql_tquery(mysql_kapcs, query);

 
Errorok:
 

(150) : error 075: input line too long (after substitutions)
(151 -- 155) : error 075: input line too long (after substitutions)
(157) : warning 217: loose indentation
(157) : error 029: invalid expression, assumed zero
(157) : error 029: invalid expression, assumed zero
(157) : warning 215: expression has no effect
(157) : error 001: expected token: \";\", but found \"]\"
(157) : fatal error 107: too many error messages on one line
« Utoljára szerkesztve: 2014. november 20. - 18:39:58 írta Castle »

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Sor törés probléma
« Válasz #1 Dátum: 2014. november 20. - 15:24:28 »
0 Show voters
Így?
 
    mysql_format(mysql_kapcs, query, 384, \"UPDATE users SET Money=\'%d\',Score=\'%d\',Kills=\'%d\',Deaths=\'%d\',HomeWeapons=\'%d\',Wanted=\'%d\',Level=\'%d\', \\
    Weapon1=\'%d\',Weapon1a=\'%d\',Weapon2=\'%d\',Weapon2a=\'%d\',Weapon3=\'%d\',Weapon3a=\'%d\',Weapon4=\'%d\',Weapon4a=\'%d\',Weapon5=\'%d\',Weapon5a=\'%d\',\\
    Weapon6=\'%d\',Weapon6a=\'%d\',Weapon7=\'%d\',Weapon7a=\'%d\',Weapon8=\'%d\',Weapon8a=\'%d\',Weapon9=\'%d\',Weapon9a=\'%d\',Weapon10=\'%d\',Weapon10a=\'%d\',\\
    Weapon11=\'%d\',Weapon11a=\'%d\',Weapon12=\'%d\',Weapon12a=\'%d\' WHERE Name=\'%s\'\", Money[playerid], Score[playerid], Kills[playerid], Deaths[playerid]
    HomeWeapons[playerid], Wanted[playerid], Level[playerid], Weapon1[playerid], Weapon1a[playerid], Weapon2[playerid], Weapon2a[playerid],
    Weapon3[playerid], Weapon3a[playerid], Weapon4[playerid], Weapon4a[playerid], Weapon5[playerid], Weapon5a[playerid], Weapon6[playerid],
    Weapon6a[playerid], Weapon7[playerid], Weapon7a[playerid], Weapon8[playerid], Weapon8a[playerid], Weapon9[playerid], Weapon9a[playerid],
    Weapon10[playerid], Weapon10a[playerid], Weapon11[playerid], Weapon11a[playerid], Weapon12[playerid], Weapon12a[playerid], GetName(playerid));
    mysql_tquery(mysql_kapcs, query);

Sor törés probléma
« Válasz #2 Dátum: 2014. november 20. - 16:35:14 »
0 Show voters
Mostmár csak ezt a hibát kapom:
 
(150) : error 075: input line too long (after substitutions)

 
Sor:
 
Weapon5=\'%d\',Weapon5a=\'%d\',Weapon6=\'%d\',Weapon6a=\'%d\',Weapon7=\'%d\',Weapon7a=\'%d\',Weapon8=\'%d\',Weapon8a=\'%d\',Weapon9=\'%d\',Weapon9a=\'%d\',\\
« Utoljára szerkesztve: 2014. november 20. - 18:39:41 írta Castle »

Sor törés probléma
« Válasz #3 Dátum: 2014. november 20. - 22:12:03 »
0 Show voters

Sor törés probléma
« Válasz #4 Dátum: 2014. november 21. - 06:54:12 »
0 Show voters
Azzal valamiért nem jó.
Amikor menteni készül lefagy a szerver...
Így csináltam:
 
new query[1000];
new save1[1000] = \"UPDATE users SET Money=\'%d\',Score=\'%d\',Kills=\'%d\',Deaths=\'%d\',HomeWeapons=\'%d\',\\
Wanted=\'%d\',Level=\'%d\',IP=\'%s\',LastOnline=\'%02d.%02d.%02d %02d:%02d:%02d\'\";
new save2[1000] = \"Weapon1=\'%d\',Weapon1a=\'%d\',Weapon2=\'%d\',Weapon2a=\'%d\',\\
Weapon3=\'%d\',Weapon3a=\'%d\',Weapon4=\'%d\',Weapon4a=\'%d\',Weapon5=\'%d\',Weapon5a=\'%d\',Weapon6=\'%d\',Weapon6a=\'%d\',Weapon7=\'%d\',\\
Weapon7a=\'%d\',Weapon8=\'%d\',Weapon8a=\'%d\',Weapon9=\'%d\',Weapon9a=\'%d\',Weapon10=\'%d\',Weapon10a=\'%d\',Weapon11=\'%d\',Weapon11a=\'%d\',\\
Weapon12=\'%d\',Weapon12a=\'%d\' WHERE Name=\'%s\'\";
strcat(save1, save2, sizeof(save1) + sizeof(save2));
mysql_format(mysql_kapcs, query, sizeof(query), save1, Money[playerid], Score[playerid], Kills[playerid], Deaths[playerid],HomeWeapons[playerid],
Wanted[playerid], Level[playerid], IP[playerid], year, month, day, hour, minute, second, Weapon1[playerid], Weapon1a[playerid], Weapon2[playerid], Weapon2a[playerid], Weapon3[playerid],
Weapon3a[playerid], Weapon4[playerid], Weapon4a[playerid], Weapon5[playerid], Weapon5a[playerid], Weapon6[playerid],
Weapon6a[playerid], Weapon7[playerid], Weapon7a[playerid], Weapon8[playerid], Weapon8a[playerid], Weapon9[playerid],
Weapon9a[playerid],Weapon10[playerid], Weapon10a[playerid], Weapon11[playerid], Weapon11a[playerid], Weapon12[playerid],
Weapon12a[playerid], GetName(playerid));
mysql_tquery(mysql_kapcs, query);
« Utoljára szerkesztve: 2014. november 21. - 18:20:07 írta Castle »

Nem elérhető Dfoglalo

  • 4069
  • Globális Moderátor
    • Profil megtekintése
Sor törés probléma
« Válasz #5 Dátum: 2014. november 28. - 19:13:23 »
0 Show voters
[gmod]Megkérem a kedves témanyitót, hogy ne hanyagolja el a témáját! Ha már elavult a probléma, zárja a témát, ha pedig nem, jelezzen vissza 24 órán belül egy hozzászólás formájában.[/gmod]

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Sor törés probléma
« Válasz #6 Dátum: 2014. november 30. - 22:45:47 »
0 Show voters
Csináltam egy teszt scriptet az errorod miatt és kivettem belőle a vessző utáni változóval létrehozott lekérdezéseket.
 
#include a_samp
#include a_mysql
#include zcmd
new mysql_kapcs;
new query[2048];
CMD:asd(playerid) {
    format(query, sizeof(query),
\"UPDATE users SET Money=\'%d\',Score=\'%d\',Kills=\'%d\',Deaths=\'%d\',HomeWeapons=\'%d\',Wanted=\'%d\',Level=\'%d\',\\
    Weapon1=\'%d\',Weapon1a=\'%d\',Weapon2=\'%d\',Weapon2a=\'%d\',Weapon3=\'%d\',Weapon3a=\'%d\',Weapon4=\'%d\',Weapon4a=\'%d\',Weapon5=\'%d\',Weapon5a=\'%d\',\\
    Weapon6=\'%d\',Weapon6a=\'%d\',Weapon7=\'%d\',Weapon7a=\'%d\',Weapon8=\'%d\',Weapon8a=\'%d\',Weapon9=\'%d\',Weapon9a=\'%d\',Weapon10=\'%d\',Weapon10a=\'%d\',\\
    Weapon11=\'%d\',Weapon11a=\'%d\',Weapon12=\'%d\',Weapon12a=\'%d\' WHERE Name=\'%s\'\");
    mysql_tquery(mysql_kapcs, query);
return 1;
}

 
Annyi hogy írd vissza a lekérdezéseket azaz ezeket:
 
Money[playerid], Score[playerid], Kills[playerid], Deaths[playerid]
    HomeWeapons[playerid], Wanted[playerid], Level[playerid], Weapon1[playerid], Weapon1a[playerid], Weapon2[playerid], Weapon2a[playerid],
    Weapon3[playerid], Weapon3a[playerid], Weapon4[playerid], Weapon4a[playerid], Weapon5[playerid], Weapon5a[playerid], Weapon6[playerid],
    Weapon6a[playerid], Weapon7[playerid], Weapon7a[playerid], Weapon8[playerid], Weapon8a[playerid], Weapon9[playerid], Weapon9a[playerid],
    Weapon10[playerid], Weapon10a[playerid], Weapon11[playerid], Weapon11a[playerid], Weapon12[playerid], Weapon12a[playerid], GetName(playerid)

 
Ha meg így se jó, írok neked egy 100%-os megoldást.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal