Dialog format problem
#1

so i am kinda new on making formats in dialogs with loops

so i am trying to get the name of a player that has placed a hit on but it is just writing my NPC name

here is the Code

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(Hitman[playerid] == 1)
        {
            new BigString[1900];
            format(BigString,sizeof(BigString),"1.%s(%d)",GetName(IsList[i]),IsList[i]);
            ShowPlayerDialog(playerid,Hitlist,DIALOG_STYLE_MSGBOX,"Hit List",BigString,"Ok","");       
           return 1;
        }
    }
Reply
#2

Any help in my problem?
Reply
#3

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(Hitman[playerid] == 1)
        {
            new BigString[1900];
            new pname[24];
            GetPlayerName(i,pname,sizeof(pname));
            format(BigString,sizeof(BigString),"1.%s(%d)",pname,i);
            ShowPlayerDialog(playerid,Hitlist,DIALOG_STYLE_MSGBOX,"Hit List",BigString,"Ok","");      
            return 1;
        }
    }
<< This is what you wanted?
Reply
#4

i wanted it to detect only the players that were placed in hit i have a command that use a variable named IsList to store the players but i dont know how to detect it in strings
Reply
#5

pawn Код:
if(Hitman[playerid] == 1);
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
         if(IsList[i] >= 1)
         {
             new string[1900];
             new pname[24];
             GetPlayerName(i,pname,sizeof(pname));
             format(string,sizeof(string),"%s(%d)",pname(i),i);
             ShowPlayerDialog(playerid,Hitlist,DIALOG_STYLE_MSGBOX,"Hit List",string,"Ok","");      
         }
    }
}
Sorry for poor indentation.

EDIT: Fixed

EDIT 2 : Its fine now, try it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)