[AJUDA] Guardiгo -
guilhermeghc@hotmail.com - 20.01.2012
Galera meu servidor tem os guardiхes, mais quando eu coloco /guardioes nгo aparece os guardiхes que sгo guardiхes (Que eu acabei de setar guardiao pra eles) Bom Eu queria que vocкs pedissem algum comando ae pra mim postar ae por enquanto vou postar o /darguardiao e o /guardioes
pawn Код:
if(strcmp(cmd,"/darguardiao", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "aAdmin") == 4 ){
SendClientMessage(playerid, Vermelho, "[INFO] Vocк nao e um admin!");
return 1;
}
if(dini_Int(file, "aAdmin") == 4 || IsPlayerAdmin(playerid)){
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "Digite: /darguardiao [id] [35]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /darguardiao [id] [35]");
return 1;
}
skin = strval(tmp);
if(IsPlayerConnected(plid)){
new pname[MAX_PLAYER_NAME];
format(file2, sizeof(file2), PASTA_CONTAS, pname);
dini_IntSet(file2, "Guardiao",1);
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
format(string, sizeof(string), "[INFO] O Administrador %s (%d) deu a Vocк Guardiao Para ver os Comandos Use: /cguardiao", aname, playerid, skin);
SendClientMessage(plid, GREEN, string);
format(string, sizeof(string), "[INFO] Vocк deu a %s(ID: %d) Guardiгo! .", pname, plid, skin);
SendClientMessage(playerid, AzuL4, string);
dini_IntSet(file2, "Profissao", skin);
SpawnPlayer(plid);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "[INFO] Jogador nгo conectado.");
return 1;
}
}
}
}
//-------------------------------------------------------------------------------------------------------
if(!strcmp(cmdtext, "/guardioes", true))
{
SendClientMessage(playerid,GREEN, "[»] .:: Guardioes Online ::. [»]");
new count=0;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)){
if(dini_Int(file, "Profissao") == Guardiao){
new str[256];
new pname[24];
GetPlayerName(i, pname, 35);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(dini_Int(file, "Profissao") == Guardiao){
format(str,sizeof(str),"%s (%d)", pname,i);
}
SendClientMessage(playerid, COLOR_WHITE, str);
count++;
}
}
}
if(count == 0)
{
SendClientMessage(playerid, Vermelho, "Nгo hб guardiхes online!");
}
return 1;
}
Re: [AJUDA] Guardiгo -
Hardware - 20.01.2012
Creio que assim funcione:
pawn Код:
if(!strcmp(cmdtext, "/guardioes", true))
{
SendClientMessage(playerid,GREEN, "[»] .:: Guardioes Online ::. [»]");
new count=0;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(dini_Int(file, "Guardiao") == 1)
{
new str[30];
new pname[MAX_PLAYER_NAME];
GetPlayerName(i, pname, 35);
format(str,sizeof(str),"%s (%d)", pname,i);
SendClientMessage(playerid, COLOR_WHITE, str);
count++;
}
}
}
if(count == 0)
{
SendClientMessage(playerid, Vermelho, "Nгo hб guardiхes online!");
}
return 1;
}
Re: [AJUDA] Guardiгo -
guilhermeghc@hotmail.com - 21.01.2012
Hardware mais na PASTA_CONTAS nгo hб nada Escrito Guardiao=1 nem Guardiao... e entгo o comando ainda nгo estб pegando...
Re: [AJUDA] Guardiгo -
Shadoww5 - 21.01.2012
Testa:
PHP код:
if(strcmp(cmd,"/darguardiao", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "aAdmin") == 4 )
return SendClientMessage(playerid, Vermelho, "[INFO] Vocк nao e um admin!");
if(!(dini_Int(file, "aAdmin") == 4 || IsPlayerAdmin(playerid)))
return 1;
new tmp[128], plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, Vermelho, "Digite: /darguardiao [id] [35]");
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, Vermelho, "Digite: /darguardiao [id] [35]");
skin = strval(tmp);
if(!IsPlayerConnected(plid))
return SendClientMessage(playerid, Vermelho, "[INFO] Jogador nгo conectado.");
new pname[MAX_PLAYER_NAME];
format(file2, sizeof(file2), PASTA_CONTAS, pname);
dini_IntSet(file2, "Guardiao",1);
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
format(string, sizeof(string), "[INFO] O Administrador %s (%d) deu a Vocк Guardiao Para ver os Comandos Use: /cguardiao", aname, playerid, skin);
SendClientMessage(plid, GREEN, string);
format(string, sizeof(string), "[INFO] Vocк deu a %s(ID: %d) Guardiгo! .", pname, plid, skin);
SendClientMessage(playerid, AzuL4, string);
dini_IntSet(file2, "Profissao", skin);
return SpawnPlayer(plid);
}
//-------------------------------------------------------------------------------------------------------
if(!strcmp(cmdtext, "/guardioes", true))
{
SendClientMessage(playerid,GREEN, "[»] .:: Guardioes Online ::. [»]");
new count;
for(new i, p = GetMaxPlayers(); i < p; i++)
{
if(IsPlayerConnected(i))
{
new str[36];
GetPlayerName(i, str, 35);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(dini_Int(file, "Profissao") != Guardiao)
continue;
format(str,sizeof(str),"%s (%d)", str,i);
SendClientMessage(playerid, COLOR_WHITE, str);
count++;
}
}
if(count == 0)
return SendClientMessage(playerid, Vermelho, "Nгo hб guardiхes online!");
return 1;
}
Re: [AJUDA] Guardiгo -
guilhermeghc@hotmail.com - 21.01.2012
Shadoww ocorreu os seguintes erros:
C:\Users\Guilherme\Desktop\Coisas GUI\[BRC] - LIGAR ESSE\gamemodes\dynamic.pwn(13014) : error 047: array sizes do not match, or destination array is too small
C:\Users\Guilherme\Desktop\Coisas GUI\[BRC] - LIGAR ESSE\gamemodes\dynamic.pwn(1301
![Cool](images/smilies/cool.gif)
: error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Linha (13014): tmp = strtok(cmdtext, idx);
Linha (1301
![Cool](images/smilies/cool.gif)
: tmp = strtok(cmdtext, idx);
As Duas linhas estгo dentro do /darguardiao
Galera e Shadoww, eu nгo queria que mudasse meu /darguardiao , e sim o /guardiao (So dei o /darguardiao para "juntar" com o /guardioes)
Re: [AJUDA] Guardiгo -
Shadoww5 - 21.01.2012
Pega o codigo agora e tenta novamente.