08.05.2013, 20:10
pawn Код:
// Em OnPlayerKeyStateChange
if (PlayerToPoint(2, playerid,830.6808,-0.2795,1004.1797) || PlayerToPoint(2,playerid,833.5997,3.2969,1004.1797 ))
{
ShowPlayerDialog(playerid,1784,DIALOG_STYLE_LIST,"Lotйrica","Comprar um Bilhete\nMudar o Sexo para Masculino\nMudar o Sexo para Feminino\nSe separar","Escolher","Cancelar");
}
// Em OnDialogResponse
if(dialogid == 1784)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid,1785,DIALOG_STYLE_INPUT,"Lotйrica","Digite o nъmero do bilhete que deseja comprar","Comprar","Cancelar");
}
if(listitem == 1)
{
OnPlayerCommandText(playerid,"/mudarsexo 1");
}
if(listitem == 2)
{
OnPlayerCommandText(playerid,"/mudarsexo 1");
}
if(listitem == 3)
{
OnPlayerCommandText(playerid,"/separacao");
}
}
return 1;
}
if(dialogid == 1785)
{
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,1785,DIALOG_STYLE_INPUT,"Lotйrica","Digite o nъmero do bilhete que deseja comprar","Comprar","Cancelar");
}
new lottonr = strval(inputtext);
if(lottonr < 1 || lottonr > 80)
{
SendClientMessage(playerid, COLOR_GREY, " Nъmeros de 1 a 80.");
ShowPlayerDialog(playerid,1785,DIALOG_STYLE_INPUT,"Lotйrica","Digite o nъmero do bilhete que deseja comprar","Comprar","Cancelar");
return true;
}
format(string, sizeof(string), "* Vocк comprou um bilhete de loteria com nъmero: %d.", lottonr);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 10);
PlayerInfo[playerid][pLottoNr] = lottonr;
}
return 1;
}
