Position Problem - 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: Position Problem (
/showthread.php?tid=88799)
Position Problem -
Byrner - 28.07.2009
I got alot of help from Jay on this code but ...
pawn Код:
format(string, 128, "Player came from %d, %d, %d", fPlayerPos[i][0], fPlayerPos[i][1], fPlayerPos[i][2]);
ircSay(EchoConnection, EchoChan,string);
SendClientMessage(a,COLOR_RED,string);
format(string, 200, "Player came to: %d, %d, %d",x,y,z);
ircSay(EchoConnection, EchoChan,string);
SendClientMessage(a,COLOR_RED,string);
The first line with the "Player came from" just shows 0,0,0 in game .. I've tried %f and %s different fails ... but fails none the less.
The function it's working off is:
pawn Код:
stock SavePlayerPos2(playerid)
{
if(!IsPlayerConnected(playerid))
return;
GetPlayerPos(playerid,
fPlayerPos[playerid][0],
fPlayerPos[playerid][1],
fPlayerPos[playerid][2]);
}
stock LoadPlayerPos(playerid, & Float:fPosX, &Float:fPosY, &Float:fPosZ)
{
fPosX = fPlayerPos[playerid][0];
fPosY = fPlayerPos[playerid][1];
fPosZ = fPlayerPos[playerid][2];
}
What I am trying to do is get the coords the player had before the ones he has now. (Previous coords).
Ok, I got that problem fixed.
Now the problem is it gives your current coords basically .. so the function is being called to soon .. it's OnPlayerUpdate.
Re: Position Problem -
James_Alex - 28.07.2009
don't use "format(string, 200, "Player came to: %d, %d, %d",x,y,z);"
use "format(string, 200, "Player came to: %f, %f, %f",x,y,z);"