03.05.2018, 02:31
Well, when the player selects an item from list 1 does not want to appear and write a file in the correct folder, can anyone help me?
Quote:
#include <a_samp> #include <DOF2> #define FILTERSCRIPT #if defined FILTERSCRIPT #define DIALOG_MENUBANCO 10 #define DIALOG_ATOA 11 #define Conta_Bancaria "Conta_Bancaria/%s.ini" #define PRESSED(%0) \ (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) public OnFilterScriptInit() { Create3DTextLabel ( "{FFFFFF}Banco\n{0080FF}Caixa Economica Federal" , -1, 1457.1023,-1010.2794,26.8438, 10,0, 0 ) ; AddStaticPickup (1239, 1, 246.3607,118.3901,1003.2188, 9);//CRIAR CONTA BANCO CAIXA AddStaticPickup (1318, 1, 1457.1023,-1010.2794,26.8438, 0);//ENTRAR BANCO CAIXA ECONOMICA AddStaticPickup (1318, 1, 246.3823,107.3037,1003.2188, 9); //SAIR BANCO CAIXA ECONOMICA //los santos CreateObject(19324, 1712.70520, -1606.86523, 13.16780, 0.00000, 0.00000, 90.00000); CreateObject(19324, 1363.70190, -1751.15320, 13.14280, 0.00000, 0.00000, -90.00000); CreateObject(19324, 1928.57056, -1782.69446, 13.16680, 0.00000, 0.00000, 90.00000); CreateObject(19324, 2813.98096, -1864.31506, 10.71490, 0.00000, 0.00000, 90.00000); CreateObject(19324, 1867.70032, -1270.52026, 13.16690, 0.00000, 0.00000, -180.00000); CreateObject(19324, 1012.07581, -928.98840, 41.94380, 0.00000, 0.00000, 9.00000); CreateObject(19324, 344.93640, -1634.79285, 32.93120, 0.00000, 0.00000, -9.00000); CreateObject(19324, 1070.83716, -1865.75635, 13.18650, 0.00000, 0.00000, -90.00000); return 1; } public OnFilterScriptExit() { DOF2_Exit(); return 1; } public OnPlayerKeyStateChange ( playerid, newkeys, oldkeys) { if(IsPlayerInRangeOfPoint (playerid, 1.0, 1713.3195,-1606.8651,13.5469) || IsPlayerInRangeOfPoint (playerid, 1.0, 2814.5859,-1864.3014,11.1107) || IsPlayerInRangeOfPoint (playerid, 1.0, 1867.6738,-1269.9186,13.567 || IsPlayerInRangeOfPoint (playerid, 1.0, 1929.1844,-1782.6046,13.5469) || IsPlayerInRangeOfPoint (playerid, 1.0, 1070.0872,-1865.8032,13.5469) || IsPlayerInRangeOfPoint (playerid, 1.0, 1363.0895,-1751.1373,13.5253) || IsPlayerInRangeOfPoint (playerid, 1.0, 1012.2360,-929.7780,42.3281) ||IsPlayerInRangeOfPoint (playerid, 1.0, 344.8210,-1635.4070,33.2889)){ if (PRESSED(KEY_SECONDARY_ATTACK)){ new file[64]; GetPlayerName (playerid, file, sizeof(file)); format (file, sizeof(file), Conta_Bancaria, file); if(!DOF2_FileExists(file)){ SendClientMessage (playerid, 0xFF0000AA, "Vocк nгo tem uma conta bancaria. Vб atй uma agкncia do {FFFF00}Banco do Brasil {FF0000}ou {0080FF}Caixa Economica Federal {FF0000}!"); }}} if(IsPlayerInRangeOfPoint (playerid, 1.0, 246.3607,118.3901,1003.218){ if(PRESSED(KEY_SECONDARY_ATTACK)){ ShowPlayerDialog (playerid, DIALOG_MENUBANCO, DIALOG_STYLE_LIST, "Caixa Economica", "Abrir conta\nBeneficios Caixa", "Selecionar","Sair"); }} return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_MENUBANCO){ if(response){ switch(listitem){ case 0:{ new file[64], pname[64], agencia[128]; GetPlayerName (playerid, file, sizeof(file)); GetPlayerName (playerid, pname, sizeof(pname)); format (file, sizeof(file), Conta_Bancaria, file); format (agencia, sizeof(agencia), "Caixa Economica Federal"); if(DOF2_FileExists(file)){ SendClientMessage (playerid, -1, "Vocк jб possui uma conta na Caixa Economica !"); } else if(!DOF2_FileExists(file)){ DOF2_CreateFile(file); DOF2_SetString (file, "Pertencente", pname); DOF2_SetString (file, "Agкncia", agencia); DOF2_SetInt (file, "Dinheiro", 0); DOF2_SaveFile(); SendClientMessage (playerid, -1, "Agora vocк tem uma conta na Caixa Economica !"); SendClientMessage (playerid, -1, "Confira seus benefнcios e faзa um bom aproveito."); }} case 1:{ new string[128]; format (string, sizeof(string), "Vocк abrindo uma conta na Caixa Economica terб varios deireitos, dentre elas: Sacar em caixas eletronicos, sacar e depositar em lotericas, juros ganho ao pagamento"); ShowPlayerDialog (playerid, DIALOG_ATOA, DIALOG_STYLE_MSGBOX, "Benefнcios Caixa Economica", string, "Fecha",""); }}}} return 1; } #endif |