SA-MP Forums Archive
Listing V.I.P members - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Listing V.I.P members (/showthread.php?tid=128438)



Listing V.I.P members - xCoder - 17.02.2010

Hi , i want to list who is v.i.p member.

How can i do this?


(PlayerInfo[playerid][Premium])


Re: Listing V.I.P members - VonLeeuwen - 17.02.2010

It would be something like this:

pawn Код:
if(strcmp(cmd,"/vips",true) == 0)
{
     SendClientMessage(playerid,COLOR_RED, "Currently online VIPs:");
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][Premium] == 1)
        {
            new pName[MAX_PLAYER_NAME], string[128], count = 0;
            GetPlayerName(i,pName,sizeof(pName));
            format(string, sizeof(string), "[%s] %s", PlayerInfo[i][Premium]);
            SendClientMessage(playerid, COLOR_RED, string);
            count ++;
        }
        if(count == 0)
        {
            SendClientMessage(playerid,COLOR_RED, "No VIP members online!");
        }
    }
    return 1;
}



Re: Listing V.I.P members - saiberfun - 17.02.2010

Quote:
Originally Posted by VonLeeuwen
It would be something like this:

pawn Код:
if(strcmp(cmd,"/vips",true) == 0)
{
     SendClientMessage(playerid,COLOR_RED, "Currently online VIPs:");
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][Premium] == 1)
        {
            new pName[MAX_PLAYER_NAME], string[128], count = 0;
            GetPlayerName(i,pName,sizeof(pName));
            format(string, sizeof(string), "[%s] %s", PlayerInfo[i][Premium]); //failed here
            SendClientMessage(playerid, COLOR_RED, string);
            count ++;
        }
        if(count == 0)
        {
            SendClientMessage(playerid,COLOR_RED, "No VIP members online!");
        }
    }
    return 1;
}
almost

pawn Код:
if(strcmp(cmd,"/vips",true) == 0)
{
     SendClientMessage(playerid,COLOR_RED, "Currently online VIPs:");
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][Premium] == 1)
        {
            new pName[MAX_PLAYER_NAME], string[128], count = 0;
            GetPlayerName(i,pName,sizeof(pName));
            format(string, sizeof(string), "[%s] %s", i,pname);
            SendClientMessage(playerid, COLOR_RED, string);
            count ++;
        }
        if(count == 0)
        {
            SendClientMessage(playerid,COLOR_RED, "No VIP members online!");
        }
    }
    return 1;
}



Re: Listing V.I.P members - VonLeeuwen - 17.02.2010

Oh yea true, had just the name at first, but later I added the ID :$ I'm ashamed of my self.


Re: Listing V.I.P members - saiberfun - 17.02.2010

Quote:
Originally Posted by VonLeeuwen
Oh yea true, had just the name at first, but later I added the ID :$ I'm ashamed of my self.
u don't need to
it can happen^^


Re: Listing V.I.P members - VonLeeuwen - 17.02.2010

Oh that's what I wanted to hear


Re: Listing V.I.P members - xCoder - 17.02.2010

@┤ŞąiBЄЯҒПŋ├
does it work?


Re: Listing V.I.P members - saiberfun - 17.02.2010

Quote:
Originally Posted by CoverH.ng
@┤ŞąiBЄЯҒПŋ├
does it work?
it should tho im not sure if its
exactly how u want it because u didnt explain it really good^^
but it should do its work^^


Re: Listing V.I.P members - VonLeeuwen - 17.02.2010

pawn Код:
if(strcmp(cmd,"/vips",true) == 0) // if the player types /vips
{
     SendClientMessage(playerid,COLOR_RED, "Currently online VIPs:"); // sends 'Currently Online VIPs'
for(new i=0; i<MAX_PLAYERS; i++) // creates new loop 'i'
{
if(PlayerInfo[i][Premium] == 1) // is the i a VIP?
{
new pName[MAX_PLAYER_NAME], string[128], count = 0; // new things
GetPlayerName(i,pName,sizeof(pName)); // Get the name of the I
format(string, sizeof(string), "[%s] %s", i,pname); // Format his name
SendClientMessage(playerid, COLOR_RED, string); // Send the names to the playerid
count ++; // add 1 to count
}
if(count == 0) // if the count = 0
{
SendClientMessage(playerid,COLOR_RED, "No VIP members online!"); // there are no vips online
}
}
return 1;
}
Explained enough?



Re: Listing V.I.P members - saiberfun - 17.02.2010

Quote:
Originally Posted by VonLeeuwen
Explained enough?
i meant him how he wants it :P