SA-MP Forums Archive
Resets on Loading - 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)
+--- Thread: Resets on Loading (/showthread.php?tid=550253)



Resets on Loading - Dziugsas - 11.12.2014

Hello guys! I have a problem :/

I made simple entrance system ,but now when the system saves an entrance :

Код:
Name = Ligonine
Interior = 3
VirtualWorld = 1
DarboPradzia = 0
DarboPabaiga = 24
EnterX = 1607.177978
EnterY = 1817.166625
EnterZ = 10.820300
ExitX = -204.505996
ExitY = -1736.048583
ExitZ = 675.768676
It sets the Exit cordinates to zero :

pawn Код:
forward LoadEntrances(e, name[], value[]);
public LoadEntrances(e, name[], value[])
{
    INI_String("Name", eInfo[e][Name],75);
    INI_Int("Interior", eInfo[e][Settings][0]);
    INI_Int("VirtualWorld", eInfo[e][Settings][1]);
    INI_Int("DarboPradzia", eInfo[e][EnterHours][0]);
    INI_Int("DarboPabaiga", eInfo[e][EnterHours][1]);
    INI_Float("EnterX", eInfo[e][enterPos][0]);
    INI_Float("EnterY", eInfo[e][enterPos][1]);
    INI_Float("EnterZ", eInfo[e][enterPos][2]);
    INI_Float("ExitY", eInfo[e][exitPos][0]);
    INI_Float("ExitY", eInfo[e][exitPos][1]);
    INI_Float("ExitZ", eInfo[e][exitPos][2]);
   
    new String[108];
    format( String, 108, "%s\nSpauskite [ENTER]", eInfo[e][Name]);
    eInfo[e][EntrancesText] = CreateDynamic3DTextLabel(String, CHATCOLOR_RED, eInfo[e][enterPos][0], eInfo[e][enterPos][1], eInfo[e][enterPos][2], 20.0, -1, -1, 0,-1, -1 , -1, 100);
    eInfo[e][ExitText] = CreateDynamic3DTextLabel(String, CHATCOLOR_RED, eInfo[e][exitPos][0], eInfo[e][exitPos][1], eInfo[e][exitPos][2], 20.0, -1, -1, 0,  eInfo[e][Settings][1], eInfo[e][Settings][0], -1, 100);
    printf("%f",eInfo[e][enterPos][0]);
    printf("%f",eInfo[e][enterPos][1]);
    printf("%f",eInfo[e][enterPos][2]);
    printf("%f",eInfo[e][exitPos][0]);
    printf("%f",eInfo[e][exitPos][1]);
    printf("%f",eInfo[e][exitPos][2]);
    return 1;
}
Код:
[22:24:19] 1607.177978
[22:24:19] 1817.166625
[22:24:19] 10.820300
[22:24:19] 0.000000
[22:24:19] 0.000000
[22:24:19] 0.000000
Whats wrong?


Re: Resets on Loading - Dziugsas - 12.12.2014

No one knows?


Re: Resets on Loading - Raweresh - 12.12.2014

Show how you save that coordinates. Also look in file how this coordinates are saved.
Код:
    INI_Float("ExitY", eInfo[e][exitPos][0]);
    INI_Float("ExitY", eInfo[e][exitPos][1]);
    INI_Float("ExitZ", eInfo[e][exitPos][2]);
You have ExitY twice.
Код:
    INI_Float("ExitX", eInfo[e][exitPos][0]);
    INI_Float("ExitY", eInfo[e][exitPos][1]);
    INI_Float("ExitZ", eInfo[e][exitPos][2]);



Re: Resets on Loading - Dziugsas - 12.12.2014

