HELP - Members Faction Online
#1

#define DIALOG_FACOD 565
#define DIALOG_ONDUTY 566

//UNDER ONDIALOGRESPONSIVE
Код:
switch(dialogid)
	{
		case DIALOG_FACOD:
		{
			if(!response) return 0;
			new str[128];
			if(listitem == 0)
			{
				for(new i=0;i<MAX_PLAYERS;i++)
				{
					if(IsPlayerConnected(id) && PlayerInfo[playerid][pFaction] == 1) 
					{
						if(GetPVarInt(i, "OnDuty") == 1)
						{
							format(str, sizeof(str), "%s\n",str,GetPlayerName(i));
						}
					}
				}
				ShowPlayerDialog(playerid, DIALOG_ONDUTY, DIALOG_STYLE_MSGBOX, "Police on duty", string, "Ok", "");
			}
			else if(listitem == 1)
			{
				for(new i=0;i<MAX_PLAYERS;i++)
				{
					if(PlayerInfo[playerid][pFaction] == 2)
					{
						if(GetPVarInt(i, "OnDuty") == 1)
						{
							format(str, sizeof(str), "%s\n",str,GePlayertName(i));
						}
					}
				}
				ShowPlayerDialog(playerid, DIALOG_ONDUTY, DIALOG_STYLE_MSGBOX, "Medics on duty", str, "Ok", "");
			}
		}
	}
//UNDER ONPLAYERCOMMANDTEXT
Код:
	if(strcmp(cmd, "/fazioni", true) == 0)
{
	ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select a Faction", "Police \nMedic", "Ok", "Cancel");
	return 1;
}
(27211) : warning 202: number of arguments does not match definition: format(str, sizeof(str), "%s\n",GetPlayerName(i));
(27225) : warning 202: number of arguments does not match definition: format(str, sizeof(str), "%s\n",GetPlayerName(i));
Reply
#2

Код:
switch(dialogid)
	{
		case DIALOG_FACOD:
		{
			if(!response) return 0;
			new str[128];
			if(listitem == 0)
			{
				for(new i=0;i<MAX_PLAYERS;i++)
				{
					if(IsPlayerConnected(id) && PlayerInfo[playerid][pFaction] == 1) 
					{
						if(GetPVarInt(i, "OnDuty") == 1)
						{
							format(str, sizeof(str), "%s\n",GetPlayerName(i));
						}
					}
				}
				ShowPlayerDialog(playerid, DIALOG_ONDUTY, DIALOG_STYLE_MSGBOX, "Police on duty", string, "Ok", "");
			}
			else if(listitem == 1)
			{
				for(new i=0;i<MAX_PLAYERS;i++)
				{
					if(PlayerInfo[playerid][pFaction] == 2)
					{
						if(GetPVarInt(i, "OnDuty") == 1)
						{
							format(str, sizeof(str), "%s\n",GePlayertName(i));
						}
					}
				}
				ShowPlayerDialog(playerid, DIALOG_ONDUTY, DIALOG_STYLE_MSGBOX, "Medics on duty", str, "Ok", "");
			}
		}
	}
now will work...
Reply
#3

I tried so
Код:
switch(dialogid)
	{
		case DIALOG_FACOD:
		{
			if(!response) return 0;
			new str[128];
			if(listitem == 0)
			{
				for(new i=0;i<MAX_PLAYERS;i++)
				{
					if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pFaction] == 1)
					{
						if(GetPVarInt(i, "OnDuty") == 1)
						{
							format(str, sizeof(str), "%s \n", GetPlayerName(i));
						}
					}
				}
				ShowPlayerDialog(playerid, DIALOG_ONDUTY, DIALOG_STYLE_MSGBOX, "Police on duty", str, "Ok", "");
			}
			else if(listitem == 1)
			{
				for(new i=0;i<MAX_PLAYERS;i++)
				{
					if(PlayerInfo[playerid][pFaction] == 2)
					{
						if(GetPVarInt(i, "OnDuty") == 1)
						{
							format(str, sizeof(str), "%s \n",GetPlayerName(i));
						}
					}
				}
				ShowPlayerDialog(playerid, DIALOG_ONDUTY, DIALOG_STYLE_MSGBOX, "Medics on duty", str, "Ok", "");
			}
		}
	}
but it doesn't work
Reply
#4

Dialog is empty? Screenshot it
Reply
#5

PHP код:
new name[128];
GetPlayerName(,namesizeof(name)); 
Rep +
Reply


Forum Jump:


Users browsing this thread: