memberlist of orgs.
#1

I've coded this for the org memberlist in the edit of jakkus dynamic orgs.
pawn Код:
if(dialogid == 9990 && response)
    {
    switch(listitem)
    {
    case 0:
    {
    for (new i=1;i<OrgsCount+1;i++)
                {
    new string[140];
    format(string,sizeof(string),"{5CB3FF}Organization: {FFFFFF}%s\n{5CB3FF}Leader: {FFFFFF}%s", GetOrgName(i), Organization[i][Leader]);
    ShowPlayerDialog(playerid, 757, DIALOG_STYLE_MSGBOX, "Organization",string,"Close","");
    }
    }
    case 1:
    {
    GiveOrgFeatures(playerid);
    }
    case 2:
    {
    new string[120];
            format(string,sizeof(string),"You have resigned from %s", Organization[PlayerOrg[playerid]][Name]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            format(string,sizeof(string),"**%s has resigned from %s", PlayerName(playerid), Organization[PlayerOrg[playerid]][Name]);
            SendClientMessageToAllEx(playerid, COLOR_GREY, string);

            if (IsLeader(playerid))
            {
            new none[24];
            format(none,sizeof(none),"None");
            Organization[PlayerOrg[playerid]][Leader] = none;
            }
            ResetPlayerOrg(playerid);
            SavePlayerOrgInfo(playerid);
            }
            case 3:
            {
            new string[80];
            format(string,sizeof(string),"You have collected $%d", CollectedWage[playerid]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            GivePlayerMoney(playerid, CollectedWage[playerid]);
            CollectedWage[playerid] = 0;
            SavePlayerOrgInfo(playerid);
            }
            case 4:
            {
            new string[140];
            for (new i=0;i<MAX_PLAYERS;i++)
    {
            if (PlayerOrg[i] == PlayerOrg[playerid] && i != playerid)
            {
            format(string,sizeof(string),"%s", PlayerName(i));
            ShowPlayerDialog(playerid,99000,DIALOG_STYLE_LIST,"Memberlist",string,"Ok","Alright");
            }
            }
            }
            }
            }
This works at all no errors.
but the dialog doesnt comes on the screen.
and i think it is wrong coding, the last case 4:
can you correct it into the rightone i tried alot
Reply
#2

pawn Код:
case 4:
{
    new string[140];
    new MyDialog[256];
    for (new i=0;i<MAX_PLAYERS;i++)
    {
        if (PlayerOrg[i] == PlayerOrg[playerid] && i != playerid)
        {
            format(string,sizeof(string),"%s", PlayerName(i));
            strcat(MyDialog, string);
        }
    }
    ShowPlayerDialog(playerid,99000,DIALOG_STYLE_LIST,"Memberlist",MyDialog,"Ok","Alright");
 }
Try this, and do the same for the "case 0" which is also wrong.
Reply
#3

i am giving you simple example which i am using in org script

first
pawn Код:
public OnFilterScriptInit()
{
new file1[64];
format(file1, sizeof(file1), "GSFMembers.ini");
}
if(!dini_Exists(file1))
{
            dini_Create(file1);
            dini_Set(file1, "1", "No One"); dini_Set(file1, "2", "Free Spot"); dini_Set(file1, "3", "Free Spot"); dini_Set(file1, "4", "Free Spot");
            dini_Set(file1, "5", "Free Spot"); dini_Set(file1, "6", "Free Spot"); dini_Set(file1, "7", "Free Spot"); dini_Set(file1, "8", "Free Spot");
}

stock SetOMem(playerid)
{
    new file[64];
    switch(PlayerOrg[playerid])
    {
        case 1:
        {
            format(file, sizeof(file), "GSFMembers.ini");
            if(!strcmp(dini_Get(file, "2"), "Free Spot")) { dini_Set(file, "2", PlayerName(playerid)); }
            else if(!strcmp(dini_Get(file, "3"), "Free Spot")) { dini_Set(file, "3", PlayerName(playerid)); }
            else if(!strcmp(dini_Get(file, "4"), "Free Spot")) { dini_Set(file, "4", PlayerName(playerid)); }
            else if(!strcmp(dini_Get(file, "5"), "Free Spot")) { dini_Set(file, "5", PlayerName(playerid)); }
            else if(!strcmp(dini_Get(file, "6"), "Free Spot")) { dini_Set(file, "6", PlayerName(playerid)); }
            else if(!strcmp(dini_Get(file, "7"), "Free Spot")) { dini_Set(file, "7", PlayerName(playerid)); }
            else if(!strcmp(dini_Get(file, "8"), "Free Spot")) { dini_Set(file, "8", PlayerName(playerid)); }
            CountOrg(1);
        }
        }
        return 1;
}
then go on dialog
pawn Код:
if(PlayerOrg[playerid] == 1 || PlayerOrg[playerid] != 1)
                {
                 new file[126],string[200];
                 format(file, sizeof(file), "GSFMembers.ini");
                 format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s", dini_Get(file, "1"), dini_Get(file, "2"), dini_Get(file, "3"), dini_Get(file, "4"), dini_Get(file, "5"), dini_Get(file, "6"), dini_Get(file, "7"), dini_Get(file, "8"));
                 ShowPlayerDialog(playerid, 221, DIALOG_STYLE_LIST, "GSF Memberlist",string,"Select","Back");
        }
If you want my script i got memberlist in dialogs then add me in skype
name: shehrozassad
Reply
#4

Case 0 is fine.
Reply
#5

For the love of god, please fix your identation.

Try like this:

pawn Код:
if(dialogid == 9990 && response)
{
    switch(listitem)
    {
        case 0:
        {
            for(new i = 1; i < OrgsCount+1; i++)
            {
                new string[140];
                format(string,sizeof(string),"{5CB3FF}Organization: {FFFFFF}%s\n{5CB3FF}Leader: {FFFFFF}%s", GetOrgName(i), Organization[i][Leader]);
                ShowPlayerDialog(playerid, 757, DIALOG_STYLE_MSGBOX, "Organization",string,"Close","");
                return 1;
            }
        }
       
        case 1: GiveOrgFeatures(playerid);

        case 2:
        {
            new string[120];
            format(string,sizeof(string),"You have resigned from %s", Organization[PlayerOrg[playerid]][Name]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            format(string,sizeof(string),"**%s has resigned from %s", PlayerName(playerid), Organization[PlayerOrg[playerid]][Name]);
            SendClientMessageToAllEx(playerid, COLOR_GREY, string);

            if (IsLeader(playerid))
            {
                new none[24];
                format(none,sizeof(none),"None");
                Organization[PlayerOrg[playerid]][Leader] = none;
            }
           
            ResetPlayerOrg(playerid);
            SavePlayerOrgInfo(playerid);
        }
       
        case 3:
        {
            new string[80];
            format(string,sizeof(string),"You have collected $%d", CollectedWage[playerid]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            GivePlayerMoney(playerid, CollectedWage[playerid]);
            CollectedWage[playerid] = 0;
            SavePlayerOrgInfo(playerid);
        }
       
        case 4:
        {
            new string[140];
            for (new i=0;i<MAX_PLAYERS;i++)
            {
                if (PlayerOrg[i] == PlayerOrg[playerid] && i != playerid)
                {
                    format(string,sizeof(string),"%s\n%s", string, PlayerName(i));                 
                }
            }
           
            ShowPlayerDialog(playerid,99000,DIALOG_STYLE_LIST,"Memberlist",string,"Ok","Alright");
        }
    }
}
Reply
#6

Quote:
Originally Posted by RyanPetersons
Посмотреть сообщение
Case 0 is fine.
Yes but only if you try only with one person (alone), i shouldn't work else.
Reply
#7

Done, but I'm only alone in my org Stefano, Then I went in memberlist
It doesnt shows me the dialog.
Reply
#8

Which dialog doesn't show up? Which case?
Reply
#9

change
pawn Код:
if (PlayerOrg[i] == PlayerOrg[playerid] && i != playerid)
to
pawn Код:
if (PlayerOrg[i] == PlayerOrg[playerid])
Reply
#10

still same ice and @ GiamPy the case 4: of memberlist.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)