Posts: 570
Threads: 55
Joined: Oct 2016
PHP код:
CMD:viplist(playerid, params[])
{
new count = 0, string[128];
for(new i = 0; i < MAX_PLAYERS; i ++)
{
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", "");
}
return 1;
}
is there any error anything something not normal with this code? if so hope you correct it for me
Posts: 1,046
Threads: 250
Joined: Nov 2014
Reputation:
0
Why didn't you compile it? The compiler would have told you.. anyway, I don't see anything wrong.
Posts: 570
Threads: 55
Joined: Oct 2016
Yes, that's the point i have compiled it, no errors no warnings allthings is clean...
but when i types it it show
There isn't any online vip... while there are..
Posts: 1,506
Threads: 13
Joined: Jun 2015
PHP код:
#if defined Loop
#undef Loop(%1)
#endif
#define Loop(%1) for(new %1 = GetPlayerPoolSize(); %1 != -1; %1 --) if(IsPlayerConnected(%1))
CMD:viplist(playerid)
{
new count;
Loop(i)
{
if(PlayerInfo[i][pVIP])
{
format(string, sizeof string, "- {ffff00}%s{00ff00}| {0066ff}(ID:%s) {00ff00}| %x %s\n", GetName(i), i, GetVipColor(i), GetVipLevel(i));
strcat(string, string, sizeof string);
count += 1;
}
}
if(!count) return ShowPlayerDialog(playerid, 18, DIALOG_STYLE_MSGBOX, "{00ff00}Online VIPs:","There isn't any online V.I.P", "Ok", "");
else return ShowPlayerDialog(playerid, 18, DIALOG_STYLE_MSGBOX, "{00ff00}Online VIPs:",string, "Okay", "");
}
GetVipLevel(playerid)
{
new str[10];
switch(PlayerInfo[playerid][pVIP])
{
case 0: str = "None";
case 1: str = "Bronze";
case 2: str = "Silver";
case 3: str = "Gold";
}
return str;
}
GetVipColor(playerid)
{
new str[10];
switch(PlayerInfo[playerid][pVIP])
{
case 1: str = "{996600}";
case 2: str = "{adad85}";
case 3: str = "{e68a00}";
}
return str;
}
Posts: 570
Threads: 55
Joined: Oct 2016
Fixed.
Thanks for you support