[PEDIDO] Contador de CLГNS Online!
#1

Уla, eu queria um acontador de clгns online!
Se a pessoa usar /clanson ele indentifica pelo o [].. Por exemplo
pawn Code:
Clгns Online: [Teste] - 2 //2 Pessoas online deste clгn!!
Se poderem me ajudar.. GRATO!
Reply
#2

Hum, precisamos saber as variбveis do seu sistema de clг, mais nгo seria ver membros ON o.O?
Reply
#3

Quote:
Originally Posted by [NWD]Jim._.Carrey
View Post
Hum, precisamos saber as variбveis do seu sistema de clг, mais nгo seria ver membros ON o.O?
Nгo, seria saber quantas pessoas estгo online do clгn!
Reply
#4

Quote:
Originally Posted by .Skool_.
View Post
Nгo, seria saber quantas pessoas estгo online do clгn!
E o que eu disse? ._.

Vocк usa algum sistema de clг que foi postado no fуrum ou й prуprio seu?

Posta as variбveis que armazena os membros do clг.
Reply
#5

Ver se й mais ou menos isto:
pawn Code:
if(!strcmp(cmdtext, "/clanson", true))
        {
            SendClientMessage(playerid, 0x00FF00FF, "#### CLANS ONLINE ####");
                new count=0;
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][Ballas] >= 1 || PlayerInfo[i][Aztecas] >= 1 || PlayerInfo[i][Grove] >= 1 || PlayerInfo[i][Vagos] >= 1)
                    {
                        new cargo[20];
                        if(PlayerInfo[i][Ballas] >= 1) cargo = "Ballas";
                        if(PlayerInfo[i][Aztecas] >= 1) cargo = "Aztecas";
                        if(PlayerInfo[i][Grove] >= 3) cargo = "Grove";
                        if(PlayerInfo[i][Vagos] >= 4) cargo = "Vagos";
                        new str[100];
                        format(str, sizeof(str), "{FF0000}%s {C0C0C0}- %d",cargo, count);
                        SendClientMessage(playerid, 0xC0C0C0FF, str);
                        count++;
                        }
                    }
                }
                if(count == 0)
                {
                    SendClientMessage(playerid, 0xFF0000FF, "Nenhum Membro de Clan Online.");
                }
                return 1;
        }
Reply
#6

Quote:
Originally Posted by Nake01
View Post
Ver se й mais ou menos isto:
pawn Code:
if(!strcmp(cmdtext, "/clanson", true))
        {
            SendClientMessage(playerid, 0x00FF00FF, "#### CLANS ONLINE ####");
                new count=0;
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][Ballas] >= 1 || PlayerInfo[i][Aztecas] >= 1 || PlayerInfo[i][Grove] >= 1 || PlayerInfo[i][Vagos] >= 1)
                    {
                        new cargo[20];
                        if(PlayerInfo[i][Ballas] >= 1) cargo = "Ballas";
                        if(PlayerInfo[i][Aztecas] >= 1) cargo = "Aztecas";
                        if(PlayerInfo[i][Grove] >= 3) cargo = "Grove";
                        if(PlayerInfo[i][Vagos] >= 4) cargo = "Vagos";
                        new str[100];
                        format(str, sizeof(str), "{FF0000}%s {C0C0C0}- %d",cargo, count);
                        SendClientMessage(playerid, 0xC0C0C0FF, str);
                        count++;
                        }
                    }
                }
                if(count == 0)
                {
                    SendClientMessage(playerid, 0xFF0000FF, "Nenhum Membro de Clan Online.");
                }
                return 1;
        }
Quase isto, so que eu quero que ele ja endentifica pelo o [] , sem terde colocar os clгns no gm...
Reply
#7

Use o cima ali como base
Reply
#8

Apenas uma base, й provбvel que alguma coisa dк errado.

pawn Code:
GetClansCount()
{
    new Name[MAX_PLAYER_NAME], ClansCount, Pos[2], Clans[50][MAX_PLAYER_NAME/2];
    for(new i = 0, j = GetMaxPlayers(), k; i < j; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerName(i, Name, sizeof Name);
            Pos[0] = strfind(Name, "[");
            Pos[1] = strfind(Name, "]");
            if(Pos[0] != -1 && Pos[1] != -1 && (Pos[1] - Pos[0]) >= 1)
            {
                strmid(Clans[i], Name, Pos[0], Pos[1] + 1, MAX_PLAYER_NAME/2);
            }
            k = 0;
            while(strlen(Clans[k]))
            {
                if(strcmp(Clans[k], Clans[i], false) != 0) ClansCount++;
                k++;
            }
        }
    }
    return ClansCount;
}
pawn Code:
GetClanMembersCount(const clanname[])
{
    #define MAX_CLANS 50
    new Name[MAX_PLAYER_NAME], Count, Pos[2], Clans[MAX_CLANS][MAX_PLAYER_NAME/2];
    for(new i = 0, j = GetMaxPlayers(), l, playerclan; i < j; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerName(i, Name, sizeof Name);
            Pos[0] = strfind(Name, "[");
            Pos[1] = strfind(Name, "]");
            if(Pos[0] != -1 && Pos[1] != -1 && (Pos[1] - Pos[0]) >= 1)
            {
                for(l = 0; l < sizeof Clans; l++) if(!strlen(Clans[l])) playerclan = l, l = (sizeof Clans);
                strmid(Clans[playerclan], Name, Pos[0], Pos[1] + 1, MAX_PLAYER_NAME/2);
                if(!strcmp(clanname, Clans[playerclan], false))
                {
                    Count++;
                    continue;
                }
            }
        }
    }
    return Count;
}
Reply
#9

