08.06.2014, 20:19
pawn Код:
new requete[256], rowl[128];
format(requete, sizeof(requete), "SELECT id FROM srp_players_houses WHERE owner='%s'", pName[playerid]);
MySQLCheckConnection();
mysql_query(requete);
mysql_store_result();
if(mysql_fetch_row(rowl))
{
//spawn in the house using - strval(rowl)
}
else
{
switch(random(2))
{
case 0: SetPlayerPos(playerid, 1742.7836, -1860.1030, 13.5791), SetInterior(playerid, 0);
case 1: SetPlayerPos(playerid, 837.7275, -1341.4581, 7.1719), SetInterior(playerid, 0);
}
}
printf("houseid - %d - name_player %s",strval(rowl), pName[playerid]); //this is just a debug to see what mysql gets
//if he is getting the same value has in database, i don't know where is the error
//but if doesn't get the same value, the problem is here obviously
mysql_free_result();