03.10.2017, 16:11
so iam trieng to create another town but when i asked how someone gave me this code but it always returns the value as 0, even it is 1 in the database, so what is the problem? im using StrickenKid's MySQL Plugin - v2.1.1
Код:
new townQuery[200]; new townspawn; format(townQuery, sizeof(townQuery), "SELECT `town` FROM `playerdata` WHERE `playerName` = '%s'", playerNamee); mysql_query(townQuery), mysql_store_result(); if(mysql_num_rows() != 0) { mysql_fetch_row(townQuery); sscanf(townQuery, "i", townspawn); mysql_free_result(); } switch(townspawn) { case -1: { ShowPlayerDialog(playerid, DIALOG_TOWN, DIALOG_STYLE_LIST, "Choose Spawn Town", "San Fierro \nLas Venturas", "Choose", ""); TogglePlayerSpectating(playerid, true); } case 0: { playerData[playerid][playerTown] = SF; } case 1: { playerData[playerid][playerTown] = LV; } }