SA-MP Forums Archive
A little help - 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: A little help (/showthread.php?tid=642519)



A little help - Escobabe - 01.10.2017

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?


Re: A little help - whadez - 01.10.2017

Код:
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;
}



Re: A little help - Swankeh - 01.10.2017

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;




Re: A little help - Escobabe - 01.10.2017

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.


Re: A little help - BreakStore - 01.10.2017

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])