22.08.2016, 12:38
The code in question:
The errors I get:
I'm currently checking the code to see if there is any mistake, although I'm not sure if I have made any. Please look into this, thank you.
EDIT: Fixed, there was an unnoticed bracket in the code I somehow left out.
Player[playerid][Password] has an unnecessary bracket next to it, hence causing the error. Removing said bracket fixes the issue.
Код:
new query[256]; new playerip[16]; WP_Hash(Player[playerid][Password], 129, inputtext); GetPlayerIp(playerid, playerip, sizeof(playerip)); //the mysql_format below is where the warning shows up mysql_format(g_SQL, query, sizeof(query), "INSERT INTO `players` (`username`, `password`, `ip`, `PosX`, `PosY`, `PosZ`, `PosA`) VALUES ('%e', '%s', '%e', %f, %f, %f, %f)", Player[playerid][Name], Player[playerid][Password]), playerid, SPAWN_X, SPAWN_Y, SPAWN_Z, SPAWN_A); mysql_tquery(g_SQL, query, "OnPlayerRegister", "d", playerid);
Код:
C:\Users\Karthika\Desktop\cfiles\pawno\main.pwn(212) : warning 215: expression has no effect C:\Users\Karthika\Desktop\cfiles\pawno\main.pwn(212) : warning 215: expression has no effect C:\Users\Karthika\Desktop\cfiles\pawno\main.pwn(212) : warning 215: expression has no effect C:\Users\Karthika\Desktop\cfiles\pawno\main.pwn(212) : warning 215: expression has no effect C:\Users\Karthika\Desktop\cfiles\pawno\main.pwn(212) : warning 215: expression has no effect C:\Users\Karthika\Desktop\cfiles\pawno\main.pwn(212) : error 001: expected token: ";", but found ")" C:\Users\Karthika\Desktop\cfiles\pawno\main.pwn(212) : error 029: invalid expression, assumed zero C:\Users\Karthika\Desktop\cfiles\pawno\main.pwn(212) : warning 215: expression has no effect
EDIT: Fixed, there was an unnoticed bracket in the code I somehow left out.
Код:
mysql_format(g_SQL, query, sizeof(query), "INSERT INTO `players` (`username`, `password`, `ip`, `PosX`, `PosY`, `PosZ`, `PosA`) VALUES ('%e', '%s', '%e', %f, %f, %f, %f)", Player[playerid][Name], Player[playerid][Password]), playerid, SPAWN_X, SPAWN_Y, SPAWN_Z, SPAWN_A);