Dini to Y_INI
#3

Код:
stock CreateNewHouse(h,Float:x,Float:y,Float:z)
{
    new hf[64];
    format(hf,sizeof(hf),"Houses/Casa%d.txt",h);
    if (fexist(hf)) {//if the file exists open it
    new INI:file = INI_Open(hf);
    // [...]
    // your code here, use INI_WriteInt, INI_WriteString, INI_WriteFloat, INI_WriteHex, INI_WriteBool and etc.
    
    // u write everything? ok, close it.
    INI_Close (file);
    }
// etc. etc. etc.
If you read the wiki page you can use this check too (to see if the file has been open correctly)

Change
Код:
    if (fexist(hf)) {//if the file exists open it
    new INI:file = INI_Open(hf);
to
Код:
new INI:file = INI_Open(hf);
if (file != INI_NO_FILE) 
{
// [...]
}
This will help you: https://sampwiki.blast.hk/wiki/YSI:INI
Reply


Messages In This Thread
Dini to Y_INI - by MadafakaPro - 07.04.2013, 17:35
Re: Dini to Y_INI - by HurtLocker - 07.04.2013, 18:17
Re: Dini to Y_INI - by ReVo_ - 07.04.2013, 19:55

Forum Jump:


Users browsing this thread: 3 Guest(s)