[Ajuda] Comando /acurar
#1

Boas pessoal, estou com um problema no meu comando, й o seguinte, eu sou administrador faзo o comando /acurar e diz " Nгo йs administrador " e eu sou administrador. Agradecia ajuda ai.. Obrigado.

Код:
	    if(strcmp(cmd, "/acurar", true) == 0)
		{
		    if(IsPlayerConnected(playerid))
		    {
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] /acurar [playerid] ");
					return 1;
				}
				new playa;
				playa = ReturnUser(tmp);
				tmp = strtok(cmdtext, idx);
				if (PlayerInfo[playerid][crtrvbcAdmin] >= 1)
                if (PlayerInfo[playerid][crtrvbcGm] >= 1)
				{
				    if(IsPlayerConnected(playa))
				    {
				        if(playa != INVALID_PLAYER_ID)
				        {
				            icurar(playa);
							format(string, sizeof(string), " Foste curado por %s.",GetPlayerNameEx(playerid));
							SendClientMessage(playa,COLOR_WHITE,string);
							format(string, sizeof(string), " Curaste %s.",GetPlayerNameEx(playa));
							SendClientMessage(playerid,COLOR_WHITE,string);
						}
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_WHITE, "ERRO: Nao йs administrador.");
				}
			}
   return 1;
		}
Reply
#2

Tente assim, eu acho que da:


pawn Код:
if(strcmp(cmd, "/acurar", true) == 0)
        {
               if(IsPlayerConnected(playerid))
               {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] /acurar [playerid] ");
                    return 1;
                }
                new playa;
                playa = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                if(PlayerInfo[playerid][pAdmin] >= 1) //Troque pelo nivel de administrador que vocк quer
                {
                    if(IsPlayerConnected(playa))
                    {
                        if(playa != INVALID_PLAYER_ID)
                        {
                            icurar(playa);
                            format(string, sizeof(string), " Foste curado por %s.",GetPlayerNameEx(playerid));
                            SendClientMessage(playa,COLOR_WHITE,string);
                            format(string, sizeof(string), " Curaste %s.",GetPlayerNameEx(playa));
                            SendClientMessage(playerid,COLOR_WHITE,string);
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "ERRO: Nao йs administrador.");
                }
            }
   return 1;
        }
Reply
#3

Mas eu quero para os GM ( GameMasters ) e para os Administradores fazerem do nivel 1 ate ao 25, por isso e que tava entende? :S
Reply
#4

Veja assim:

pawn Код:
if(strcmp(cmd, "/acurar", true) == 0)
        {
               if(IsPlayerConnected(playerid))
               {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] /acurar [playerid] ");
                    return 1;
                }
                new playa;
                playa = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"ERRO: Nao йs administrador.");
                {
                    if(IsPlayerConnected(playa))
                    {
                        if(playa != INVALID_PLAYER_ID)
                        {
                            icurar(playa);
                            format(string, sizeof(string), " Foste curado por %s.",GetPlayerNameEx(playerid));
                            SendClientMessage(playa,COLOR_WHITE,string);
                            format(string, sizeof(string), " Curaste %s.",GetPlayerNameEx(playa));
                            SendClientMessage(playerid,COLOR_WHITE,string);
                        }
                    }
                }
            }
   return 1;
        }
Reply
#5

pawn Код:
if(strcmp(cmd, "/acurar", true) == 0)
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
        return SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] /acurar [playerid] ");
    new playa;
    playa = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    if(PlayerInfo[playerid][pAdmin] < 1)
        return SendClientMessage(playerid,-1,"ERRO: Nao йs administrador.");
    if(IsPlayerConnected(playa))
        return SendClientMessage(playerid,-1," o jogador estб offline!");
    icurar(playa);
    format(string, sizeof(string), " Foste curado por %s.",GetPlayerNameEx(playerid));
    SendClientMessage(playa,COLOR_WHITE,string);
    format(string, sizeof(string), " Curaste %s.",GetPlayerNameEx(playa));
    SendClientMessage(playerid,COLOR_WHITE,string);
    return 1;
}
Reply
#6

Pessoal continua a nao dar , dis " Nao es administrador " .. Por favor ajuda ai
Reply
#7

Tente dessa maneira

No OnPlayerCommandText()
pawn Код:
if(strcmp(cmd, "/acurar", true) == 0)
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
        return SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] /acurar [playerid] ");
    new playa;
    playa = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    if (PlayerInfo[playerid][crtrvbcAdmin] >= 1)
        return SendClientMessage(playerid,-1,"ERRO: Nao йs administrador.");
    if(IsPlayerConnected(playa))
        return SendClientMessage(playerid,-1,"ERRO: Jogar nгo estб online.");
    icurar(playa);
    format(string, sizeof(string), " Foste curado por %s.",GetPlayerNameEx(playerid));
    SendClientMessage(playa,COLOR_WHITE,string);
    format(string, sizeof(string), " Curaste %s.",GetPlayerNameEx(playa));
    SendClientMessage(playerid,COLOR_WHITE,string);
    return 1;
}

Se nгo der, tente dessa

pawn Код:
if(strcmp(cmd, "/acurar", true) == 0)
        {
            if(IsPlayerConnected(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] /acurar [playerid] ");
                    return 1;
                }
                new playa;
                playa = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                if (PlayerInfo[playerid][crtrvbcAdmin] >= 1)
                                       return SendClientMessage(playerid,-1,"ERRO: Nao йs administrador.");

                if (PlayerInfo[playerid][crtrvbcGm] >= 1)
                {
                    if(IsPlayerConnected(playa))
                    {
                        if(playa != INVALID_PLAYER_ID)
                        {
                            icurar(playa);
                            format(string, sizeof(string), " Foste curado por %s.",GetPlayerNameEx(playerid));
                            SendClientMessage(playa,COLOR_WHITE,string);
                            format(string, sizeof(string), " Curaste %s.",GetPlayerNameEx(playa));
                            SendClientMessage(playerid,COLOR_WHITE,string);
                        }
                    }
                }
                else
                {
                   
                }
            }
   return 1;
        }
Espero ter ajudado.
Reply
#8

Nгo dб na mesma, por favor ajuda, Hard passa-me o teu msn por pm para falarmos lб e para me ajudares se poderes sff
Reply
#9

Passe a variavel do seu GM que define que o Player й administrador, por exemplo, nos GM derivado de GodFather й o PlayerInfo[playerid][pAdmin] , veja se encontra alguma coisa relacionada no seu GM.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)