Listing V.I.P members
#1

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

How can i do this?


(PlayerInfo[playerid][Premium])
Reply
#2

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;
}
Reply
#3

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;
}
Reply
#4

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

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^^
Reply
#6

Oh that's what I wanted to hear
Reply
#7

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

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^^
Reply
#9

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?
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)