I'm Beginner. So, Help Me Please...
#1

I make this command >
PHP код:
CMD:hgmembers(playeridparams[])
{
    
SendClientMessage(playeridlightblue" ");
    
SendClientMessage(playeridlightblue"___________ |- Online [HG] Clan Members -| ___________");
    
SendClientMessage(playeridlightblue" ");
    new 
count 0;
    for(new 
0MAX_PLAYERSi++)
    {
        if(!
IsPlayerConnected(i)) continue;
        if(!
PlayerInfo[i][HGRank]) continue;
        new 
string[90], playersname[MAX_PLAYER_NAME];
        
GetPlayerName(iplayersnamesizeof(playersname));
        switch(
PlayerInfo[i][HGRank])
        {
            case 
1format(stringsizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Newbie"PlayerInfo[i][HGRank], playersnamei);
            case 
2format(stringsizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Old Member"PlayerInfo[i][HGRank], playersnamei);
            case 
3format(stringsizeof(string), "{FFFF00}Rank: %d - %s (ID:%i) | Super Member"PlayerInfo[i][HGRank], playersnamei);
            case 
4format(stringsizeof(string), "{000000}Rank: %d - %s (ID:%i) | Professional Member"PlayerInfo[i][HGRank], playersnamei);
            case 
5format(stringsizeof(string), "{33CCFF}Rank: %d - %s (ID:%i) | Master Member"PlayerInfo[i][HGRank], playersnamei);
            case 
6format(stringsizeof(string), "{C0C0C0}Rank: %d - %s (ID:%i) | Elite Member"PlayerInfo[i][HGRank], playersnamei);
            case 
7format(stringsizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Co-Leader"PlayerInfo[i][HGRank], playersnamei);
            case 
8format(stringsizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Leader"PlayerInfo[i][HGRank], playersnamei);
            case 
9format(stringsizeof(string), "{FF9900}Rank: %d - %s (ID:%i) | Manager"PlayerInfo[i][HGRank], playersnamei);
            case 
10format(stringsizeof(string), "{AA3333}Rank: %d - %s (ID:%i) | Founder"PlayerInfo[i][HGRank], playersnamei);
            default: continue;
        }
        
SendClientMessage(playeridredstring);
        
count++;
    }
    if(!
countSendClientMessage(playeridlightblue"No [HG] Clan Members online in the list");
    
SendClientMessage(playeridlightblue"___________________________________________________");
    return 
1;

It's not show me the [HG] members who online, But just show me "No [HG] Clan Members online in the list".
Who can solve my problem, Please help me to solve it.
Thanks For Reading And God Bless You All
Reply
#2

Put
PHP код:
count++; 
somewhere between them:
PHP код:
for(new 0MAX_PLAYERSi++) { 
PHP код:
switch(PlayerInfo[i][HGRank]) { 
Reply
#3

Not work
Reply
#4

Maybe show us what you have done and doesn't work. Probably you haven't even tried.
Reply
#5

I can /setHG but not in member list
Reply
#6

PHP код:
CMD:hgmembers(playerid)
{
    
SendClientMessage(playeridlightblue" "); 
    
SendClientMessage(playeridlightblue"___________ |- Online [HG] Clan Members -| ___________"); 
    
SendClientMessage(playeridlightblue" "); 

    new 
onlineMembers;
    for(new 
pid 0pid MAX_PLAYERSpid++)
    {
        if((
IsPlayerConnected(pid) && (PlayerInfo[pid][HGRank] != 0)
        {
            
onlineMembers++;
            new 
string[90], playersname[MAX_PLAYER_NAME]; 
            
GetPlayerName(iplayersnamesizeof(playersname)); 
            switch(
PlayerInfo[pid][HGRank]) 
            { 
                case 
1format(stringsizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Newbie"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
2format(stringsizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Old Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
3format(stringsizeof(string), "{FFFF00}Rank: %d - %s (ID:%i) | Super Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
4format(stringsizeof(string), "{000000}Rank: %d - %s (ID:%i) | Professional Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
5format(stringsizeof(string), "{33CCFF}Rank: %d - %s (ID:%i) | Master Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
6format(stringsizeof(string), "{C0C0C0}Rank: %d - %s (ID:%i) | Elite Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
7format(stringsizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Co-Leader"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
8format(stringsizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Leader"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
9format(stringsizeof(string), "{FF9900}Rank: %d - %s (ID:%i) | Manager"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
10format(stringsizeof(string), "{AA3333}Rank: %d - %s (ID:%i) | Founder"PlayerInfo[pid][HGRank], playersnamepid); 
            } 
        }
    }

    if(
onlineMembers == 0)
        
SendClientMessage(playeridlightblue"No [HG] Clan Members online in the list"); 
    
SendClientMessage(playeridlightblue"___________________________________________________"); 
    return 
1;

Reply
#7

Not Work
It's show me like this >
___________|- Online [HG] Clan Members -|___________

_________________________________________________

Their's no my name added
Please fix it
Thanks
Reply
#8

PHP код:
CMD:hgmembers(playerid)
{
    
SendClientMessage(playeridlightblue" "); 
    
SendClientMessage(playeridlightblue"___________ |- Online [HG] Clan Members -| ___________"); 
    
SendClientMessage(playeridlightblue" "); 

    new 
onlineMembers;
    for(new 
pid 0pid MAX_PLAYERSpid++)
    {
        if((
IsPlayerConnected(pid) && (PlayerInfo[pid][HGRank] > 0) && (PlayerInfo[pid][HGRank] < 11))
        {
            
onlineMembers++;
            new 
string[90], playersname[MAX_PLAYER_NAME]; 
            
GetPlayerName(iplayersnamesizeof(playersname)); 
            switch(
PlayerInfo[pid][HGRank]) 
            { 
                case 
1format(stringsizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Newbie"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
2format(stringsizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Old Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
3format(stringsizeof(string), "{FFFF00}Rank: %d - %s (ID:%i) | Super Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
4format(stringsizeof(string), "{000000}Rank: %d - %s (ID:%i) | Professional Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
5format(stringsizeof(string), "{33CCFF}Rank: %d - %s (ID:%i) | Master Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
6format(stringsizeof(string), "{C0C0C0}Rank: %d - %s (ID:%i) | Elite Member"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
7format(stringsizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Co-Leader"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
8format(stringsizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Leader"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
9format(stringsizeof(string), "{FF9900}Rank: %d - %s (ID:%i) | Manager"PlayerInfo[pid][HGRank], playersnamepid); 
                case 
10format(stringsizeof(string), "{AA3333}Rank: %d - %s (ID:%i) | Founder"PlayerInfo[pid][HGRank], playersnamepid); 
            } 
        }
    }

    if(
onlineMembers == 0)
        
SendClientMessage(playeridlightblue"No [HG] Clan Members online in the list"); 
    
SendClientMessage(playeridlightblue"___________________________________________________"); 
    return 
1;

Reply
#9

Код:
CMD:hgmembers(playerid)
{
    SendClientMessage(playerid, lightblue, " "); 
    SendClientMessage(playerid, lightblue, "___________ |- Online [HG] Clan Members -| ___________"); 
    SendClientMessage(playerid, lightblue, " "); 

    new
		string[76],
		count;
    for(new i, j = GetPlayerPoolSize(); i <= j; i++)
    {
		if (!IsPlayerConnected(i) || !PlayerInfo[i][HGRank])
			continue;
			
		GetPlayerName(i, string, 24);
		switch (PlayerInfo[i][HGRank]) 
		{ 
			case 1: format(string, sizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Newbie", PlayerInfo[i][HGRank], string, i); 
			case 2: format(string, sizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Old Member", PlayerInfo[i][HGRank], string, i); 
			case 3: format(string, sizeof(string), "{FFFF00}Rank: %d - %s (ID:%i) | Super Member", PlayerInfo[i][HGRank], string, i); 
			case 4: format(string, sizeof(string), "{000000}Rank: %d - %s (ID:%i) | Professional Member", PlayerInfo[i][HGRank], string, i); 
			case 5: format(string, sizeof(string), "{33CCFF}Rank: %d - %s (ID:%i) | Master Member", PlayerInfo[i][HGRank], string, i); 
			case 6: format(string, sizeof(string), "{C0C0C0}Rank: %d - %s (ID:%i) | Elite Member", PlayerInfo[i][HGRank], string, i); 
			case 7: format(string, sizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Co-Leader", PlayerInfo[i][HGRank], string, i); 
			case 8: format(string, sizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Leader", PlayerInfo[i][HGRank], string, i); 
			case 9: format(string, sizeof(string), "{FF9900}Rank: %d - %s (ID:%i) | Manager", PlayerInfo[i][HGRank], string, i); 
			case 10: format(string, sizeof(string), "{AA3333}Rank: %d - %s (ID:%i) | Founder", PlayerInfo[i][HGRank], string, i);
			default: continue;
		}
                SendClientMessage(playerid, lightblue, string);
		count++;
    }
	if (!count) SendClientMessage(playerid, lightblue, "No [HG] Clan Members online in the list"); 
    SendClientMessage(playerid, lightblue, "___________________________________________________"); 
    return 1;
}
If this doesn't work, then there's something wrong with PlayerInfo[playerid][HGRank].
Reply
#10

All three posts with code above do not send the client message in the loop after formatting.

Quote:
Originally Posted by Filbert
Посмотреть сообщение
I can /setHG but not in member list
Post that command.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)