/stats cmd with showplayerdialog - 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: /stats cmd with showplayerdialog (
/showthread.php?tid=636388)
/stats cmd with showplayerdialog -
MrCesar - 26.06.2017
hey guys, i've got this cmd...but I can't figure out how to make the title of the dialog include a name..
how do i make the title say showing stats etc for (name)?
here's the cmd:
Код:
CMD:stats(playerid, params[])
{
new string[500];
format(string,sizeof(string),"[General] - [Money: %d] | [Deaths: %d] | [Kills: %d] | [Score: %d] | [Admin Level: %d]",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin]);
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "stats", string, "kill", "");
return 1;
}
thanks in advance!
Re: /stats cmd with showplayerdialog -
Kane - 26.06.2017
PHP код:
CMD:stats(playerid, params[])
{
new string[500], title[32], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, sizeof(playerName));
format(title, sizeof(title), "%s", playerName);
format(string,sizeof(string),"[General] - [Money: %d] | [Deaths: %d] | [Kills: %d] | [Score: %d] | [Admin
Level: %d]",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid]
[pKills],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin]);
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, title, string, "kill", "");
return true;
}
I recommend making a return name function.
Re: /stats cmd with showplayerdialog -
MrCesar - 26.06.2017
Quote:
Originally Posted by Arthur Kane
PHP код:
CMD:stats(playerid, params[])
{
new string[500], title[32], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, sizeof(playerName));
format(title, sizeof(title), "%s", playerName);
format(string,sizeof(string),"[General] - [Money: %d] | [Deaths: %d] | [Kills: %d] | [Score: %d] | [Admin
Level: %d]",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid]
[pKills],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin]);
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, title, string, "kill", "");
return true;
}
I recommend making a return name function.
|
oh i see didn't think of making it this way! thanks