SA-MP Forums Archive
Command HELP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command HELP (/showthread.php?tid=646693)



Command HELP - Cutiexoxo - 21.12.2017

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;

}



Re: Command HELP - Ritzy2K - 21.12.2017

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


Re: Command HELP - Cutiexoxo - 21.12.2017

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


Re: Command HELP - Cutiexoxo - 21.12.2017

@dani16 Thank you so much that much better +Rep


Re: Command HELP - Sew_Sumi - 21.12.2017

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.


Re: Command HELP - Sew_Sumi - 21.12.2017

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.