06.02.2017, 10:59
Yes there is:
- Consider my vip level is 4 then
Код:if(PlayerInfo[i][pVIP] >= 1) { format(string, sizeof(string),"- {ffff00}%s{00ff00}| {0066ff}(ID:%s) {00ff00}| {996600}Bronze V.I.P\n", GetName(i), i); count++; } if(PlayerInfo[i][pVIP] >= 2) { format(string, sizeof(string),"- {ffff00}%s {00ff00}| {0066ff}(ID:%d) {00ff00}| {adad85}Silver V.I.P\n", GetName(i), i); count++; } if(PlayerInfo[i][pVIP] >= 3) { format(string, sizeof(string),"- {ffff00}%s {00ff00}| {0066ff}(ID:%d) {00ff00}| {e68a00}GOLD V.I.P\n", GetName(i), i); count++; }
- Next thing is use of general looping mechanism use foreach with Player iterator instead.
- Код:
if(IsPlayerConnected(i)) { if(PlayerInfo[i][pVIP] >= 1) { format(string, sizeof(string),"- {ffff00}%s{00ff00}| {0066ff}(ID:%s) {00ff00}| {996600}Bronze V.I.P\n", GetName(i), i); count++; } if(PlayerInfo[i][pVIP] >= 2) { format(string, sizeof(string),"- {ffff00}%s {00ff00}| {0066ff}(ID:%d) {00ff00}| {adad85}Silver V.I.P\n", GetName(i), i); count++; } if(PlayerInfo[i][pVIP] >= 3) { format(string, sizeof(string),"- {ffff00}%s {00ff00}| {0066ff}(ID:%d) {00ff00}| {e68a00}GOLD V.I.P\n", GetName(i), i); count++; }
- Код:
if(count == 0) { ShowPlayerDialog(playerid, 18, DIALOG_STYLE_MSGBOX,"{00ff00}Online V.I.P(s):",string, "Ok", ""); } else { ShowPlayerDialog(playerid, 18, DIALOG_STYLE_MSGBOX,"{00ff00}Online V.I.P(s):","There isn't any online V.I.P", "Ok", ""); }