Position returns 0.0 -
Lorenc_ - 30.10.2011
Hello everyone, continuing to my system, I'm trying to fix a weird glitch that appeared however, I'm clueless to how this occurs.
pawn Код:
gSomeEnum[ID][E_POSX] // FLOAT OF COURSE.
Now unformat (from sscanf2) will unformat a string inside a file and read the values. It'll then set the value of "E_POSX" to it. This works <<<<<
Will print out:
After I go to OnPlayerSpawn and type
pawn Код:
SetPlayerPos(playerid, gSomeEnum[ID][E_POSX], ..., ...);
and
pawn Код:
printf("%f", gSomeEnum[ID][E_POSX]):
it will take me to 0.0, 0.0, 0.0 and also! prints "0.0" or would say, Stay within the boundaries! and freeze my screen / overlay crap.
Something in my script is doing it wrongly, i'm not sure.
Does anyone have a clue to what this can be caused from? Thanks!
Re: Position returns 0.0 - Max_Coldheart - 30.10.2011
If you're using the SA-MP 0.3d, that might cause it
Re: Position returns 0.0 -
Lorenc_ - 30.10.2011
Quote:
Originally Posted by Max_Coldheart
If you're using the SA-MP 0.3d, that might cause it 
|
Of course I am though, it seemed to work fine before.
Re: Position returns 0.0 -
Vince - 30.10.2011
I thought only the "u" parameter was broke in 0.3d? @OP: Do you use the "e" (enum) specifier to read the data?
Re: Position returns 0.0 -
wups - 30.10.2011
Make sure the data isn't reset elsewhere. + It could be [ID] mix-up.
Show us your sscanf line.
EDIT: To the poster below: We know. There were threads about that.
Anyways try setting the pos instantly after loading the data.
Re: Position returns 0.0 - Max_Coldheart - 30.10.2011
Quote:
Originally Posted by Vince
I thought only the "u" parameter was broke in 0.3d? @OP: Do you use the "e" (enum) specifier to read the data?
|
Are you sure that only "u" is broken? Maybe unformatting might be broken too, who knows.
Re: Position returns 0.0 -
Lorenc_ - 30.10.2011
Quote:
Originally Posted by Vince
I thought only the "u" parameter was broke in 0.3d? @OP: Do you use the "e" (enum) specifier to read the data?
|
Nah, mines different. Doesn't contain a single letter with "u"
EDIT: It's got nothing to do with sscanf FFS.
Something inside the ENUM is making it like this.
Re: Position returns 0.0 -
Kyle - 30.10.2011
Unsure, try printing it out several times throughout the script to find out where it changes.
Edit: Change all of the id floats and set a different ID per one and then you can see if the ids are mixed up.
Re: Position returns 0.0 -
Lorenc_ - 30.10.2011
Quote:
Originally Posted by KyleSmith
Unsure, try printing it out several times throughout the script to find out where it changes.
Edit: Change all of the id floats and set a different ID per one and then you can see if the ids are mixed up.
|
Completely all of them are set to 0.0..
I'll try re-write the system
Re: Position returns 0.0 -
Kyle - 30.10.2011
Quote:
Originally Posted by Lorenc_
Completely all of them are set to 0.0..
I'll try re-write the system
|
Yes, the reason why it is probably printing 0.00 is because it's using the wrong id, Like I said set all the others to some random number then you can check if they are getting mixed up.