MihaiMrn43 Posted December 27, 2020 Report Share Posted December 27, 2020 Quote Link to comment Share on other sites More sharing options...
MihaiMrn43 Posted December 27, 2020 Author Report Share Posted December 27, 2020 case DIALOG_BITCOINEXCHANGE1: { if(!response) return 1; ShowPlayerDialog(playerid, DIALOG_BITCOINEXCHANGE2, DIALOG_STYLE_LIST, "Ce operatiune doresti sa efectuezi?","Vanzare BTC\nCumparare BTC", "Selecteaza", "Anuleaza"); } case DIALOG_BITCOINEXCHANGE2: { if(!response) return 1; if(listitem == 0) { //vanzare format(string,sizeof(string),"{FFFFFF}Cati BTC doresti sa vinzi? Vei primi {23E800}$%s{FFFFFF} pentru fiecare BTC. (Cantitate minima: 0.1BTC)",FormatNumber(btcprice)); ShowPlayerDialog(playerid,DIALOG_BITCOINEXCHANGE3,DIALOG_STYLE_INPUT,"Vanzare BTC - Bitcoin Exchange",string,"Ok","Anuleaza"); } else { //cumparare format(string,sizeof(string),"{FFFFFF}Cati BTC doresti sa cumperi? Vei plati {23E800}$%s{FFFFFF} pentru fiecare BTC. (Cantitate minima: 0.1BTC)",FormatNumber(btcprice)); ShowPlayerDialog(playerid,DIALOG_BITCOINEXCHANGE4,DIALOG_STYLE_INPUT,"Cumparare BTC - Bitcoin Exchange",string,"Ok","Anuleaza"); } } case DIALOG_BITCOINEXCHANGE4: { if(!response) return 1; new Float:amount = floatstr(inputtext),pret; if(amount < 0.1) return SCM(playerid,COLOR_LIGHTRED,"Trebuie sa cumperi minim 0.1 BTC!"); pret = floatround(amount*btcprice); if(GetPlayerCash(playerid) < pret) return SCM(playerid,COLOR_LIGHTRED,"Nu ai suma necesara de bani!"); GivePlayerCash(playerid,-pret); Update(playerid,pCashx); PlayerInfo[playerid][pBitcoin] += amount; mysql_format(SQL,query,sizeof(query),"UPDATE `users` SET `Bitcoin`=`Bitcoin`+'%.5f' WHERE `ID`='%d'",amount,PlayerInfo[playerid][pSQLID]); mysql_tquery(SQL,query,"",""); format(string,sizeof(string),"Ai cumparat %.5f BTC la pretul de $%s.",amount,FormatNumber(pret)); SCM(playerid,COLOR_GREEN,string); btcchange+=floatround(amount*10); } case DIALOG_BITCOINEXCHANGE3: { if(!response) return 1; new Float:amount = floatstr(inputtext),pret; if(amount < 0.1) return SCM(playerid,COLOR_LIGHTRED,"Trebuie sa vinzi minim 0.1 BTC!"); pret = floatround(amount*btcprice); if(PlayerInfo[playerid][pBitcoin] < amount) return SCM(playerid,COLOR_LIGHTRED,"Nu ai suficienti Bitcoini!"); GivePlayerCash(playerid,pret); Update(playerid,pCashx); PlayerInfo[playerid][pBitcoin] -= amount; mysql_format(SQL,query,sizeof(query),"UPDATE `users` SET `Bitcoin`=`Bitcoin`-'%.5f' WHERE `ID`='%d'",amount,PlayerInfo[playerid][pSQLID]); mysql_tquery(SQL,query,"",""); format(string,sizeof(string),"Ai vandut %.5f BTC la pretul de $%s.",amount,FormatNumber(pret)); SCM(playerid,COLOR_GREEN,string); btcchange-=floatround(amount*10); } case DIALOG_BITCOINMINING: { if(!response) return 1; new Float:amount = floatstr(inputtext),pret,queryx[128],szString[128]; if(amount < 0.1) return SCM(playerid,COLOR_LIGHTRED,"Trebuie sa cumperi minim 0.1 MH/s!"); pret = floatround(amount*100000); if(GetPlayerCash(playerid) < pret) return SCM(playerid,COLOR_LIGHTRED,"Nu ai suma necesara de bani!"); GivePlayerCash(playerid,-pret); Update(playerid, pCashx); mysql_format(SQL,queryx,sizeof(queryx),"INSERT INTO `bitcoin_mining` (`playerid`, `amount`,`timelimit`) VALUES ('%d', '%.2f','%d')",PlayerInfo[playerid][pSQLID],amount,gettime()+7*24*3600); mysql_tquery(SQL,queryx,"",""); format(szString,sizeof(szString),"Ai cumparat %.2f MH/s la pretul de $%s.",amount,FormatNumber(pret)); SCM(playerid,COLOR_GREEN,szString); } Quote Link to comment Share on other sites More sharing options...
MihaiMrn43 Posted December 27, 2020 Author Report Share Posted December 27, 2020 C:\Users\model\Desktop\T0T\bloody dark server\BloodYDark\gamemodes\nzone.pwn(7021) : error 014: invalid statement; not in switch C:\Users\model\Desktop\T0T\bloody dark server\BloodYDark\gamemodes\nzone.pwn(7021) : warning 215: expression has no effect C:\Users\model\Desktop\T0T\bloody dark server\BloodYDark\gamemodes\nzone.pwn(7021) : error 001: expected token: ";", but found ":" C:\Users\model\Desktop\T0T\bloody dark server\BloodYDark\gamemodes\nzone.pwn(7021) : error 029: invalid expression, assumed zero C:\Users\model\Desktop\T0T\bloody dark server\BloodYDark\gamemodes\nzone.pwn(7021) : fatal error 107: too many error messages on one line Quote Link to comment Share on other sites More sharing options...
Banditul Posted December 27, 2020 Report Share Posted December 27, 2020 Daca vrei sa folosesti case ai nevoie de switch. Nu merge fara switch OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { // Case cu dialoguri aici } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.