Cash: 25000$ Admin: 4 Score: 10 Permission: 1
Cash: 25000$ Admin: Yes Score: 10 Permission: Yes
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; }
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; }
So i made this /stats command, and it works perfectly. But this is how it looks:
Код:
Cash: 25000$ Admin: 4 Score: 10 Permission: 1 Код:
Cash: 25000$ Admin: Yes Score: 10 Permission: Yes Код:
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; } |
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_MSGBOX,"Account Information:",stats,"Ok","");
return 1;
}
Код:
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-"
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])