26.01.2015, 18:10
Your query variable is too small.
The password alone consumes 129 characters, and your query is only 300 characters long.
Just counted in Notepad after filling in the maximum amount of data (size of password 130 chars, and 24 chars for playername, as well as 16 chars for the IP),
and it's 534 characters long, so "new Query[540];" will be enough.
Also, you're missing a comma after "TotalRobs".
Suggestion: for all fields that have the default value of 0, edit your tables so these fields have "0" as default value.
Then you don't need to add them to your query, as MySQL will fill them in automatically when you don't supply them.
Your query can thus be made alot smaller, as you would only need to supply the player's name, password and IP.
It will also be easier to find errors like this.
Instead of this:
It would become this:
All other values are 0 anyway, so just set your tables to have "0" as default value for them.
The password alone consumes 129 characters, and your query is only 300 characters long.
Just counted in Notepad after filling in the maximum amount of data (size of password 130 chars, and 24 chars for playername, as well as 16 chars for the IP),
and it's 534 characters long, so "new Query[540];" will be enough.
Also, you're missing a comma after "TotalRobs".
Suggestion: for all fields that have the default value of 0, edit your tables so these fields have "0" as default value.
Then you don't need to add them to your query, as MySQL will fill them in automatically when you don't supply them.
Your query can thus be made alot smaller, as you would only need to supply the player's name, password and IP.
It will also be easier to find errors like this.
Instead of this:
pawn Код:
"INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `VIP`, `Money`, `PosX` ,`PosY`, `PosZ`,\
`Score`, `Banned`, `Cuffed`, `Muted`, `Jailed`, `JailTime`, `Drugs`, `DrugAmount`, `Robskill`, `Hitmanskill`, `Terskill`, `TotalRobs`\
`Skin`, `Team`, `Kills`, `Deaths`) VALUES ('%e', '%s', '%s', 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", Name[playerid], pinfo[playerid][Password], IP[playerid]);
pawn Код:
"INSERT INTO `players` (`Username`, `Password`, `IP`) VALUES ('%e', '%s', '%s')", Name[playerid], pinfo[playerid][Password], IP[playerid]);