CMD:vips(playerid) { new ContarVIPs = 0; new StringCat[1000]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { format(Str, sizeof(Str), "{00FFFF}%s {FFFFFF}[{00FFFF}%i{FFFFFF}]\n", PlayerName(i), i); strcat(StringCat, Str); ContarVIPs++; } } if(ContarVIPs == 0) ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}VIPs Online [{FF0000} 0{FFFFFF}]", "{FF0000}Nenhum VIP online!", "Fechar", #); else if(ContarVIPs == 1) ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}VIP Online [{00BFFF} 1 {FFFFFF}]", StringCat, "Fechar", #); else { format(Str, sizeof(Str), "{FFFFFF}VIPs Online [{00BFFF} %d {FFFFFF}]", ContarVIPs); ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, Str, StringCat, "Fechar", #); } return 1; } |
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { format(Str, sizeof(Str), "{00FFFF}%s {FFFFFF}[{00FFFF}%i{FFFFFF}]\n", PlayerName(i), i); strcat(StringCat, Str); ContarVIPs++;
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && IsPlayerVip(i)) { format(Str, sizeof(Str), "{00FFFF}%s {FFFFFF}[{00FFFF}%i{FFFFFF}]\n", PlayerName(i), i); strcat(StringCat, Str); ContarVIPs++;
Sim, em minha gamemode o sistema vip й feito da seguinte forma, IsPlayerVIP, vou fazer isto que vocк falou, obrigado !
+REP! |
Код:
if(!strcmp(cmdtext, "/VIPs", true)) { SCM(playerid, COR_BARRAS, "» Todos os VIP's online:"); new count=0; for(new i=0; i<MAX_PLAYERS; i++) { if(Player[i][pLogged] == true) { if(Player[i][ContarVIPs] == 1) { if(IsPlayerConnected(i)) { new str[256]; new pname[24]; GetPlayerName(i, pname, 24); format(str, 256, "{FFFFFF}VIPs Online [{00BFFF} %s {FFFFFF}]", pname"); SCM(playerid, 0xE3E3E3FF, str); count++; } } } } if(count == 0) { SCM(playerid, 0xD8D8D8FF, "Nгo tem nenhum VIP online agora!"); } return 1; } |