08.06.2014, 02:24
Infact it is not my code not work I explain:
Here I make a MySQL query to see if the player has a house:
And then I have a function (house_isproprio) which allows you to check the id of the house if the player is the owner or not.
So I said that if the player is not owner it will spawn in random positions in the data.
But the worry is that even if the player does not own it will spawn in the house id 0 instead of random positions ...
Here I make a MySQL query to see if the player has a house:
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--;
So I said that if the player is not owner it will spawn in random positions in the data.
But the worry is that even if the player does not own it will spawn in the house id 0 instead of random positions ...
pawn Код:
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);
}
}