Quote:
Originally Posted by CyNiC
View Post
Apenas uma base, й provбvel que alguma coisa dк errado.

pawn Code:
GetClansCount()
{
    new Name[MAX_PLAYER_NAME], ClansCount, Pos[2], Clans[50][MAX_PLAYER_NAME/2];
    for(new i = 0, j = GetMaxPlayers(), k; i < j; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerName(i, Name, sizeof Name);
            Pos[0] = strfind(Name, "[");
            Pos[1] = strfind(Name, "]");
            if(Pos[0] != -1 && Pos[1] != -1 && (Pos[1] - Pos[0]) >= 1)
            {
                strmid(Clans[i], Name, Pos[0], Pos[1] + 1, MAX_PLAYER_NAME/2);
            }
            k = 0;
            while(strlen(Clans[k]))
            {
                if(strcmp(Clans[k], Clans[i], false) != 0) ClansCount++;
                k++;
            }
        }
    }
    return ClansCount;
}
pawn Code:
GetClanMembersCount(const clanname[])
{
    #define MAX_CLANS 50
    new Name[MAX_PLAYER_NAME], Count, Pos[2], Clans[MAX_CLANS][MAX_PLAYER_NAME/2];
    for(new i = 0, j = GetMaxPlayers(), l, playerclan; i < j; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerName(i, Name, sizeof Name);
            Pos[0] = strfind(Name, "[");
            Pos[1] = strfind(Name, "]");
            if(Pos[0] != -1 && Pos[1] != -1 && (Pos[1] - Pos[0]) >= 1)
            {
                for(l = 0; l < sizeof Clans; l++) if(!strlen(Clans[l])) playerclan = l, l = (sizeof Clans);
                strmid(Clans[playerclan], Name, Pos[0], Pos[1] + 1, MAX_PLAYER_NAME/2);
                if(!strcmp(clanname, Clans[playerclan], false))
                {
                    Count++;
                    continue;
                }
            }
        }
    }
    return Count;
}
Fail!
Reply
#10

Quote:
Originally Posted by .Skool_.
View Post
Quase isto, so que eu quero que ele ja endentifica pelo o [] , sem terde colocar os clгns no gm...
Como assim pela TAG, Ex: [SA] ?
Reply
#11

Quote:
Originally Posted by Nake01
View Post
Como assim pela TAG, Ex: [SA] ?
Й sim!
Reply
#12

Desculpa amigo mais nгo entendi tem algum print pra facilitar :/
Reply
#13

"Fail", com um post desse parece que vocк quer mesmo ser ajudado, nenhuma informaзгo alйm de que nгo funcionou?
Reply
#14

Quote:
Originally Posted by Nake01
View Post
Ver se й mais ou menos isto:
pawn Code:
if(!strcmp(cmdtext, "/clanson", true))
        {
            SendClientMessage(playerid, 0x00FF00FF, "#### CLANS ONLINE ####");
                new count=0;
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][Ballas] >= 1 || PlayerInfo[i][Aztecas] >= 1 || PlayerInfo[i][Grove] >= 1 || PlayerInfo[i][Vagos] >= 1)
                    {
                        new cargo[20];
                        if(PlayerInfo[i][Ballas] >= 1) cargo = "Ballas";
                        if(PlayerInfo[i][Aztecas] >= 1) cargo = "Aztecas";
                        if(PlayerInfo[i][Grove] >= 3) cargo = "Grove";
                        if(PlayerInfo[i][Vagos] >= 4) cargo = "Vagos";
                        new str[100];
                        format(str, sizeof(str), "{FF0000}%s {C0C0C0}- %d",cargo, count);
                        SendClientMessage(playerid, 0xC0C0C0FF, str);
                        count++;
                        }
                    }
                }
                if(count == 0)
                {
                    SendClientMessage(playerid, 0xFF0000FF, "Nenhum Membro de Clan Online.");
                }
                return 1;
        }
ERROS:

pawn Code:
error 017: undefined symbol "PlayerInfo"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Compilation aborted.
Compilation aborted.Pawn compiler 3.2.3664                          Copyright (c) 1997-2006, ITB CompuPhase
LINHA:
pawn Code:
if(PlayerInfo[i][Ballas] >= 1 || PlayerInfo[i][Aztecas] >= 1 || PlayerInfo[i][Grove] >= 1 || PlayerInfo[i][Vagos] >= 1)
Reply
#15

Vocк quer saber todos os clгs online, ou um especнfico?
Reply
#16

Troque PlayerInfo pela sua variavel
Reply
#17

Quote:
Originally Posted by .Skool_.
View Post
ERROS:

pawn Code:
error 017: undefined symbol "PlayerInfo"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Compilation aborted.
Compilation aborted.Pawn compiler 3.2.3664                          Copyright (c) 1997-2006, ITB CompuPhase
LINHA:
pawn Code:
if(PlayerInfo[i][Ballas] >= 1 || PlayerInfo[i][Aztecas] >= 1 || PlayerInfo[i][Grove] >= 1 || PlayerInfo[i][Vagos] >= 1)
Amigo nгo й so copiar e colar tem que adapta-lo ao seu gm
Reply
#18

Concordo plenamente !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)