Ich habe bei meinen Selfscript diesen Fehler beim /register und /login im Spiel: (ServerCommandBox)
Error in mysql_query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lkwliz`) VALUES ('Bullet', Password'', '0', '0', '0', '5000', '50000', '101', '1'' at line 1
AddPlayer:
stock addPlayerSQL(playerid, sPassword[])
{
if(!ExistPlayer(playerid))
{
new sql[2048], sql2[1024];
new sPlayerName[32];
new StartKills = 0;
new StartDeaths = 0;
new StartAdminLevel = 0;
new StartMoney = 5000;
new StartBank = 50000;
new StartSkin = 101;
new StartLevel = 1;
new StartTeam = 0;
new StartLeader = 0;
new StartMember = 0;
new StartTut = 0;
new StartSex = 0;
new StartNummer = 1000000 + random(800000);
new StartOrigin = 0;
new StartLizenz = 0;
GetPlayerName(playerid,sPlayerName,sizeof(sPlayerName));
sql = "`name` , `passwort`, `kills`, `deaths` , `adminlevel` , `money`, `bank` , `skin` , `level` , `team` , `leader` , `member`, `tut`, `sex`, `nummer`, `origin`, `autoliz`, `bikeliz`, `flugliz`, `waffenliz`, `bootliz`, `angelliz, `lkwliz`";
format(sql2, sizeof(sql2),"'%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'"
,sPlayerName, sPassword, StartKills, StartDeaths, StartAdminLevel, StartMoney, StartBank, StartSkin, StartLevel
,StartTeam, StartLeader, StartMember, StartTut, StartSex, StartNummer, StartOrigin, StartLizenz, StartLizenz, StartLizenz, StartLizenz, StartLizenz, StartLizenz, StartLizenz);
format(sql, sizeof(sql),"INSERT INTO `user` (%s) VALUES (%s);",sql, sql2);
samp_mysql_query(sql);
SendClientMessage(playerid, COLOR_GREEN, "** Dein Account wurde erfolgreich angelegt.**");
SendClientMessage(playerid, COLOR_GREEN, "** Du kannst jetzt /login [Password] nutzen!**");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Der Account ist bereits registriert");
}
}
Register:
if(strcmp(cmd, "/register", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(strlen(tmp) > 3)
{
addPlayerSQL(playerid, tmp);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Das Passwort muss länger als 3 Zeichen sein");
}
return 1;
}