18.02.2011, 20:24
I have this on OnPlayerSpawn. There is some problem that makes the player spawn out of the world boundries.
There's no log on MySQL, it looks like the script is calling the select function.
Any help here? Please?
There's no log on MySQL, it looks like the script is calling the select function.
Any help here? Please?
pawn Код:
if(PVar[playerid][pSpawn]==0){
new string[50];
format(string, sizeof(string), "Retornando ao ponto inicial...");
GameTextForPlayer(playerid, string, 3000, 4);
SetPlayerPos(playerid,73.6155,-219.4525,1.5825);
}
else if(PVar[playerid][pSpawn]==1){
if(Playerhashouse(playerid)){
new
Str[100],
query[128],
Float:bX,
Float:bY,
Float:bZ;
format(query, sizeof(query), "SELECT `bX`,`bY`,`bZ` FROM `business` WHERE `Owner`='%s' AND type='1273'",pName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() > 0)
{
while(mysql_fetch_row(Str))
{
sscanf(Str, "p<|>fff",bX,bY,bZ);
new string[50];
format(string, sizeof(string), "Retornando a sua casa...");
GameTextForPlayer(playerid, string, 3000, 4);
SetPlayerPos(playerid,bX,bY,bZ);
}
}
mysql_free_result();
return 1;
}
else{
new string[50];
format(string, sizeof(string), "Casa nao encontrada, retornando ao ponto inicial...");
GameTextForPlayer(playerid, string, 3000, 4);
SetPlayerPos(playerid,73.6155,-219.4525,1.5825);
}
}
else if(PVar[playerid][pSpawn]==2){
if(PVar[playerid][pFaction]!=0){
new
Str[100],
query[128],
Float:fX,
Float:fY,
Float:fZ,
interior,
hqid;
format(query, sizeof(query), "SELECT `fX`,`fY`,`fZ`,`interior`,`hqid` FROM `factions` WHERE `factionid`='%d'",GetPlayerFactionid(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() > 0)
{
while(mysql_fetch_row(Str))
{
sscanf(Str, "p<|>fffdd",fX,fY,fZ,interior,hqid);
new string[50];
format(string, sizeof(string), "Retornando a sua organizacao...");
GameTextForPlayer(playerid, string, 3000, 4);
SetPlayerInterior(playerid, interior);
SetPlayerPos(playerid,fX,fY,fZ);
PVar[playerid][pInside]=hqid;
}
}
mysql_free_result();
return 1;
}
else{
new string[50];
format(string, sizeof(string), "Organizacao nao encontrada, retornando ao ponto inicial...");
GameTextForPlayer(playerid, string, 3000, 4);
SetPlayerPos(playerid,73.6155,-219.4525,1.5825);
}
}