vanogon | Дата: Среда, 18.08.2010, 17:44 | Сообщение # 3 |
.::Offline::.
Вор в законе
Сообщений: 51
[ 1 ]
Награды: 0
Статус
отсутствует
| вот мой пример банкоматов Code if(strcmp(cmd, "/atm", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerToPoint(3.0,playerid,2235.427246, -1150.405762, 25.515900) || PlayerToPoint(3.0,playerid,1781.963257, -1161.421387, 23.471024) || PlayerToPoint(3.0,playerid,1833.169312, -1846.869385, 13.221025) || PlayerToPoint(3.0,playerid,1928.606812, -1768.946289, 13.189775) || PlayerToPoint(3.0,playerid,1003.041687, -930.357971, 41.971024) || PlayerToPoint(3.0,playerid,501.860840, -1364.001709, 15.775712) || PlayerToPoint(3.0,playerid,-79.431404, -1172.427734, 1.774457) || PlayerToPoint(3.0,playerid,-2033.096191, -52.185215, 35.011688) || PlayerToPoint(3.0,playerid,-1980.677490, 145.389053, 27.330399) || PlayerToPoint(3.0,playerid,-1693.100830, 414.963654, 6.822587) || PlayerToPoint(3.0,playerid,-2281.511230, -80.277931, 34.981766) || PlayerToPoint(3.0,playerid,157.817459, -1947.213501, 3.416337)) { ShowPlayerDialog(playerid,380,DIALOG_STYLE_LIST,"Система банкоматов 'ATM'","Снять деньги со счёта\nПоложить деньги на счёт","Ок","Отмена"); } else { SendClientMessage(playerid, COLOR_LIGHTRED2, " Вы не у Банкомата!"); return 1; } } return 1; } в конце public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) пишем это: Code if(dialogid == 380) { if(response == 1) { if(listitem == 0) { new strina[256]; format(strina,sizeof(strina),"Ó âàñ íà ñ÷åòó %d$",PlayerInfo[playerid][pAccount]); ShowPlayerDialog(playerid,381,DIALOG_STYLE_INPUT,strina,"Íàïèøèòå ñóììó, êîòîðóþ õîòèòå ñíÿòü ñî ñ÷åòà\nÌàêñèìóì 10000 çà îäíó îïåðàöèþ\nÂíèìàíèå!\nÑ êàæäîé ïåðå÷èñëåííîé ñóììû ñíèìàåòñÿ íàëîã â 3ïðîöåíòà","Çàáðàòü","Îòìåíà"); } if(listitem == 1) { new strina[256]; format(strina,sizeof(strina),"Ó âàñ íà ñ÷åòó %d$",PlayerInfo[playerid][pAccount]); ShowPlayerDialog(playerid,382,DIALOG_STYLE_INPUT,strina,"Íàïèøèòå ñóììó, êîòîðóþ õîòèòå ïîëîæèòü íà ñ÷åò\nÌàêñèìóì 10000 çà îäíó îïåðàöèþ\nÂíèìàíèå!\nÑ êàæäîé ïåðå÷èñëåííîé ñóììû ñíèìàåòñÿ íàëîã â 3ïðîöåíòà","Ïîëîæèòü","Îòìåíà"); } } else { } } if(dialogid == 381)//Âçÿòü äåíüãè { if(response == 1) { if(!strlen(inputtext)) { SendClientMessage(playerid,COLOR_GREY,"Âû íå óêàçàëè ñóììó!"); return 1; } new money; money = strval(inputtext); if(money > 10000) { SendClientMessage(playerid,COLOR_GREY,"Ìàêñèìàëüíàÿ ñóììà çà îäíó îïåðàöèþ ñîñòîâëÿåò 10000$"); return 1; } if(money < 100) { SendClientMessage(playerid,COLOR_GREY,"Ìèíèìàëüíàÿ ñóììà çà îäíó îïåðàöèþ ñîñòîâëÿåò 100$"); return 1; } new proc = (money*3)/100; new babki = money - proc; new strina[256]; PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] - babki; GivePlayerMoney(playerid,babki); format(strina,sizeof(strina)," Âû ñíÿëè ñî ñ÷åòà %d$ ñ ó÷åòîì ïîöåíòà",babki); SendClientMessage(playerid,COLOR_WHITE,strina); format(strina,sizeof(strina),"~g~%d$",babki); GameTextForPlayer(playerid, strina, 2000, 1); } else { } } if(dialogid == 382)//ïîëîæèòü äåíüãè { if(response == 1) { if(!strlen(inputtext)) { SendClientMessage(playerid,COLOR_GREY,"Âû íå óêàçàëè ñóììó!"); return 1; } new money; money = strval(inputtext); if(money > 10000) { SendClientMessage(playerid,COLOR_GREY,"Ìàêñèìàëüíàÿ ñóììà çà îäíó îïåðàöèþ ñîñòîâëÿåò 10000$"); return 1; } if(money < 100) { SendClientMessage(playerid,COLOR_GREY,"Ìèíèìàëüíàÿ ñóììà çà îäíó îïåðàöèþ ñîñòîâëÿåò 100$"); return 1; } new proc = (money*3)/100; new babki = money - proc; new strina[256]; PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] + babki; GivePlayerMoney(playerid,-babki); format(strina,sizeof(strina)," Âû ïîëîæèëè íà ñ÷åò %d$ ñ ó÷åòîì ïîöåíòà",babki); SendClientMessage(playerid,COLOR_WHITE,strina); format(strina,sizeof(strina),"~r~%d$",babki); GameTextForPlayer(playerid, strina, 2000, 1); } else { } } return 1; }
|
|
| |