[PEDIDO] Contador de CLГNS Online! -
.Skool_. - 18.09.2011
У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!
Re: [PEDIDO] Contador de CLГNS Online! -
[NWD]Jim._.Carrey - 18.09.2011
Hum, precisamos saber as variбveis do seu sistema de clг, mais nгo seria ver membros ON o.O?
Re: [PEDIDO] Contador de CLГNS Online! -
.Skool_. - 18.09.2011
Quote:
Originally Posted by [NWD]Jim._.Carrey
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!
Re: [PEDIDO] Contador de CLГNS Online! -
[NWD]Jim._.Carrey - 18.09.2011
Quote:
Originally Posted by .Skool_.
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г.
Re: [PEDIDO] Contador de CLГNS Online! -
Nake01 - 18.09.2011
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;
}
Re: [PEDIDO] Contador de CLГNS Online! -
.Skool_. - 18.09.2011
Quote:
Originally Posted by Nake01
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...
Re: [PEDIDO] Contador de CLГNS Online! -
Vai_Besta - 18.09.2011
Use o cima ali como base
Re: [PEDIDO] Contador de CLГNS Online! -
CyNiC - 18.09.2011
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;
}
Re: [PEDIDO] Contador de CLГNS Online! -
.Skool_. - 19.09.2011
Quote:
Originally Posted by CyNiC
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!
Re: [PEDIDO] Contador de CLГNS Online! -
Nake01 - 19.09.2011
Quote:
Originally Posted by .Skool_.
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] ?
Re: [PEDIDO] Contador de CLГNS Online! -
.Skool_. - 19.09.2011
Quote:
Originally Posted by Nake01
Como assim pela TAG, Ex: [SA] ?
|
Й sim!
Re: [PEDIDO] Contador de CLГNS Online! -
Nake01 - 19.09.2011
Desculpa amigo mais nгo entendi tem algum print pra facilitar :/
Re: [PEDIDO] Contador de CLГNS Online! -
CyNiC - 19.09.2011
"Fail", com um post desse parece que vocк quer mesmo ser ajudado, nenhuma informaзгo alйm de que nгo funcionou?
Re: [PEDIDO] Contador de CLГNS Online! -
.Skool_. - 20.09.2011
Quote:
Originally Posted by Nake01
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)
Re: [PEDIDO] Contador de CLГNS Online! -
ViniBorn - 20.09.2011
Vocк quer saber todos os clгs online, ou um especнfico?
Re: [PEDIDO] Contador de CLГNS Online! -
Nake01 - 20.09.2011
Troque PlayerInfo pela sua variavel
Re: [PEDIDO] Contador de CLГNS Online! -
Vai_Besta - 20.09.2011
Quote:
Originally Posted by .Skool_.
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
Re: [PEDIDO] Contador de CLГNS Online! -
Nake01 - 20.09.2011
Concordo plenamente !