Command doesn't show the dialog -
Stoyanov - 02.11.2014
When i type it.... nothing.
Код:
if (strcmp(cmdtext, "/richlist") == 0)
{
new sendername[MAX_PLAYER_NAME], string[128];
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerMoney(i) >= 25000000)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Cash: %d\n", sendername, GetPlayerMoney(i));
ShowPlayerDialog(playerid, 5197, DIALOG_STYLE_MSGBOX, "Rich Players", string, "Close" "");
}
}
return 1;
}
Thanks.
Re: Command doesn't show the dialog -
Adarsh007 - 02.11.2014
Add this on top of gamemode
#define DIALOG_RICHLIST 3133
then OnPlayerCommandText
Код:
if (strcmp(cmdtext, "/richlist") == 0)
{
new sendername[MAX_PLAYER_NAME], string[128];
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerMoney(i) >= 25000000)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Cash: %d\n", sendername, GetPlayerMoney(i));
ShowPlayerDialog(playerid, DIALOG_RICHLIST, DIALOG_STYLE_MSGBOX, "Rich Players", string, "Close" "");
}
}
return 1;
}
Give it a Try
Re: Command doesn't show the dialog -
Stoyanov - 02.11.2014
Still doesn't work.
Re: Command doesn't show the dialog -
GGRoleplay - 02.11.2014
You forgot the , between the "Close" and the ""
Here's how it needs to be
ShowPlayerDialog(playerid, 5197, DIALOG_STYLE_MSGBOX, "Rich Players", string, "Close", "");
Re: Command doesn't show the dialog -
Stoyanov - 02.11.2014
oohh.. Yea
Thanks : )
AND:
This is the right code:
Код:
if (strcmp(cmdtext, "/richlist") == 0)
{
new sendername[MAX_PLAYER_NAME], string[128];
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerMoney(i) >= 25000000)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Cash: %d\n", sendername, GetPlayerMoney(i));
}
}
ShowPlayerDialog(playerid, 3133, DIALOG_STYLE_MSGBOX, "Rich Players", string, "Close", "");
return 1;
}
The dialog must be outsite from the "for" looping !
Re: Command doesn't show the dialog -
GGRoleplay - 02.11.2014
If you need any more help feel free to ask
Re: Command doesn't show the dialog -
M0HAMMAD - 02.11.2014
pawn Код:
if (strcmp(cmdtext, "/richlist") == 0)
{
new sendername[MAX_PLAYER_NAME], string[128];
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerMoney(i) >= 25000000)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Cash: %d\n", sendername, GetPlayerMoney(i));
ShowPlayerDialog(playerid, DIALOG_RICHLIST, DIALOG_STYLE_MSGBOX, "Rich Players", string, "Close","");
}
}
return 1;
}
Re: Command doesn't show the dialog -
Capua - 02.11.2014
Btw, use
easyDialog to make creating dialogs easier!
Re: Command doesn't show the dialog -
Stoyanov - 03.11.2014
Thanks again : )
Re: Command doesn't show the dialog -
Stoyanov - 03.11.2014
I need some help. I want to make the cash value with Float, but i don't know how?