SA-MP Forums Archive
position. :/ - 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. :/ (/showthread.php?tid=230986)



position. :/ - Gh0sT_ - 24.02.2011

ok, so my position saving/loading is fucked up ;S ok, so when I log off server saves my pos fine, but when I log on my position is not like server saved, but 0.0... ;SS


Saving:

pawn Код:
.. another things
    new
        Float: Pozicija[ 3 ]
    ;
    GetPlayerPos( playerid, Pozicija[ 0 ], Pozicija[ 1 ], Pozicija[ 2 ] );
    INI_WriteFloat( Saskaita, "POZICIJA.X", Pozicija[ 0 ] );
    INI_WriteFloat( Saskaita, "POZICIJA.Y", Pozicija[ 1 ] );
    INI_WriteFloat( Saskaita, "POZICIJA.Z", Pozicija[ 2 ] );
   
    INI_Close( Saskaita );
Loading:

pawn Код:
...other things
    if( !strcmp( vardas, "POZICIJA.X", true ) ) SetPVarFloat( playerid, "psX", floatstr( nustatymas ) );
    if( !strcmp( vardas, "POZICIJA.Y", true ) ) SetPVarFloat( playerid, "psY", floatstr( nustatymas ) );
    if( !strcmp( vardas, "POZICIJA.Z", true ) ) SetPVarFloat( playerid, "psZ", floatstr( nustatymas ) );
    SetPlayerPos( playerid, GetPVarFloat( playerid, "psX" ), GetPVarFloat( playerid, "psY" ), GetPVarFloat( playerid, "psZ" ) );
         ... other things



Re: position. :/ - maramizo - 24.02.2011

Use Y_INI.