[Ajuda] Como eu uso essa base pra criar Mega Fone admin ?
#1

Olб pessoal como eu posso tar usando essa base pra criar um comando " /ma " pra criar um comando de admin ?
preciso muito xD ou se alguйm jб poder fazer pra min =]


Eu tentei criar mais nгo di conta =/

pawn Code:
if(strcmp(cmd, "/megafone", true) == 0 || strcmp(cmd, "/m", true) == 0)
    {
        if(PlayerInfo[playerid][pMuted] == 1)
        {
            SendClientMessage(playerid, TEAM_CYAN_COLOR, "Vocк nгo pode falar, pois foi calado");
            return true;
        }
        if(IsPlayerConnected(playerid))
        {
            if(!IsACop(playerid))
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й um policial!");
                return true;
            }
            if(OnDuty[playerid] != 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo Bateu o cartгo!");
                return true;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: (/m)egafone [texto]");
                return true;
            }
            if(gTeam[playerid] == 2 || IsACop(playerid))
            {
                if(PlayerInfo[playerid][pMembro] == 1||PlayerInfo[playerid][pLider] == 1)
                {
                    format(string, sizeof(string), "[Policial Militar %s:o< %s]", sendername, result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(PlayerInfo[playerid][pMembro] == 2||PlayerInfo[playerid][pLider] == 2)
                {
                    format(string, sizeof(string), "[Rotam %s:o< %s]", sendername, result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(PlayerInfo[playerid][pMembro] == 27||PlayerInfo[playerid][pLider] == 27)
                {
                    format(string, sizeof(string), "[Policial Militar %s:o< %s]", sendername, result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(PlayerInfo[playerid][pMembro] == 3||PlayerInfo[playerid][pLider] == 3)
                {
                    format(string, sizeof(string), "[Exйrcito %s:o< %s]", sendername, result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(IsAGOV(playerid))
                {
                    format(string, sizeof(string), "[Governo %s:o< %s]", sendername, result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(PlayerInfo[playerid][pMembro] == 16||PlayerInfo[playerid][pLider] == 16)
                {
                    format(string, sizeof(string), "[Rotam-SF %s:o< %s]", sendername, result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(PlayerInfo[playerid][pMembro] == 11||PlayerInfo[playerid][pLider] == 11)
                {
                    format(string, sizeof(string), "[Policia Federal %s:o< %s]", sendername, result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(PlayerInfo[playerid][pMembro] == 33||PlayerInfo[playerid][pLider] == 33)
                {
                    format(string, sizeof(string), "[Policial Rodoviбrio %s:o< %s]", sendername, result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                printf("%s", string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo faz parte de nenhuma equipe !");
                return true;
            }
        }
        return true;
    }
Reply
#2

apenas apague todas as variбveis relacionadas a Cops e coloque as de admin '-'.
Reply
#3

Casa usa a include SSCANF e ZCMD й mais fбcil
Tem vбrios tutoriais no fуrum de como se usar
Reply
#4

Um comando desse em ZCMD seria fбcil nгo use comando de outros estude e tente fazer o seu.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)