need help with dini
#1

Hello,

this doesnt create a file with the clan name

pawn Код:
COMMAND:createclan(playerid, params[])
{
    new string[128], tag[10], type, Name[24], pName[MAX_PLAYER_NAME], file[128];
    if (sscanf(params, "is[10]s[24]", type, tag, Name)) return SendClientMessage(playerid, Yellow, "Usage: /createclan [1 (start) / 2 (end)] [tag], do not include [ or ] in the tag, clan-name");
    GetPlayerName(playerid, Name, sizeof(Name));
    format(file, sizeof(file), "Clans/%s", Name);
    for(new i = 0; i < sizeof(ClanInfo); i++) {
    switch (type)
    {
        case 1:
            {
                ClanInfo[i][cFront] = 1;
                format(string,sizeof(string),"You have created the clan [%s], at the front of your name",tag);
                SendClientMessage(playerid,Green,string);
                GetPlayerName(playerid, pName, sizeof(pName));
                dini_Set(file, "cName", Name);
                dini_Set(file, "Tag", tag);
                dini_Set(file, "Owner", pName);
                dini_IntSet(file, "Front", 1);
                return 1;
            }
        case 2:
            {
                ClanInfo[i][cBack] = 1;
                format(string,sizeof(string),"You have created the clan [%s], at the front of your name",tag);
                SendClientMessage(playerid,Green,string);
                GetPlayerName(playerid, pName, sizeof(pName));
                dini_Set(file, "cName", Name);
                dini_Set(file, "Tag", tag);
                dini_Set(file, "Owner", pName);
                dini_IntSet(file, "Back", 1);
                return 1;
            }
            default:
            {
                SendClientMessage(playerid, Yellow, "Usage: /createclan [1 (start) / 2 (end)] [tag], do not include [ or ] in the tag, clan-name");
            }
        }
    }
    return 1;
}
Please help
Reply
#2

You are setting data in a file that does not exist!
pawn Код:
dini_Create(file);
Reply
#3

Okay works perfectly fine now

But, can you help me continue this code?
How can I make an clanID to each clan?
Example if player1 creates a clan he gets clan id 1
player2 gets clan id 2 , etc?
Reply
#4

bump
Reply
#5

I tried to make a clans cmds

pawn Код:
COMMAND:clans(playerid, params[])
{
    new string[128];
    format(string,sizeof(string),"Clan ID: %d - Clan Name: %s. Tag: [%s]", ClanInfo[cID], ClanInfo[cName], ClanInfo[cTag]);
    SendClientMessage(playerid,-1,string);
    return 1;
}
But nothing is shown?
Reply
#6

Bump
Reply
#7

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)