SA-MP Forums Archive
dialogs help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: dialogs help (/showthread.php?tid=629837)



dialogs help - silverms - 04.03.2017

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?


Re: dialogs help - Toroi - 04.03.2017

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.


Re: dialogs help - silverms - 04.03.2017

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


Re: dialogs help - Toroi - 04.03.2017

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.


Re: dialogs help - silverms - 04.03.2017

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


Re: dialogs help - Toroi - 04.03.2017

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; 
}



Re: dialogs help - silverms - 04.03.2017

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


Re: dialogs help - ThatFag - 04.03.2017

Код:
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


Re: dialogs help - JessThompson - 04.03.2017

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


Re: dialogs help - silverms - 04.03.2017

nvm I made it by my self thanks :P