#1

How to make a /vips command

My enum is:

pInfo[playerid][VIP]


You'll earn rep
Reply
#2

PHP код:
CMD:vips(playerid,  params[]) 

    new 
pname[24], string[128]; 
    new 
vips 0
    
SendClientMessage(playerid,COLOR_WHITE,"-------------------------VIP's Online-------------------------"); 
    for(new 
0MAX_PLAYERSi++){ 
        if (
IsPlayerConnected(i)){ 
            if(
pInfo[playerid][VIP]){ 
                
GetPlayerName(ipname24); 
                
format(string,sizeof string,"%s - VIP"pname); 
                
SendClientMessage(playerid,-1,string); 
                
vips ++; 
            } 
        } 
    } 
    if(
vips== 0){ 
        
SendClientMessage(playeridCOLOR_WHITE"Currently there are no vips online."); 
      } 
    return 
1

Reply
#3

Код:
CMD:vips(playerid, params[])
{
    new string[128], acount = 0, Name[MAX_PLAYER_NAME];
    foreach(Player, i) {
        if(pInfo[i][VIP] == 1) {
            acount++;
        }
    }
    if(acount > 0) {
        SendClientMessage(playerid, 0xD8D8D8FF, "Online VIP's");
        foreach(Player, i) {
            if(pInfo[i][VIP] == 1) {
                GetPlayerName(i, Name, sizeof(Name));
                format(string, sizeof string, "VIP: %s", Name);
                SendClientMessage(playerid, 0xD8D8D8FF, string);
            }
        }
        format(string, sizeof string, "Total VIP's online: %d.", acount);
        SendClientMessage(playerid, -1, string);
    }
    else if(acount < 1) SendClientMessage(playerid, 0xD8D8D8FF, "There are no VIP's online!");
    return 1;
}
Reply
#4

Awesome!
Reply
#5

Quote:
Originally Posted by geerdinho8
Посмотреть сообщение
Awesome, can you make one too for admins

pawn Код:
pInfo[i][Admin]
I tried myself but it didnt work.
just do the same and change the defines
Reply
#6

Quote:
Originally Posted by milanosie
Посмотреть сообщение
just do the same and change the defines
Yes, i did that and i worked this time, thanks both.
Reply
#7

thanks guys this helped me out a lot toooo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)