Command HELP
#1

Hi guys i am trying to make /vips command to see the online vips but when i type it it shows all online players as Vips
Код:
CMD:vips(playerid, params[])
{
        new vipstring[2000],count=0;
        if(IsPlayerConnected(playerid))
        {
            for (new i = 0; i < MAX_PLAYERS; i++)
                {
                if(vipmember[playerid] = 0)
                    {
                        format(vipstring, sizeof(vipstfring),"{ffffff}%s (ID:%d)\n", vipstring, RPN(i), playerid);
                        count++;
                    }
                }
            }
            ShowPlayerDialog(playerid, 117,DIALOG_STYLE_MSGBOX,"{B266FF}Online VIPs:",vipstring,"Close","");
        }
        return SendClientMessage(playerid,COLOR_RED,"There are no VIP's online.");
        return 1;

}
Reply
#2

I think there is absolutely no use for count variable, since you're not displaying the total number of VIP's.

Aaaand your issue lies here -
Код:
if(vipmember[i] > 0)
playerid is the wrong id
Reply
#3

@Ritzy Thank you soooooo much for the help +Rep for sure
Reply
#4

@dani16 Thank you so much that much better +Rep
Reply
#5

dani16, can you stop just posting up code without any explanation or any attempt to even teach the user.

All you're doing is simply handing out code to people who ask for it, which isn't what this forum is for, nor does it benefit the user at all in the long term.
Reply
#6

Quote:
Originally Posted by dani16
Посмотреть сообщение
Na, all i did was match my code with the one i had at a certain point and add some things of mine.
That, has no relevance to my statement.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)