[Ajuda] O que hб de errado com este CMD?
#1

Olб, estou precisando de uma ajuda para arrumar este CMD aqui:
pawn Код:
if(strcmp(cmd, "/desafiar", true) == 0)
        {
        if(IsPlayerConnected(playerid))
        {
            new para1;
            para1 = strval(tmp);
            tmp = strtok(cmdtext, idx);
            para1 = ReturnUser(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /desafiar [id] [quantia]");
                return 1;
            }
            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(IsPlayerConnected(para1))
            {
                if(para1 != INVALID_PLAYER_ID)
                {
                if(PlayerToPoint(25.0,playerid,1378.3489,-1753.1702,14.1406) && PlayerToPoint(25.0,giveplayerid,1378.3489,-1753.1702,14.1406))
                {
                new valor;
                tmp = strtok(cmdtext, idx);
                valor = strval(tmp);
                if(!strlen(tmp))
                {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /desafiar [id] [quantia]");
                return 1;
                }
                if(valor > GetPlayerMoney(playerid) || valor > GetPlayerMoney(giveplayerid))
                {
                SendClientMessage(playerid,COLOR_GREY,"Vocк ou o Adversario nгo possuiem esta quantia.");
                return 1;
                }
                SendClientMessage(playerid,COLOR_GRAD2,"Vocк desafiou o player!");
                format(string,sizeof(string),"O jogador %s estб querendo te desafiar no x1 no valor de R$%d!\n Deseja aceitar o desafio e mostrar quem manda?",PlayerName(playerid),valor);
                ShowPlayerDialog(para1,1020,DIALOG_STYLE_MSGBOX,"[BPL-x1]",string,"Aceitar Desafio","Recusar Desafio");
                PlayerInfo[para1][pValorx1] = valor;
                PlayerInfo[playerid][pValorx1] = valor;
                }
                else
                {
                SendClientMessage(playerid,COLOR_GRAD1,"O desafiante e o desafiador precisam estar na Central de x1!");
                return 1;
                }
                }
            }
        }
        return 1;
    }
Gostaria de saber o que estб de errado nele.
Reply
#2

Quote:
Originally Posted by Ryu-San
Посмотреть сообщение
Olб, estou precisando de uma ajuda para arrumar este CMD aqui:
pawn Код:
if(strcmp(cmd, "/desafiar", true) == 0)
        {
        if(IsPlayerConnected(playerid))
        {
            new para1;
            para1 = strval(tmp);
            tmp = strtok(cmdtext, idx);
            para1 = ReturnUser(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /desafiar [id] [quantia]");
                return 1;
            }
            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(IsPlayerConnected(para1))
            {
                if(para1 != INVALID_PLAYER_ID)
                {
                if(PlayerToPoint(25.0,playerid,1378.3489,-1753.1702,14.1406) && PlayerToPoint(25.0,giveplayerid,1378.3489,-1753.1702,14.1406))
                {
                new valor;
                tmp = strtok(cmdtext, idx);
                valor = strval(tmp);
                if(!strlen(tmp))
                {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /desafiar [id] [quantia]");
                return 1;
                }
                if(valor > GetPlayerMoney(playerid) || valor > GetPlayerMoney(giveplayerid))
                {
                SendClientMessage(playerid,COLOR_GREY,"Vocк ou o Adversario nгo possuiem esta quantia.");
                return 1;
                }
                SendClientMessage(playerid,COLOR_GRAD2,"Vocк desafiou o player!");
                format(string,sizeof(string),"O jogador %s estб querendo te desafiar no x1 no valor de R$%d!\n Deseja aceitar o desafio e mostrar quem manda?",PlayerName(playerid),valor);
                ShowPlayerDialog(para1,1020,DIALOG_STYLE_MSGBOX,"[BPL-x1]",string,"Aceitar Desafio","Recusar Desafio");
                PlayerInfo[para1][pValorx1] = valor;
                PlayerInfo[playerid][pValorx1] = valor;
                }
                else
                {
                SendClientMessage(playerid,COLOR_GRAD1,"O desafiante e o desafiador precisam estar na Central de x1!");
                return 1;
                }
                }
            }
        }
        return 1;
    }
Gostaria de saber o que estб de errado nele.
Ele apresenta algum tipo de erro dentro do jogo?
Reply
#3

Oque ocorre caso vocк digite isto no "samp" ?
Reply
#4

Й o giveplayerid
PlayerToPoint(25.0,giveplayerid,1378.3489,-1753.1702,14.1406
ele ta mandando pro player mesmo se ele nгo tiver no point.
Reply
#5

Usa isto:

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

Deste Modo:

pawn Код:
if(!IsPlayerInRangeOfPoint(.....)) return SendClientMessage(playerid, -1, "Mensagem De Erro"); // ! Significa False, ou seja, nгo estб na Posiзгo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)