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



Help :s - FireCat - 09.10.2011

Hello, why is it, that when I load this FS, no one can join my server, they get stucked at "Joining..."?
And in my samp-server.exe it stucks at the FS loading?
http://pastebin.com/BCVWwkt9


Re: Help :s - Ash. - 09.10.2011

Just try commenting out "LoadProps();" in OnFilterScriptInit, just to see the outcome.


Re: Help :s - FireCat - 09.10.2011

Quote:
Originally Posted by funky1234
Посмотреть сообщение
Just try commenting out "LoadProps();" in OnFilterScriptInit, just to see the outcome.
If I comment it, it loads everything correctly.


Re: Help :s - Ash. - 09.10.2011

So then,
pawn Код:
stock LoadProps()
{
    new file[128],ownername[23],name[200],ownerstring[200];
    for(new i = 0; i < MAX_PROPS;i++)
    {
        format(file,sizeof(file),File,i);
        if(INI_Exist(file))
        {
            INI_Open(file);
            INI_ReadString(ownername,"Owner",23);
            INI_ReadString(name,"Name",200);
            format(PInfo[i][Owner],23,"%s",ownername);
            format(PInfo[i][Name],200,"%s",name);
            PInfo[i][XPos] = INI_ReadFloat("XPos");
            PInfo[i][YPos] = INI_ReadFloat("YPos");
            PInfo[i][ZPos] = INI_ReadFloat("ZPos");
            PInfo[i][Price] = INI_ReadInt("Price");
            PInfo[i][Ownings] = INI_ReadInt("Ownings");
            PInfo[i][World] = INI_ReadInt("World");
            PInfo[i][Owned] = INI_ReadInt("Owned");
            PInfo[i][Pickup] = CreatePickup(1273,23,PInfo[i][XPos],PInfo[i][YPos],PInfo[i][ZPos],PInfo[i][World]);
            if(PInfo[i][Owned] == 1)
            {
                format(ownerstring,sizeof(ownerstring),""lyellow2"Prop name: %s \nOwner: %s \nCost: %i \nOwnings: %i \nProperty id: %i",PInfo[i][Name],PInfo[i][Owner],PInfo[i][Price],PInfo[i][Ownings],i);
                PropLabel[i] = Create3DTextLabel(ownerstring,white,PInfo[i][XPos],PInfo[i][YPos],PInfo[i][ZPos]+0.7,PROP_DEFAULT_LABEL_DISTANCE,PInfo[i][World]);
            }
            else
            {
                format(ownerstring,sizeof(ownerstring),""lyellow2"Prop name: %s \nOwner: None \nCost: %i \nOwnings: %i \nProperty id: %i",PInfo[i][Name],PInfo[i][Price],PInfo[i][Ownings],i);
                PropLabel[i] = Create3DTextLabel(ownerstring,white,PInfo[i][XPos],PInfo[i][YPos],PInfo[i][ZPos]+0.7,PROP_DEFAULT_LABEL_DISTANCE,PInfo[i][World]);
            }
            INI_Close();
            PropCount++;
            SetGVarInt("Pickups",GetGVarInt("Pickups")+1);
        }
    }
    printf("Loaded properties: %i",PropCount);
    return 1;
}
Is causing issues. Does it print "Loaded properties.."?


Re: Help :s - FireCat - 09.10.2011

Quote:
Originally Posted by funky1234
Посмотреть сообщение
So then,
pawn Код:
stock LoadProps()
{
    new file[128],ownername[23],name[200],ownerstring[200];
    for(new i = 0; i < MAX_PROPS;i++)
    {
        format(file,sizeof(file),File,i);
        if(INI_Exist(file))
        {
            INI_Open(file);
            INI_ReadString(ownername,"Owner",23);
            INI_ReadString(name,"Name",200);
            format(PInfo[i][Owner],23,"%s",ownername);
            format(PInfo[i][Name],200,"%s",name);
            PInfo[i][XPos] = INI_ReadFloat("XPos");
            PInfo[i][YPos] = INI_ReadFloat("YPos");
            PInfo[i][ZPos] = INI_ReadFloat("ZPos");
            PInfo[i][Price] = INI_ReadInt("Price");
            PInfo[i][Ownings] = INI_ReadInt("Ownings");
            PInfo[i][World] = INI_ReadInt("World");
            PInfo[i][Owned] = INI_ReadInt("Owned");
            PInfo[i][Pickup] = CreatePickup(1273,23,PInfo[i][XPos],PInfo[i][YPos],PInfo[i][ZPos],PInfo[i][World]);
            if(PInfo[i][Owned] == 1)
            {
                format(ownerstring,sizeof(ownerstring),""lyellow2"Prop name: %s \nOwner: %s \nCost: %i \nOwnings: %i \nProperty id: %i",PInfo[i][Name],PInfo[i][Owner],PInfo[i][Price],PInfo[i][Ownings],i);
                PropLabel[i] = Create3DTextLabel(ownerstring,white,PInfo[i][XPos],PInfo[i][YPos],PInfo[i][ZPos]+0.7,PROP_DEFAULT_LABEL_DISTANCE,PInfo[i][World]);
            }
            else
            {
                format(ownerstring,sizeof(ownerstring),""lyellow2"Prop name: %s \nOwner: None \nCost: %i \nOwnings: %i \nProperty id: %i",PInfo[i][Name],PInfo[i][Price],PInfo[i][Ownings],i);
                PropLabel[i] = Create3DTextLabel(ownerstring,white,PInfo[i][XPos],PInfo[i][YPos],PInfo[i][ZPos]+0.7,PROP_DEFAULT_LABEL_DISTANCE,PInfo[i][World]);
            }
            INI_Close();
            PropCount++;
            SetGVarInt("Pickups",GetGVarInt("Pickups")+1);
        }
    }
    printf("Loaded properties: %i",PropCount);
    return 1;
}
Is causing issues. Does it print "Loaded properties.."?
Yes, but it freezes there instead of continue with like y_ini updates stuff, like it normaly should do.


Re: Help :s - Ash. - 09.10.2011

But you're not using y_INI?


Re: Help :s - FireCat - 09.10.2011

Quote:
Originally Posted by funky1234
Посмотреть сообщение
But you're not using y_INI?
Sorry, I'm using YSI.
I men't YSI in the other post.
And I'm using SII.


Re: Help :s - Ash. - 09.10.2011

Oh haha

Does it go through the loop underneath "LoadProps();"?

(Oh, and another thing - isn't this in the wrong section?)


Re: Help :s - Zh3r0 - 09.10.2011

What's the definition of 'File' ?


Re: Help :s - Ash. - 09.10.2011

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
What's the definition of 'File' ?
pawn Код:
#define File "Admin/Props/%i.ini"
I was just looking at that myself!