Position Problem
#1

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.
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)