A little help
#1

So i made this /stats command, and it works perfectly. But this is how it looks:
Код:
Cash: 25000$
Admin: 4
Score: 10
Permission: 1
And i want instead of number to appear [Yes or No], like this:

Код:
Cash: 25000$
Admin: Yes
Score: 10
Permission: Yes
This is my command:
Код:
CMD:stats(playerid,params[])
{
	    new string[128], stats[1024];
	    format(string,sizeof(string),"**- Cash: $ %d /n Score: %d /n Admin: %d /n VIP: %d /n Wanted: %d /n Permission: %d -**",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pVIP],PlayerInfo[playerid][Wanted],PlayerInfo[playerid][pPermission]);
	    format(stats, sizeof stats, "%s", string);
	    ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBOX,"Account Information:",stats,"Ok","");
	return 1;
}
What should i add?
Reply
#2

Код:
CMD:stats(playerid,params[])
{
	    new string[128], stats[1024];
	    format(string,sizeof(string),"**- Cash: $ %d /n Score: %d /n Admin: %s /n VIP: %d /n Wanted: %d /n Permission: %d -**",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pScore],(PlayerInfo[playerid][pAdmin]!=0 ? "Yes" : "No"),PlayerInfo[playerid][pVIP],PlayerInfo[playerid][Wanted],PlayerInfo[playerid][pPermission]);
	    format(stats, sizeof stats, "%s", string);
	    ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBOX,"Account Information:",stats,"Ok","");
	return 1;
}
Reply
#3

Quote:
Originally Posted by Escobabe
Посмотреть сообщение
So i made this /stats command, and it works perfectly. But this is how it looks:
Код:
Cash: 25000$
Admin: 4
Score: 10
Permission: 1
And i want instead of number to appear [Yes or No], like this:

Код:
Cash: 25000$
Admin: Yes
Score: 10
Permission: Yes
This is my command:
Код:
CMD:stats(playerid,params[])
{
	    new string[128], stats[1024];
	    format(string,sizeof(string),"**- Cash: $ %d /n Score: %d /n Admin: %d /n VIP: %d /n Wanted: %d /n Permission: %d -**",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pVIP],PlayerInfo[playerid][Wanted],PlayerInfo[playerid][pPermission]);
	    format(stats, sizeof stats, "%s", string);
	    ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBOX,"Account Information:",stats,"Ok","");
	return 1;
}
What should i add?

PHP код:
CMD:stats(playerid,params[])
{
        new 
string[128], stats[1024], yesorno[12];
            switch(
PlayerInfo[playerid][pPermission])
            {
                case 
1yesorno "Yes";
                case 
0yesorno "No";
                default: 
yesorno "Uknown";
            }
        
format(string,sizeof(string),"**- Cash: $ %d /n Score: %d /n Admin: %d /n VIP: %d /n Wanted: %d /n Permission: %s -**",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pVIP],PlayerInfo[playerid][Wanted], yesorno);
        
format(statssizeof stats"%s"string);
        
ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBOX,"Account Information:",stats,"Ok","");
    return 
1;

Reply
#4

Quote:
Originally Posted by whadez
Посмотреть сообщение
Код:
	    format(string,sizeof(string),"**- Cash: $ %d /n Score: %d /n Admin: %s /n VIP: %d /n Wanted: %d /n Permission: %d -**",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pScore],(PlayerInfo[playerid][pAdmin]!=0 ? "Yes" : "No"),PlayerInfo[playerid][pVIP],PlayerInfo[playerid][Wanted],PlayerInfo[playerid][pPermission]);
Код:
C:\Users\Beni\Desktop\New folder\gamemodes\DGPP.pwn(2562) : error 001: expected token: "-string end-", but found "-identifier-"
Confused.
Reply
#5

Hi, try this:
PHP код:
 format(string,sizeof(string),"**- Cash: $ %d /n Score: %d /n Admin: %s /n VIP: %d /n Wanted: %d /n Permission: %d -**",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin]!="Yes" "No"),PlayerInfo[playerid][pVIP],PlayerInfo[playerid][Wanted],PlayerInfo[playerid][pPermission]) 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)