/stats cmd with showplayerdialog
#1

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!
Reply
#2

PHP код:
CMD:stats(playeridparams[])
{
    new 
string[500], title[32], playerName[MAX_PLAYER_NAME]; 
   
    
GetPlayerName(playeridplayerNamesizeof(playerName));
    
format(titlesizeof(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(playeridDIALOG_STATSDIALOG_STYLE_MSGBOXtitlestring"kill""");
    return 
true;

I recommend making a return name function.
Reply
#3

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
PHP код:
CMD:stats(playeridparams[])
{
    new 
string[500], title[32], playerName[MAX_PLAYER_NAME]; 
   
    
GetPlayerName(playeridplayerNamesizeof(playerName));
    
format(titlesizeof(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(playeridDIALOG_STATSDIALOG_STYLE_MSGBOXtitlestring"kill""");
    return 
true;

I recommend making a return name function.
oh i see didn't think of making it this way! thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)