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



Function problem - woaha - 19.06.2011

OK, I got problem with this y_ini based loading function wich acts weird.. and it doesnt work at all.

So I need help with this. What I can do that this following LoadAllJails() function fills all those celInfo arrays, because now when I am calling those arrays they are all 0.000000....

pawn Код:
#define MAX_JAILS 5 // Max jails
enum cellInfo
{
    jalid,
    jobject,
    Float:cX,
    Float:cY,
    Float:cZ,
    jairange,
    Float:dooropenX,
    Float:dooropenY,
    Float:dooropenZ,
    Float:doorcloseX,
    Float:doorcloseY,
    Float:doorcloseZ,
    jailarea[65],
    jailint,
    jailobj
};

new celInfo[MAX_JAILS][cellInfo],loaded_jails = 0;

forward LoadCells(jailid, name[], value[]);
----

ongamemodeinit
LoadAllJails();

----

//----------------------------------------------------------

public LoadCells(jailid, name[], value[])
{
    print("PARSING START");
    INI_Int("jalid",celInfo[jailid][jalid]);
    print("JALID");
    INI_Int("jobject",celInfo[jailid][jobject]);
    INI_Float("cX",celInfo[jailid][cX]);
    INI_Float("cY",celInfo[jailid][cY]);
    INI_Float("cZ",celInfo[jailid][cZ]);
    INI_Int("jairange",celInfo[jailid][jairange]);
    INI_Float("dooropenX",celInfo[jailid][dooropenX]);
    INI_Float("dooropenY",celInfo[jailid][dooropenY]);
    print("DOORY");
    INI_Float("dooropenZ",celInfo[jailid][dooropenZ]);
    INI_Float("doorcloseX",celInfo[jailid][doorcloseX]);
    INI_Float("doorcloseY",celInfo[jailid][doorcloseY]);
    INI_Float("doorcloseZ",celInfo[jailid][doorcloseZ]);
    INI_String("jailarea",celInfo[jailid][jailarea],128);
    print("JAIL AREA");
    INI_Int("jailint",celInfo[jailid][jailint]);
    new formaatti[225];
    format(formaatti,sizeof(formaatti),"X %f Y %f Z %f  ID %i", celInfo[jailid][cX],celInfo[jailid][cY], celInfo[jailid][cZ], celInfo[jailid][jalid]);
    printf(formaatti);
    print("PARSING END");
    return 1;
}

//----------------------------------------------------------

stock LoadAllJails()
{
    print("LOAD JAIL INTILIAIZE OK");
    for(new jailid = 0; jailid < MAX_JAILS; jailid++)
    {
    print("LOOP START");
    format(pfile, sizeof(pfile), "%s/%s/%s/%i%s", CORE_FOLDER, SETTING_FOLDER, SUB_SETTING_JAILS, jailid, CORE_FOLDERS_FILESYSTEM);
    print("PFILE OK");
    if(fexist(pfile))
    {
    print("PFILE FOUND");
    INI_ParseFile(pfile,"LoadCells",.bExtra = true,.extra = jailid);
    print("PARSING OK");
    celInfo[jailid][jailobj] = CreateDynamicObject(celInfo[jailid][jobject], celInfo[jailid][doorcloseX], celInfo[jailid][doorcloseY], celInfo[jailid][doorcloseZ], 0.0, 0.0, 0.0);
    print("OBJECT CREATE OK");
    loaded_jails++;
    print("JAIL ADDED OK");
    }
    }
}
As you guys can see that I have set couple debug prints all over function. Check this log if it helps:

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3c, ©2005-2010 SA-MP Team

[17:48:58] 
[17:48:58] Server Plugins
[17:48:58] --------------
[17:48:58]  Loading plugin: streamer
[17:48:58] 

*** Streamer Plugin v2.5.2 by Incognito loaded ***

[17:48:58]   Loaded.
[17:48:58]  Loading plugin: sscanf
[17:48:58] 

[17:48:58]  ===============================

[17:48:58]       sscanf plugin loaded.     

[17:48:58]    © 2009 Alex "******" Cole

[17:48:58]  ===============================

[17:48:58]   Loaded.
[17:48:58]  Loaded 2 plugins.

[17:48:58] 
[17:48:58] Filter Scripts
[17:48:58] ---------------
[17:48:58]   Loading filter script 'gl_actions.amx'...
[17:48:58]   Loading filter script 'gl_zones.amx'...
[17:48:58]   Loading filter script 'gl_property.amx'...
[17:48:58]   Loading filter script 'npc_record.amx'...
[17:48:58]   Loading filter script 'sunglasses.amx'...
[17:48:58]   Loading filter script 'F_SpeedoMeter.amx'...
[17:48:58]   Loaded 6 filter scripts.

[17:48:58]  
[17:48:58]  ======================================= 
[17:48:58]  |                                     | 
[17:48:58]  |        YSI version 1.03.0011        | 
[17:48:58]  |        By Alex "******" Cole        | 
[17:48:58]  |                                     | 
[17:48:58]  |  Checking the latest YSI version..  | 
[17:48:58]  |                                     | 
[17:48:58]  ======================================= 
[17:48:58]  
[17:48:59] OK
[17:48:59] LOAD JAIL INTILIAIZE OK
[17:48:59] LOOP START
[17:48:59] PFILE OK
[17:48:59] PFILE FOUND
[17:48:59] PARSING START
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] DOORY
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] DOORY
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] DOORY
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] DOORY
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] DOORY
[17:48:59] PARSING START
[17:48:59] JALID
[17:48:59] DOORY
[17:48:59] JAIL AREA
[17:48:59] PARSING OK
[17:48:59] OBJECT CREATE OK
[17:48:59] JAIL ADDED OK
[17:48:59] LOOP START
[17:48:59] PFILE OK
[17:48:59] LOOP START
[17:48:59] PFILE OK
[17:48:59] LOOP START
[17:48:59] PFILE OK
[17:48:59] LOOP START
[17:48:59] PFILE OK
[17:48:59] OK2
[17:48:59] Number of vehicle models: 175
[17:48:59]  
[17:48:59]  ====================================== 
[17:48:59]  |                                    | 
[17:48:59]  |  Congratulations! You are running  | 
[17:48:59]  |     the latest version of YSI!     | 
[17:48:59]  |                                    | 
[17:48:59]  ====================================== 
[17:48:59]  
[17:48:59] Incoming connection: 127.0.0.1:51717
[17:48:59] [npc:join] ... has joined the server (0:127.0.0.1)
File looks like this:
jalid=0
jobject=1495
cX=1584.6010
cY=-1678.0815
cZ=5.8976,15
jairange=15
dooropenX=1586.293579
dooropenY=-1673.074707
dooropenZ=4.889661
doorcloseX=1581.124023
doorcloseY=-1637.917236
doorcloseZ=12.357195
jailarea=Los Santos
jailint=0

So what can be problem or do I just simple use this y_ini wrong?


Re: Function problem - woaha - 21.06.2011

bump


Re: Function problem - woaha - 22.06.2011

bump