[Ajuda] Sistema de x1
#1

Olб, tipo eu e meu amigo fizemos um sistema de /desafiar, e talz. Sу que aн , nуs queriamos que o Player que vai desafiar e o desafiado estivessem no mesmo lugar. Sу que ele desafia o player mesmo que ele esteja longe do desafiante

Deem uma olhada pf: =(

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 (ProxDetectorS(5.0, playerid, giveplayerid))
                {
                SendClientMessage(playerid, COLOR_WHITE, "O Jogador nгo estб perto de vocк.");
                }
                if(PlayerToPoint(25.0,playerid,1378.3489,-1753.1702,14.1406))
                {
                if (para1 == playerid)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo pode desafiar a si mesmo.");
                    return 1;
                }
                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;
                }
            }
        }
        return 1;
    }
}
me ajudem pf!
Reply
#2

tente:

PHP код:
if(strcmp(cmd"/desafiar"true) == 0)
        {
        if(
IsPlayerConnected(playerid))
        {
            new 
para1;
            
para1 strval(tmp);
            
tmp strtok(cmdtextidx);
            
para1 ReturnUser(tmp);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USE: /desafiar [id] [quantia]");
                return 
1;
            }
            
GetPlayerName(para1giveplayersizeof(giveplayer));
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
IsPlayerConnected(para1))
            {
                if(
para1 != INVALID_PLAYER_ID)
                {
                if (
ProxDetectorS(5.0playeridgiveplayerid))
                {
                if(
PlayerToPoint(25.0,playerid,1378.3489,-1753.1702,14.1406))
                {
                if (
para1 == playerid)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"Vocк nгo pode desafiar a si mesmo.");
                    return 
1;
                }
                new 
valor;
                
tmp strtok(cmdtextidx);
                
valor strval(tmp);
                if(!
strlen(tmp))
                {
                
SendClientMessage(playeridCOLOR_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(playeridCOLOR_WHITE"O Jogador nгo estб perto de vocк.");
                }
        }
        }
        return 
1;
    }

Reply
#3

nгo funcionou =(
Reply
#4

foi mal viajei ali em cima, nгo й giveplayerid e sim para1:

PHP код:
if(strcmp(cmd"/desafiar"true) == 0)
        {
        if(
IsPlayerConnected(playerid))
        {
            new 
para1;
            
para1 strval(tmp);
            
tmp strtok(cmdtextidx);
            
para1 ReturnUser(tmp);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USE: /desafiar [id] [quantia]");
                return 
1;
            }
            
GetPlayerName(para1giveplayersizeof(giveplayer));
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
IsPlayerConnected(para1))
            {
                if(
para1 != INVALID_PLAYER_ID)
                {
                if (
ProxDetectorS(5.0playeridpara1))
                {
                if(
PlayerToPoint(25.0,playerid,1378.3489,-1753.1702,14.1406))
                {
                if (
para1 == playerid)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"Vocк nгo pode desafiar a si mesmo.");
                    return 
1;
                }
                new 
valor;
                
tmp strtok(cmdtextidx);
                
valor strval(tmp);
                if(!
strlen(tmp))
                {
                
SendClientMessage(playeridCOLOR_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(playeridCOLOR_WHITE"O Jogador nгo estб perto de vocк.");
                }
        }
        }
        return 
1;
    }

Reply
#5

Obrigado cara! Obrigado! Obrigado , muito obrigado! Nгo sei como te agradecer! Obrigado! E mais uma : Obrigado! Nossa cara brigadгo mesmo! Obrigado mano! Obrigado! Muito Obrigado! Muito , muito obrigado!
Reply
#6

estrelinha jб й suficiente (:
Reply
#7

jб dei +1 rep!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)