Дмитрий |
Дата: Понедельник, 06.08.2012, 17:02 | Сообщение # 1 | Сообщить о нерабочей теме
|
Регистрация: | 03.12.2011
|
Страна: | Российская Федерация |
Репутация: |
14
|
Сообщений: | 1421 |
Награды: |
4
+
|
Статус: |
|
| Данный Мануал предназначин для новечков.
И так приступим:
Ко всем new Code new ExpOffer[MAX_PLAYERS]; new ExpPrice[MAX_PLAYERS]; new ExpKolvo[MAX_PLAYERS];
В public OnPlayerConnect Code ExpOffer[playerid] = 999; ExpPrice[playerid] = 0; ExpKolvo[playerid] = 0;
В public OnDialogResponse
Для RLS: Code case 160: { if(response) { new giveplayer[26]; new sendername[36]; if(PlayerInfo[playerid][pCash] < ExpPrice[playerid]) return SendClientMessage(playerid, COLOR_GREY, "у вас нехватает денег!"); GetPlayerName(ExpOffer[playerid], giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string,256,"{ffffff}Кол-во купленых респектов: {33AAFF}%d\n{ffffff}Продавец:{33AAFF} %s\n{ffffff}Стоимость:{33AAFF} %d$",ExpKolvo[playerid],giveplayer,ExpPrice[playerid]); SPD(playerid,191,DIALOG_STYLE_MSGBOX,"Информация о покупке:",string,"Ïðèíÿòü",""); format(string, sizeof(string), "%s купил у вас %d респектов за $%d.",sendername,ExpKolvo[playerid],ExpPrice[playerid]); SendClientMessage(ExpOffer[playerid], COLOR_YELLOW, string); GiveMoney(playerid, -ExpPrice[playerid]); GiveMoney(ExpOffer[playerid],ExpPrice[playerid]); PlayerInfo[playerid][pExp] += ExpKolvo[playerid]; PlayerInfo[ExpOffer[playerid]][pExp] -= ExpKolvo[playerid]; ExpOffer[playerid] = 999; ExpPrice[playerid] = 0; ExpKolvo[playerid] = 0; return 1; } else { ExpOffer[playerid] = 999; ExpPrice[playerid] = 0; ExpKolvo[playerid] = 0; return 1; } }
Для GF Code if(dialogid == 160) { if(response) { new giveplayer[26]; new sendername[36]; if(PlayerInfo[playerid][pCash] < ExpPrice[playerid]) return SendClientMessage(playerid, COLOR_GREY, "у вас нехватает денег!"); GetPlayerName(ExpOffer[playerid], giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string,256,"{ffffff}Кол-во купленых респектов: {33AAFF}%d\n{ffffff}Продавец:{33AAFF} %s\n{ffffff}Стоимость:{33AAFF} %d$",ExpKolvo[playerid],giveplayer,ExpPrice[playerid]); SPD(playerid,191,DIALOG_STYLE_MSGBOX,"Информация о покупке:",string,"Ïðèíÿòü",""); format(string, sizeof(string), "%s купил у вас %d респектов за $%d.",sendername,ExpKolvo[playerid],ExpPrice[playerid]); SendClientMessage(ExpOffer[playerid], COLOR_YELLOW, string); GiveMoney(playerid, -ExpPrice[playerid]); GiveMoney(ExpOffer[playerid],ExpPrice[playerid]); PlayerInfo[playerid][pExp] += ExpKolvo[playerid]; PlayerInfo[ExpOffer[playerid]][pExp] -= ExpKolvo[playerid]; ExpOffer[playerid] = 999; ExpPrice[playerid] = 0; ExpKolvo[playerid] = 0; return 1; } else { ExpOffer[playerid] = 999; ExpPrice[playerid] = 0; ExpKolvo[playerid] = 0; return 1; } }
В public OnPlayerCommandText Code if(strcmp(cmd, "/sellexp", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pExp]== 0) { SendClientMessage(playerid,COLOR_GREY,"У вас нету респектов!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "* Используйте: /sellexp [ID] [кол-во] [цена]"); new playa; new money; new kolvo; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { return 1; } kolvo = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { return 1; } money = strval(tmp); if(kolvo > PlayerInfo[playerid][pExp]) { SendClientMessage(playerid, COLOR_GREY, "У вас нету столько респектов!"); return 1; } if(kolvo <= 0) { SendClientMessage(playerid, COLOR_GREY, "* Неверное кол-во EXP!"); return 1; } if(money <= 0) { SendClientMessage(playerid, COLOR_GREY, "* Неверное кол-во денег!"); return 1; } if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { if (ProxDetectorS(8.0, playerid, playa)) { if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "Нельзя продать респекты себе!"); return 1; } GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Вы предложили %s купить %d респектов за $%d.", giveplayer, kolvo, money); SendClientMessage(playerid, 0x6B8E23FF, string); new sellexpition[150]; new msg[] = "{ffffff}Игрок %s предложил вам купить %d респектов за %d$\nЧтобы купить нажмите {228B22}(( Да )) {ffffff}Для отказа нажмите {228B22}(( Нет ))"; format(sellexpition, 150, msg,sendername,kolvo,money); SPD(playa,160,DIALOG_STYLE_MSGBOX,"Покупка EXP",sellexpition,"Äà","Íåò"); ExpOffer[playa] = playerid; ExpPrice[playa] = money; ExpKolvo[playa] = kolvo; } else { SendClientMessage(playerid, COLOR_RED, "* Игрок не рядом с вами!"); } } } else { SendClientMessage(playerid, COLOR_RED, "* Игрок не в игре."); } } return 1; }
From Russia With Love!
|
|
|
|