Loading positions with y_ini
#1

If I did this somewhere

PHP Code:
new INI:ini INI_Open("Locations/loco.ini");
                      
INI_SetTag(ini"The Location");
                    
INI_WriteFloat(ini"XPOS"x);
                    
INI_WriteFloat(ini"YPOS"y);
                    
INI_WriteFloat(ini"ZPOS"z);
                    
INI_Close(ini); 
How can I now retrieve these floats somewhere in the script? (loading them from the file)
Reply
#2

Anyone?
Reply
#3

INI_ParseFile? You're lucky that y_ini has one of the most detailed guides, so take advantage of that and look at the y_ini thread. It tells you everything you need to know.
Reply
#4

Quote:
Originally Posted by Threshold
View Post
INI_ParseFile? You're lucky that y_ini has one of the most detailed guides, so take advantage of that and look at the y_ini thread. It tells you everything you need to know.
Could you give me an example? I've read the wiki page but can't seem to understand it
Reply
#5

Wiki page?

https://sampforum.blast.hk/showthread.php?tid=570957
Reply
#6

PHP Code:

#include <a_samp>

#include <YSI\y_ini>
#include <YSI\y_inline>

new Float:x1Float:y1Float:z1;

main()
{
    
inline loadpos(string:name[], string:value[])
    {
        
INI_Float("XPOS"x1);
        
INI_Float("YPOS"y1);
        
INI_Float("ZPOS"z1);
    }
    
INI_ParseFile("Locations/loco.ini""loadpos");
    
    
SetTimerEx("printff"1000false"");
    return 
true;
}

forward printff();
    public 
printff()
        
printf("pos: x: %f | y: %f | z: %f"x1y1z1); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)