[AJUDA] ~Dialog~
#1

To fazendo meu banco em dialog sу falta duas coisas.
Alguйm pode me ajudar ain tipo no /depositar й /sacar
Para mim ter pelo menos uma ideia de como seja.

pawn Код:
if(dialogid == DialogBanco) // Banco
{
if(response)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
if(listitem == 0)
{
if(dini_Int(file, "ContaBancaria") == 0){
new grana;
grana = GetPlayerGrana(playerid);
if(grana > 299){
format(string, sizeof(string), "[INFO] O jogador %s[ID:%d] abriu uma conta bancбria.",aname,playerid);
SendClientMessageToAll(GREEN, string);
dini_IntSet(file, "ContaBancaria", 1);
GivePlayerGrana(playerid, -300);
dini_IntSet(file, "SaldoBancario", 300);
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк nгo tem 300 Reais !");
}
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк jб tem uma conta bancбria.");
}
}
if(listitem == 1) // Sacar
{
format(string, sizeof(string), "Digite a quantia a sacar.");
SendClientMessage(playerid, Azul, string);
format(STRX, sizeof(STRX), "%s\n\nDigite a quantidade qe deseja Sacar !", aname);
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_INPUT, "Banco", STRX, "Sacar", "Fechar");
}
if(listitem == 2) // Depositar
{
format(string, sizeof(string), "Digite a quantia a depositar.");
SendClientMessage(playerid, Azul, string);
format(STRX, sizeof(STRX), "%s\n\nDigite a quantia que deseja Depositar !", aname);
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_INPUT, "Banco", STRX, "Depositar", "Fechar");
}
if(listitem == 3) // Ver Saldo
{
new PName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PName, sizeof(PName));
format(string, sizeof(string), "Seu saldo й 'R$:{00FF00}%d'",dini_Int(file, "SaldoBancario"));
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Saldo",string,"Ok","Fechar");
}
if(listitem == 4)
{
if(dini_Int(file,"rouboubanco") == 1) return SendClientMessage(playerid, Vermelho, "Voce nгo pode Assaltar o Banco Agora ! Aguarde 3 Minutos!");
if(dini_Int(file,"rouboubanco") == 0){
if(dini_Int(file, "Profissao") == Assaltante || dini_Int(file, "pAdm01") == 1 || IsPlayerAdmin(playerid)){
format(string, sizeof(string), "[BANCO] %s assaltou um banco e estб na lista de procurados !",aname);
SendClientMessageToAll(GREEN, string);
SetPlayerWantedLevel(playerid, 4);
new Float:x,Float:y,Float:z;
dini_IntSet(file, "Procurado", 1);
dini_IntSet(file, "rouboubanco", 1);
GivePlayerGrana(playerid,2500);
GetPlayerPos(playerid,x,y,z);
SetTimerEx("CriarExplosao",2000,false,"fffdf",x,y,z,2,50.0);
GameTextForPlayer(playerid,"~w~ +2500",1000,4);
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк nгo й Assaltante !");
}
}
}
}
}
Reply
#2

Estude:
https://sampforum.blast.hk/showthread.php?tid=279227
Reply
#3

Quote:
Originally Posted by CidadeNovaRP
Посмотреть сообщение
Tentei assim nгo funciono mt bem vo da mais uma olhada lб.

pawn Код:
if(listitem == 2) // Depositar
{
format(string, sizeof(string), "Digite a quantia a depositar.");
SendClientMessage(playerid, Azul, string);
format(STRX, sizeof(STRX), "%s\n\nDigite a quantia que deseja Depositar !", aname);
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_INPUT, "Banco", STRX, "Depositar", "Fechar");
new EvertonRDSB =  strval(inputtext);
new valor;
if(dini_Int(file, "ContaBancaria") == 1)
if(!inputtext[0] || EvertonRDSB < 10)  return SendClientMessage(playerid,-1,"[ERRO] Vocк nгo pode Depositar menos de R$10");
if(EvertonRDSB > 10)
{
GetPlayerName(playerid, aname, sizeof(aname));
format(string, 128, "%s Vocк Depositou R$%i",aname, EvertonRDSB);
SendClientMessage(playerid, Verde, string);
dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+valor);
}
GivePlayerMoney(playerid, - EvertonRDSB);
return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)