pawn Код:
stock SaveEntrances(entranceid)
{
    new eFile[28];
    format(eFile,28,"Pastatai/%d.ini",entranceid);
    new INI:File = INI_Open(eFile);
    INI_WriteString(File, "Name", eInfo[entranceid][Name]);
    INI_WriteInt(File, "Interior", eInfo[entranceid][Settings][0]);
    INI_WriteInt(File, "VirtualWorld", eInfo[entranceid][Settings][1]);
    INI_WriteInt(File, "DarboPradzia", eInfo[entranceid][EnterHours][0]);
    INI_WriteInt(File, "DarboPabaiga", eInfo[entranceid][EnterHours][1]);
    INI_WriteFloat(File, "EnterX", eInfo[entranceid][enterPos][0]);
    INI_WriteFloat(File, "EnterY", eInfo[entranceid][enterPos][1]);
    INI_WriteFloat(File, "EnterZ", eInfo[entranceid][enterPos][2]);
    INI_WriteFloat(File, "ExitX", eInfo[entranceid][exitPos][0]);
    INI_WriteFloat(File, "ExitY", eInfo[entranceid][exitPos][1]);
    INI_WriteFloat(File, "ExitZ", eInfo[entranceid][exitPos][2]);
    INI_Close(File );
    return 1;
}
Saving is okay , buy it doesnt load especially the exit cords...


Re: Resets on Loading - Dziugsas - 12.12.2014

Fixed the problem ,but now again 3D text label is not showed :

pawn Код:
forward LoadEntrances(e, name[], value[]);
public LoadEntrances(e, name[], value[])
{
    INI_String("Name", eInfo[e][Name],75);
    INI_Int("Interior", eInfo[e][Settings][0]);
    INI_Int("VirtualWorld", eInfo[e][Settings][1]);
    INI_Int("DarboPradzia", eInfo[e][EnterHours][0]);
    INI_Int("DarboPabaiga", eInfo[e][EnterHours][1]);
    INI_Float("EnterX", eInfo[e][enterPos][0]);
    INI_Float("EnterY", eInfo[e][enterPos][1]);
    INI_Float("EnterZ", eInfo[e][enterPos][2]);
    INI_Float("ExitX", eInfo[e][exitPos][0]);
    INI_Float("ExitY", eInfo[e][exitPos][1]);
    INI_Float("ExitZ", eInfo[e][exitPos][2]);

    new String[108];
    format( String, 108, "%s\nSpauskite [ENTER]", eInfo[e][Name]);
    eInfo[e][EntrancesText] = CreateDynamic3DTextLabel(String, CHATCOLOR_RED, eInfo[e][enterPos][0], eInfo[e][enterPos][1], eInfo[e][enterPos][2], 20.0, -1, -1, 0,-1, -1 , -1, 100);
    eInfo[e][ExitText] = CreateDynamic3DTextLabel(String, CHATCOLOR_RED, eInfo[e][exitPos][0], eInfo[e][exitPos][1], eInfo[e][exitPos][2], 20.0, -1, -1, 0,  eInfo[e][Settings][1], eInfo[e][Settings][0], -1, 100);
    printf("%f",eInfo[e][enterPos][0]);
    printf("%f",eInfo[e][enterPos][1]);
    printf("%f",eInfo[e][enterPos][2]);
    printf("%f",eInfo[e][exitPos][0]);
    printf("%f",eInfo[e][exitPos][1]);
    printf("%f",eInfo[e][exitPos][2]);
    return 1;
}



Re: Resets on Loading - Threshold - 12.12.2014

pawn Код:
new String[108];
    format( String, sizeof(String), "%s\nSpauskite [ENTER]", eInfo[e][Name]);
    eInfo[e][EntrancesText] = CreateDynamic3DTextLabel(String, CHATCOLOR_RED, eInfo[e][enterPos][0], eInfo[e][enterPos][1], eInfo[e][enterPos][2], 20.0);
    eInfo[e][ExitText] = CreateDynamic3DTextLabel(String, CHATCOLOR_RED, eInfo[e][exitPos][0], eInfo[e][exitPos][1], eInfo[e][exitPos][2], 20.0, .worldid = eInfo[e][Settings][1], .interiorid = eInfo[e][Settings][0]);
Again, there's nothing wrong with the code. The problem is either in the color or in the location of the label.


Re: Resets on Loading - Dziugsas - 12.12.2014

You cant make anything in parsefile function , you can only load.I putted in the loop onGameModeInit and it works.Thanks.