SA-MP Forums Archive
Help with setplayerpos problem please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with setplayerpos problem please (/showthread.php?tid=226850)



Help with setplayerpos problem please - kariok - 16.02.2011

Код:
CMD:entrar(playerid)
{
new
	Str[256],
	type,
	Float:bX,
	Float:bY,
	Float:bZ,
	Owner[128],
	Desc[128],
	Payout,
	Price,
	iX,
	iY,
	iZ,
	iA,
	interior,
	vw,
	fee,
	bank,
	bought;

mysql_query("SELECT * FROM `business`");
mysql_store_result();
if(mysql_num_rows() > 0)
{
        while(mysql_fetch_row(Str))
        {
	        sscanf(Str, "p<|>dfffs[128]s[128]ddffffddddd", type,bX, bY, bZ, Owner, Desc, Payout, Price, iX,iY,iZ,iA,interior,vw,fee,bank,bought);
	        if(IsPlayerInRangeOfPoint(playerid,1, bX,bY,bZ)==1){
         	new string[128];
         	format(string, sizeof(string), "type: %d dono: %s iX: %f iY: %f iZ:%f", type, Owner, iX,iY,iZ);
         	SendClientMessage(playerid, COLOR_GREY, string);
			SendClientMessage(playerid, COLOR_GREY, "[INFO]: Vocк entrou em uma empresa.");
			SetPlayerPos(playerid, iX,iY,iZ);
			SetPlayerFacingAngle(playerid, iA);
			printf("%s: /entrar para X:%f Y:%f Z:%f", pName(playerid),iX,iY,iZ  );
			return 1;
			}
		}
}
mysql_free_result();
return 1;
}
The printf returned me:
Quote:

[11:42:52] Lucca_Xavier: /entrar para X:246.783996 Y:63.900199 Z:1003.640014

But my player gets tped to a place out of the world boundries, what do is happening?


Re: Help with setplayerpos problem please - kariok - 16.02.2011

Can someone help me? Please? I have no idea of what's wrong


Re: Help with setplayerpos problem please - CyNiC - 17.02.2011

Maybe because the variables ix, iy, and yz, does not have float tags.


Re: Help with setplayerpos problem please - kariok - 17.02.2011

Well, thanks a lot, sometimes we are so into the script that we forget simple tags.

It worked.