Problem for the spawn
#5

Infact it is not my code not work I explain:

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--;
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 ...

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);
    }
}
Reply


Messages In This Thread
Problem for the player's spawn (MySQL) - by TheSy - 07.06.2014, 23:08
Re: Problem for the spawn - by Dr.Einstein - 08.06.2014, 01:18
Re: Problem for the spawn - by TheSy - 08.06.2014, 01:24
Re: Problem for the spawn - by Zex Tan - 08.06.2014, 02:19
Re: Problem for the spawn - by TheSy - 08.06.2014, 02:24
Re: Problem for the spawn - by Zex Tan - 08.06.2014, 02:35
Re: Problem for the spawn - by TheSy - 08.06.2014, 11:47
Re: Problem for the spawn - by DartakousLien - 08.06.2014, 20:19

Forum Jump:


Users browsing this thread: 2 Guest(s)