dialogs help
#1

mm hey so I have mad this
PHP код:
GetPlayersInEventOne()
{
    new 
count;
    for(new 
x=0xMAX_PLAYERSx++)
    { 
//x = MAX_PLAYERS
          
if(Eventr[x]==1)
          {
            
count++;
        }
    }
    return 
count;

so what I need to do is that when it show me the dialogs it show me the ineventone players like a string how to do that?
Reply
#2

Please! Don't have mad at this anymore.

What exactly do you want that function to perform?

Quote:

so what I need to do is that when it show me the dialogs it show me the ineventone players like a string how to do that?

This is not very explanatory.
Reply
#3

like a string mm same as like tghere is in the event%d players but in dialog
Reply
#4

Why do you type as if you are in a hurry?

I get what you're trying to say, I guess.

Where are you using the function GetPlayersInEventOne() on? A command? If so, post it here.
Reply
#5

I'm not I need to use it on dialog like strcat or something
Reply
#6

Okay. You can use strins if i'm not wrong. Something like this should work:

Код:
GetPlayersInEventOne() 
{ 
	new count[256],playname[MAX_PLAYER_NAME];
	for(new x=0; x< MAX_PLAYERS; x++) 
	{ //x = MAX_PLAYERS 
		if(Eventr[x]==1) 
		{ 
			GetPlayerName(x,playname,sizeof playname);
			strins(count,playname,0);
		} 
	} 
	return count; 
}
Reply
#7

no ik this how to do it but I need to know how to make that like 2players in the dialog when a player type the command
Reply
#8

Код:
stock PlayerName(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  return name;
}
COMMAND:inevent(playerid, params[])
{
	for(new x=0; x< MAX_PLAYERS; x++) 
	{
	    if(Eventr[x]==1)
	    {
            new name[MAX_PLAYER_NAME],string[50];
            GetPlayerName(playerid, name, MAX_PLAYER_NAME);
			format(string, sizeof(string), "%s ", PlayerName(q));
			ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_LIST,"Player in Event",string,"Okay","Cancel");
	    }
	}
	return 1;
}
Not sure if works but test it
Reply
#9

Something like this

Код:
CMD:COMMANDNAME(playerid, paramas[])
{
    new string[1024]
    for(new x=0; x< MAX_PLAYERS; x++) 
    { //x = MAX_PLAYERS 
        if(Eventr[x] == 1) 
        { 
            format(string, sizeof(string), "%s\n<%d>{66FF66}%s", string, x, GetPlayerName(x,playname,sizeof playname));
        }
    }
    ShowPlayerDialog(playerid, JustShow, DIALOG_STYLE_LIST, "TITLE", string, "OK", "OK");
    return 1;
}
ThatFag was first, Guess mine is just cleaner version and I know it works because it how I do it in my gamemode :P
Reply
#10

nvm I made it by my self thanks :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)