23.12.2013, 22:06
Tried to make 2 string showing with ternary operator, so if
PlayerInfo[playerid][pBizz] differs from 999 (INVALID_BIZ_ID)
text would be 'No', otherwise should show up 'Yes'
I got error, I am pretty noob with the ternary operator, so if someone could help me I'll appreciate it.
PlayerInfo[playerid][pBizz] differs from 999 (INVALID_BIZ_ID)
text would be 'No', otherwise should show up 'Yes'
I got error, I am pretty noob with the ternary operator, so if someone could help me I'll appreciate it.
pawn Code:
YCMD:stats(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
return SCM(playerid, COLOR_PURPLE, ""gray" * Cant use this command while being driver !");
new biss[4], car[4];
format( biss, 4, "%s", ( PlayerInfo[playerid][pBizz] != INVALID_BIZZ_ID ) ? "Yes" : "No");
// error 001: expected token: "-string end-", but found "-identifier-"
format( car, 4, "%s", ( PlayerInfo[playerid][pCar] != INVALID_CAR_ID ) ? "Yes" : "No");
// error 001: expected token: "-string end-", but found "-identifier-"
new string[300];
format(string, sizeof(string),
""yellow"|E-mail: "white"%s"yellow" |Level: "white"%d"yellow" |Cash: "white"%d"yellow" |BankAccount: "white"%d\n\
"yellow"|PhNumber: "white"%d"yellow" |PhAcc: "white"%d"yellow" |PayExp: "white"%d/20 "yellow"|Pays had: "white"%d\n\
"yellow"|Bizz: "white"%s"yellow" |Car: "white"%s\n\
"yellow"|Last log: "white"%s",
PlayerInfo[playerid][pEmail], PlayerInfo[playerid][pLevel], SafeGetPlayerMoney(playerid),
PlayerInfo[playerid][pBankAcc], PlayerInfo[playerid][pPhoneNr], PlayerInfo[playerid][pPhoneAcc], PlayerInfo[playerid][pPayExp], PlayerInfo[playerid][pPaysHad], biss, car,
PlayerInfo[playerid][pLastLog]);
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Info", string, "Ok", "");
return 1;
}