Dialog STRING help!!! I give reputation for who gets me out of this problem
#1

Ok so i made the next command:
pawn Код:
CMD:factions(playerid, params[])
{
    new string[128];
    for(new xf = 0; xf < MAX_GROUPS; xf++)
    {
    format(string, sizeof(string),"Los Santos Police Department [%d/10]\nFederal Bureau Of Investigation[%d/10]\nNational Guard [%d/10]\nParamedic Department[%d/10]\nLas Venturas Police Department [%d/10]\nThe Russian Mafia [%d/10]\nGrove Street[%d/10]\nLos Aztecas[%d/10]\nThe Riffa [%d/10]\nBallas [%d/10]\nLos Vagos [%d/10]\nHitman Agency [%d/10]\nSchool Instructors [%d/10]\nTaxi Company [%d/10]\nNews Reporters [%d/10]", groupVariables[xf][gMembers]);
    ShowPlayerDialog(playerid, TCOLOR, DIALOG_STYLE_LIST, "Server: Factions", string,  "Select", "Cancel");
    }
    return 1;
}
to show the number of members that are in the factions. But when i tested it i got 2 problems,
1. It's not showing all the factions.
2. If i am in faction number 1 which is Los Santos Police Department it's not counting , it's still 0/10 ..
I started from the old command:
pawn Код:
CMD:factions(playerid, params[])
{
    for(new xf = 0; xf < MAX_GROUPS; xf++)
    {
        if(strlen(groupVariables[xf][gGroupName]) >= 1 && strcmp(groupVariables[xf][gGroupName], "None", true))
        {
            format(szMessage, sizeof(szMessage), "ID: %d | Name: %s | Members: %d/10 | Leader: %s", xf, groupVariables[xf][gGroupName], groupVariables[xf][gMembers], groupVariables[xf][gGroupLeader]);
            SendClientMessage(playerid, COLOR_WHITE, szMessage);
        }
    }
    return 1;
}
I hope you can help me.
Reply
#2

try this
Код:
CMD:factions(playerid, params[])
{
    new string[400];
    format(string, sizeof(string),"Los Santos Police Department [%d/10]\nFederal Bureau Of Investigation[%d/10]\nNational Guard [%d/10]\nParamedic Department[%d/10]\nLas Venturas Police Department [%d/10]\nThe Russian Mafia [%d/10]\nGrove Street[%d/10]\nLos Aztecas[%d/10]\nThe Riffa [%d/10]\nBallas [%d/10]\nLos Vagos [%d/10]\nHitman Agency [%d/10]\nSchool Instructors [%d/10]\nTaxi Company [%d/10]\nNews Reporters [%d/10]", groupVariables[0][gMembers],groupVariables[1][gMembers],groupVariables[2][gMembers],groupVariables[3][gMembers],groupVariables[4][gMembers],groupVariables[5][gMembers],groupVariables[6][gMembers],groupVariables[7][gMembers],groupVariables[8][gMembers],groupVariables[9][gMembers],groupVariables[10][gMembers],groupVariables[11][gMembers],groupVariables[12][gMembers],groupVariables[13][gMembers],groupVariables[14][gMembers]);
    ShowPlayerDialog(playerid, TCOLOR, DIALOG_STYLE_LIST, "Server: Factions", string,  "Select", "Cancel");
    return 1;
}
i made the string 400 because it is 389 characters
Reply
#3

Same case over here;

https://sampforum.blast.hk/showthread.php?tid=540547
Reply
#4

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Still not working . I tried what was in the topic , i think i am wrong ..
Reply
#5

I tried to add under "format(string..." this thing but nothing strcat(string, string);
Reply
#6

did you try mine?
Reply
#7

yes .. not working too ..
Reply
#8

Quote:
Originally Posted by (SF)Noobanatior
Посмотреть сообщение
try this
Код:
CMD:factions(playerid, params[])
{
    new string[400];
    format(string, sizeof(string),"Los Santos Police Department [%d/10]\nFederal Bureau Of Investigation[%d/10]\nNational Guard [%d/10]\nParamedic Department[%d/10]\nLas Venturas Police Department [%d/10]\nThe Russian Mafia [%d/10]\nGrove Street[%d/10]\nLos Aztecas[%d/10]\nThe Riffa [%d/10]\nBallas [%d/10]\nLos Vagos [%d/10]\nHitman Agency [%d/10]\nSchool Instructors [%d/10]\nTaxi Company [%d/10]\nNews Reporters [%d/10]", groupVariables[0][gMembers],groupVariables[1][gMembers],groupVariables[2][gMembers],groupVariables[3][gMembers],groupVariables[4][gMembers],groupVariables[5][gMembers],groupVariables[6][gMembers],groupVariables[7][gMembers],groupVariables[8][gMembers],groupVariables[9][gMembers],groupVariables[10][gMembers],groupVariables[11][gMembers],groupVariables[12][gMembers],groupVariables[13][gMembers],groupVariables[14][gMembers]);
    ShowPlayerDialog(playerid, TCOLOR, DIALOG_STYLE_LIST, "Server: Factions", string,  "Select", "Cancel");
    return 1;
}
i made the string 400 because it is 389 characters
add print(string); and see what it says in the console
Reply
#9

where to add print(string) ?
Reply
#10

When i add string[400]; i get this error dude :
pawn Код:
F:xxxxxx(23840) : error 075: input line too long (after substitutions)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)