LoadPos PROBLEM ?
#1

ALL SOLVED
Reply
#2

Okay there's some syntax errors here in your code, first of all this:

pawn Код:
dini_IntSet(file,"posx", PlayerInfo[playerid][posx]= x);
dini_IntSet(file,"posy", PlayerInfo[playerid][posy]= y);
dini_IntSet(file,"posz", PlayerInfo[playerid][posz]= z);
I don't know what you're trying to do here, but I suggest doing this:

pawn Код:
PlayerInfo[playerid][posx] = x;
PlayerInfo[playerid][posy] = y;
PlayerInfo[playerid][posz] = z;

dini_FloatSet(file,"posx", PlayerInfo[playerid][posx]);
dini_FloatSet(file,"posy", PlayerInfo[playerid][posy]);
dini_FloatSet(file,"posz", PlayerInfo[playerid][posz]);
You should also be using FloatSet instead of IntSet, as otherwise it won't record it properly.

Next is here:

pawn Код:
PlayerInfo[playerid][posx] == x;
PlayerInfo[playerid][posx] == y;
PlayerInfo[playerid][posx] == z;
== is a check operator it means to check if something is equal to something, it is not used in assigning a value to a variable.

= is used in assigning a value to a variable, so therefore the correct code is:

pawn Код:
PlayerInfo[playerid][posx] = x;
PlayerInfo[playerid][posx] = y;
PlayerInfo[playerid][posx] = z;
I recommend you take another read through the Pawn manual, assuming you already have, and make sure you're aware of the Pawn syntax
Reply
#3

Hmm, it's weird that you even can save it because Players position is defined with Floats that means that a decimal number so you can't save it with "dini_IntSet" you should use "dini_FloatSet(file,"posx", PlayerInfo[playerid][posx]);" and so on... and when you load it you should use "dini_Float(file, "posx");"

Edit: Anyways, you got your answer explained perfectly by JaTochNietDan
Reply
#4

use this instead

pawn Код:
new float:LogX,float:LogY,float:LogZ;
GetPlayerPos(playerid, LogX,LogY,LogZ);
PlayerInfo[playerid][logpositionX] = LogX;
PlayerInfo[playerid][logpositionX] = Log,Y;
PlayerInfo[playerid][logpositionX] = LogZ;


if(!PlayerInfo[playerid][logposition]= 0)
{
  new LogX = PlayerInfo[playerid][logpositionX];
  new LogY = PlayerInfo[playerid][logpositionY];
  new LogZ = PlayerInfo[playerid][logpositionZ];
  SetPlayerPost(playerid,LogX,LogY,LogZ);
}
Reply
#5

Thanks alot i learned a new thing today
But only a few WARNINGS if u could help me out ?
pawn Код:
warning 213: tag mismatch
warning 213: tag mismatch
warning 213: tag mismatch
Error in this LINE
pawn Код:
PlayerInfo[playerid][posx] = x;
PlayerInfo[playerid][posx] = y;
PlayerInfo[playerid][posx] = z;
Reply
#6

You need to use this:
pawn Код:
x = PlayerInfo[playerid][posx];
y = PlayerInfo[playerid][posx];
z = PlayerInfo[playerid][posx];
Because you are giving the x,y and z value and you can't give a value to "PlayerInfo[playerid][posx]" 'cause x is not an float nor int so...Try it should be right.
Reply
#7

Quote:
Originally Posted by Alex_Valde
Посмотреть сообщение
You need to use this:
pawn Код:
x = PlayerInfo[playerid][posx];
y = PlayerInfo[playerid][posx];
z = PlayerInfo[playerid][posx];
Because you are giving the x,y and z value and you can't give a value to "PlayerInfo[playerid][posx]" 'cause x is not an float nor int so...Try it should be right.
And Thanks again Worked )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)