Can Someone Help !
#1

I want to convert this To A Dialog, i tried but it shows just one line, Can someone help me !?
pawn Код:
COMMAND:gangs(playerid, params[])
{
    new str[128];
    SendClientMessage(playerid, WHITE, "----------------------------------------------------------------------------------------------------------");
    for(new i = 1; i < MAX_GANGS; i++)
    {
        format(str, sizeof(str), "Gang Name: %s, Leader: %s, Members: %d.", GangStat[i][GangName], GangStat[i][Leader], GangStat[i][Members]);
        SendClientMessage(playerid, GangStat[i][Color], str);
    }
    SendClientMessage(playerid, WHITE, "----------------------------------------------------------------------------------------------------------");
    return 1;
}
Reply
#2

Try this!
pawn Код:
COMMAND:gangs(playerid, params[])
{
    new str[128];
    for(new i = 1; i < MAX_GANGS; i++)
    {
        format(str, sizeof(str), "Gang Name: %s, Leader: %s, Members: %d.~n~%s", GangStat[i][GangName], GangStat[i][Leader], GangStat[i][Members], str);
        SendClientMessage(playerid, GangStat[i][Color], str);
    }
    return 1;
}
Reply
#3

Lol !!
I want it in a DIALOG !!
Reply
#4

Try using strcat.

Create a large string which will contain each formatted string and then show the dialog.
I hope nobody here will give you a read-made code because looking at how you "ask" your help, it's not a real motivation at all.
Reply
#5

pawn Код:
COMMAND:gangs(playerid, params[])
{
    new str[128];
    for(new i = 1; i < MAX_GANGS; i++)
    {
        format(str, sizeof(str), "Gang Name: %s, Leader: %s, Members: %d.", GangStat[i][GangName], GangStat[i][Leader], GangStat[i][Members]);
        ShowPlayerDialog(playerid,YOURDIALOGID,DIALOG_STYLE_MSGBOX,"Gang Info", str,"Ok","Ok");
    }
    return 1;
}
here you go my friend
Reply
#6

But The Number of Gangs will be Random !!
Reply
#7

pawn Код:
COMMAND:gangs(playerid, params[])
{
    new str[200];
    for(new i = 1; i < MAX_GANGS; i++) format(str, sizeof(str), "%sGang Name: %s, Leader: %s, Members: %d.\n", str, GangStat[i][GangName], GangStat[i][Leader], GangStat[i][Members]);
    ShowPlayerDialog(...); // modify the arguments and "str" holds the info
    return 1;
}
by the way, why do you start from index 1 and 0 goes wasted? Indexes in arrays start from 0.
Reply
#8

it shows one gang with highst ID !?
Reply
#9

It Works !!!!!
Reply
#10

Quote:
Originally Posted by GeekSiMo
Посмотреть сообщение
Lol !!
I want it in a DIALOG !!
Just format the string as i said above and show it in dialog instead of message, what's hard in this ? -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)