17.02.2015, 16:37
Hello.
I've just made a /vips command, wich will show online vips.
But there's a bug/issue, I can't find.
Everytime I do command: /vips, if there's 0 online players I doesn't receive ERROR message, and it shows me as Special VIP, level 3, even if i'm not vip.
If there's can be a problem with my GetPlayerVip command, then here you go:
Cheers,
+Rep for helper!
I've just made a /vips command, wich will show online vips.
But there's a bug/issue, I can't find.
Everytime I do command: /vips, if there's 0 online players I doesn't receive ERROR message, and it shows me as Special VIP, level 3, even if i'm not vip.
pawn Код:
CMD:vips(playerid, params[])
{
new vips[50], name[MAX_PLAYER_NAME], count;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(VipInfo[i][Vip] >= 1)
{
count++;
if(count == 0) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Nu este online niciun {15FF00}VIP.");
GetPlayerName(i, name, sizeof(name));
format(vips, sizeof(vips), "{FF9900}[%s]: {FF0000}%s {15FF00}(%d)\n", GetPlayerVip(i), name, VipInfo[i][Vip]);
ShowPlayerDialog(playerid, DIALOG_VIP, DIALOG_STYLE_MSGBOX, "{FFFFFF}Vipi online:", vips, "Iesi", "");
}
}
}
return 1;
}
pawn Код:
stock GetPlayerVip(playerid)
{
new vrank[40];
switch(VipInfo[playerid][Vip])
{
case 3: vrank = "Special VIP";
case 2: vrank = "Gold VIP";
case 1: vrank = "Silver VIP";
default: vrank = "NONE";
}
return vrank;
}
+Rep for helper!