01.10.2017, 08:15
so i tried to select an integer from a column called town from a table called playerData, if it is 0, it spawns you at SF, if its 1 it spawns you at LV, if its -1, it asks you for a location to spawn.
So i created a variable called townspawn to select from the table the value, but it always select the value as 1, even it is 0 at the column, so what is the problem in the code?
So i created a variable called townspawn to select from the table the value, but it always select the value as 1, even it is 0 at the column, so what is the problem in the code?
Код:
new townQuery[200]; new townspawn = format(townQuery, sizeof(townQuery), "SELECT `town` FROM `playerdata` WHERE `playerName` = '%s'", playerNamee); if(townspawn == -1) { ShowPlayerDialog(playerid, DIALOG_TOWN, DIALOG_STYLE_LIST, "Choose Spawn Town", "San Fierro \nLas Venturas", "Choose", ""); TogglePlayerSpectating(playerid, true); return 1; } else if(townspawn == 0) { playerData[playerid][playerTown] = SF; } else if(townspawn == 1) { playerData[playerid][playerTown] = LV; }