[Ajuda]Anuncio
#1

Gostaria de por este cmd aqui de anunciar, somente sendo possivel em 1 coordenada

pawn Код:
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк Nгo Estб Logado !");
                return 1;
            }
            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, "USAGE: (/an)uncio [Texto]");
                return 1;
            }
            if(PlayerInfo[playerid][pLevel] < 3)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк precisa ser nнvel 3 ou mais para anunciar");
                return 1;
            }
            if((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
            {
                format(string, sizeof(string), "   Por favor, Tente apуs %d segundos para o proximo anъncio !",  (addtimer/1000));
                SendClientMessage(playerid, COLOR_GRAD2, string);
                return 1;

            }
            new payout = idx * 2;
            if(GetPlayerGP(playerid) < payout)
            {
                format(string, sizeof(string), "Vocк usou %d characteres e custou $%d, Vocк nгo tem Esse Dinheiro.", offset, payout);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                return 1;
            }
            GivePlayerGP(playerid, - payout);
            SBizzInfo[7][sbTill] += payout;
            ExtortionSBiz(7, payout);
            for(new luplay=0;luplay<6;luplay++){
            if(strfind(result, IP[luplay], true) != -1){result = "PКGO EM FRБGRANTE!!!Jogador tentando divulgar algum IP.";}}
            format(string, sizeof(string), "Anъncio: %s, Contato: %s Tel: %d",  result, sendername,PlayerInfo[playerid][pPnumber]);
            OOCNews(TEAM_GROVE_COLOR,string);
            format(string, sizeof(string), "~r~Pagou $%d~n~~w~Mensagem Contem: %d Characteres", payout, idx);
            GameTextForPlayer(playerid, string, 5000, 5);
            SetTimer("AddsOn", addtimer, 0);adds = 0;
        }
        return 1;
    }
Coord:
pawn Код:
755.5236,-1345.2371,24.4085,178.3763
Reply
#2

IsPlayerInRangeOfPoint

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 755.5236,-1345.2371,24.4085,178.3763))
    SendClientMessage(playerid,-1,"Vocк nгo estб no local correto.");
Reply
#3

pawn Код:
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
           IsPlayerInRangeOfPoint (playerid + coords)
assim?
Reply
#4

pawn Код:
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!IsPlayerInRangeOfPoint(playerid, 5.0,755.5236,-1345.2371,24.4085,178.3763)) return SendClientMessage(playerid,-1,"Vocк nгo estб no local correto.");
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк Nгo Estб Logado !");
                return 1;
            }
            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, "USAGE: (/an)uncio [Texto]");
                return 1;
            }
            if(PlayerInfo[playerid][pLevel] < 3)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк precisa ser nнvel 3 ou mais para anunciar");
                return 1;
            }
            if((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
            {
                format(string, sizeof(string), "   Por favor, Tente apуs %d segundos para o proximo anъncio !",  (addtimer/1000));
                SendClientMessage(playerid, COLOR_GRAD2, string);
                return 1;

            }
            new payout = idx * 2;
            if(GetPlayerGP(playerid) < payout)
            {
                format(string, sizeof(string), "Vocк usou %d characteres e custou $%d, Vocк nгo tem Esse Dinheiro.", offset, payout);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                return 1;
            }
            GivePlayerGP(playerid, - payout);
            SBizzInfo[7][sbTill] += payout;
            ExtortionSBiz(7, payout);
            for(new luplay=0;luplay<6;luplay++){
            if(strfind(result, IP[luplay], true) != -1){result = "PКGO EM FRБGRANTE!!!Jogador tentando divulgar algum IP.";}}
            format(string, sizeof(string), "Anъncio: %s, Contato: %s Tel: %d",  result, sendername,PlayerInfo[playerid][pPnumber]);
            OOCNews(TEAM_GROVE_COLOR,string);
            format(string, sizeof(string), "~r~Pagou $%d~n~~w~Mensagem Contem: %d Characteres", payout, idx);
            GameTextForPlayer(playerid, string, 5000, 5);
            SetTimer("AddsOn", addtimer, 0);adds = 0;
        }
        return 1;
    }
Reply
#5

O exemplo tб no meu post ali de emcima...
Reply
#6

Desculpe pela demora para responder, eu consegui sim, valeu ai!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)