[AJUDA] Guardiгo
#1

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;
}
Reply
#2

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;
}
Reply
#3

Hardware mais na PASTA_CONTAS nгo hб nada Escrito Guardiao=1 nem Guardiao... e entгo o comando ainda nгo estб pegando...
Reply
#4

Testa:

PHP код:
if(strcmp(cmd,"/darguardiao"true)==0)
{
    new 
aname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridanameMAX_PLAYER_NAME);
    
format(filesizeof(file), PASTA_CONTASaname);
    if(
dini_Int(file"aAdmin") == )
        return 
SendClientMessage(playeridVermelho"[INFO] Vocк nao e um admin!");
    if(!(
dini_Int(file"aAdmin") == 4  || IsPlayerAdmin(playerid)))
        return 
1;
    new 
tmp[128], plidskin;
    
tmp strtok(cmdtextidx);
    if(!
strlen(tmp)) 
        return 
SendClientMessage(playeridVermelho"Digite: /darguardiao [id] [35]");
    
plid strval(tmp);
    
tmp strtok(cmdtextidx);
    if(!
strlen(tmp)) 
        return 
SendClientMessage(playeridVermelho"Digite: /darguardiao [id] [35]");
    
skin strval(tmp);
    if(!
IsPlayerConnected(plid))
        return 
SendClientMessage(playeridVermelho"[INFO] Jogador nгo conectado.");
    new 
pname[MAX_PLAYER_NAME];
    
format(file2sizeof(file2), PASTA_CONTASpname);
    
dini_IntSet(file2"Guardiao",1);
    
GetPlayerName(plidpnameMAX_PLAYER_NAME);
    
format(file2sizeof(file2), PASTA_CONTASpname);
    
format(stringsizeof(string), "[INFO] O Administrador %s (%d) deu a Vocк Guardiao Para ver os Comandos Use: /cguardiao"anameplayeridskin);
    
SendClientMessage(plidGREENstring);
    
format(stringsizeof(string), "[INFO] Vocк deu a %s(ID: %d) Guardiгo! ."pnameplidskin);
    
SendClientMessage(playeridAzuL4string);
    
dini_IntSet(file2"Profissao"skin);
    return 
SpawnPlayer(plid);
}
//-------------------------------------------------------------------------------------------------------
if(!strcmp(cmdtext"/guardioes"true))
{
    
SendClientMessage(playerid,GREEN"[»] .:: Guardioes Online ::. [»]");
    new 
count;
    for(new 
iGetMaxPlayers(); pi++)
    {
        if(
IsPlayerConnected(i))
        {    
            new 
str[36];
            
GetPlayerName(istr35);
            
format(file2sizeof(file2), PASTA_CONTASpname);
            if(
dini_Int(file"Profissao") != Guardiao)
                continue;
            
format(str,sizeof(str),"%s (%d)"str,i);
            
SendClientMessage(playeridCOLOR_WHITEstr);
            
count++;
        }
    }
    if(
count == 0)
        return 
SendClientMessage(playeridVermelho"Nгo hб guardiхes online!");
    return 
1;

Reply
#5

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 : 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: 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)
Reply
#6

Pega o codigo agora e tenta novamente.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)