07.06.2014, 23:08
(
Последний раз редактировалось TheSy; 08.06.2014 в 00:26.
)
Good evening.
So I have problems with my code:
So when I make the player spawn a query as to whether a housing.
I have a function that shows whether a player has a housing (But the application allows you to find the id of the house).
So I coded if the player has no home he spawn at different spawn (With random).
The trouble is that it does not work, the player still spawn id house to 0 when it should spawn to random coordinates imposed (I think this is the SQL query).
Thanks for your help !!
So I have problems with my code:
So when I make the player spawn a query as to whether a housing.
I have a function that shows whether a player has a housing (But the application allows you to find the id of the house).
So I coded if the player has no home he spawn at different spawn (With random).
The trouble is that it does not work, the player still spawn id house to 0 when it should spawn to random coordinates imposed (I think this is the SQL query).
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();
mysql_fetch_row(rowl);
new idbiz = strval(rowl);
mysql_free_result();
idbiz--;
if(!house_isProprio(playerid, idbiz))
{
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);
}
}