PDA

View Full Version : A little help


Escobabe
01/10/2017, 08:16 PM
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_MSGBO X,"Account Information:",stats,"Ok","");
return 1;
}

What should i add?

whadez
01/10/2017, 08:19 PM
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_MSGBO X,"Account Information:",stats,"Ok","");
return 1;
}

Swankeh
01/10/2017, 08:21 PM
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_MSGBO X,"Account Information:",stats,"Ok","");
return 1;
}

What should i add?



CMD:stats(playerid,params[])
{
new string[128], stats[1024], yesorno[12];
switch(PlayerInfo[playerid][pPermission])
{
case 1: yesorno = "Yes";
case 0: yesorno = "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(stats, sizeof stats, "%s", string);
ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBO X,"Account Information:",stats,"Ok","");
return 1;
}

Escobabe
01/10/2017, 08:25 PM
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.

BreakStore
01/10/2017, 08:43 PM
Hi, try this:
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])