07.07.2012, 18:57
tente:
PHP код:
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))
{
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;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "O Jogador nгo estб perto de vocк.");
}
}
}
return 1;
}
}