Ajuda /m
#1

pawn Код:
if(strcmp(cmd, "/megafone", true) == 0 || strcmp(cmd, "/m", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            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 [megaphone chat]");
                return 1;
            }
            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), "BOPE %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(gTeam[playerid] == 7  || IsAPre(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] == 17||PlayerInfo[playerid][pLider] == 17)
                {
                    format(string, sizeof(string), "Policia Civil %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), "CIA %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] == 28||PlayerInfo[playerid][pLider] == 28)
                {
                    format(string, sizeof(string), "[GATE] %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 nenhum equipe !");
                return 1;
            }
        }
        return 1;
    }
galera eu queria criar o megafone para detran so que nao conseguir o ID da Org e 11 da do detran alguem poderia mim ajudar ?
Reply
#2

pawn Код:
if(strcmp(cmd, "/megafone", true) == 0 || strcmp(cmd, "/m", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            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 [megaphone chat]");
                return 1;
            }
            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), "BOPE %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(PlayerInfo[playerid][pMembro] == 11||PlayerInfo[playerid][pLider] == 11)
                {
                    format(string, sizeof(string), "Detran %s:o< %s", sendername, result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(gTeam[playerid] == 7  || IsAPre(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] == 17||PlayerInfo[playerid][pLider] == 17)
                {
                    format(string, sizeof(string), "Policia Civil %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), "CIA %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] == 28||PlayerInfo[playerid][pLider] == 28)
                {
                    format(string, sizeof(string), "[GATE] %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 nenhum equipe !");
                return 1;
            }
        }
Reply
#3

cara deu erro a doidada eu so quero um novo comando /megafoned /md que esse megafone ser so para detran e deixar o /megafone para os outros cop
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)