SA-MP Forums Archive
help with this please - 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: help with this please (/showthread.php?tid=241194)



help with this please - xir - 17.03.2011

i need help with my system..

when i create a clan, it works and all, but when I chat there is nothing in the brackets

here is it

http://pastebin.com/31BE6wJe

why doesnt it work?


Re: help with this please - xir - 20.03.2011

Bump.

Do you want to see the enums or something? Please I need help


Re: help with this please - xir - 21.03.2011

Anyone?


AW: help with this please - Pablo Borsellino - 21.03.2011

Bump/Push only every 24 Hours dude! Debug your Code (every 10th line a print("1"); > print("2); and so on) To see where your Code stop.


Re: help with this please - xir - 21.03.2011

it works, but when I chat the clan name is not in the [ ]


Re: help with this please - xir - 24.03.2011

do you want to see how the clans saves/loads? Because I think it has problem to save the clans then load it?


Re: help with this please - xir - 25.03.2011

I've noticed that when I create a clan it saves to the file wrong, it doesnt show the clan name in the file, that is the problem..

Here is my saveclans/loadclans

pawn Код:
forward LoadClans();
public LoadClans()
{
    new arrCoords[4][64];
    new strFromFile2[256];
    new File: file = fopen("Clans/clans.cfg",io_read);
    if (file)
    {
        new idx;
        while (idx < sizeof(Clans))
        {
            fread(file, strFromFile2);
            split(strFromFile2, arrCoords, '|');
            strmid(Clans[idx][cName], arrCoords[0], 0, strlen(arrCoords[0]), 255);
            strmid(Clans[idx][clOwner], arrCoords[1], 0, strlen(arrCoords[1]), 255);
            Clans[idx][Front] = strval(arrCoords[2]);
            Clans[idx][Back] = strval(arrCoords[3]);
            idx++;
        }
        fclose(file);
    }

    return 1;
}
forward SaveClans();
public SaveClans()
{
    new idx;
    new File: file2;
    while (idx < sizeof(Clans))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%s|%s|%d|%d\n",
        Clans[idx][cName],
        Clans[idx][clOwner],
        Clans[idx][Front],
        Clans[idx][Back]);
        if(idx == 0)
        {
            file2 = fopen("Clans/clans.cfg",io_write);
        }
        else
        {
            file2 = fopen("Clans/clans.cfg",io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    return 1;
}
Can anyone make it to dini?


Re: help with this please - xir - 25.03.2011

Guys I really need help on this one


Re: help with this please - MadeMan - 25.03.2011

Problem is in /clancreate command.

pawn Код:
strmid(Clans[i][cName], result, 0, strlen(result), 255);
You save result to Clans[i][cName] but result is empty, you don't save anything there.


Re: help with this please - xir - 25.03.2011

Uhm can you help me fix it? Because I used that when I used strcmp and strtok long time ago.
Maybe a better and effiecent way to make it save? Please help