SA-MP Forums Archive
/vips - 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: /vips (/showthread.php?tid=313599)



/vips - geerdinho8 - 26.01.2012

How to make a /vips command

My enum is:

pInfo[playerid][VIP]


You'll earn rep


Re: /vips - Bogdan1992 - 26.01.2012

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




Re: /vips - milanosie - 26.01.2012

Код:
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;
}



Re: /vips - geerdinho8 - 26.01.2012

Awesome!


Re: /vips - milanosie - 26.01.2012

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


Re: /vips - geerdinho8 - 26.01.2012

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


Re: /vips - Daniel_Ram - 26.01.2012

thanks guys this helped me out a lot toooo