Page 1 of 2

Dėl buyzone ir %s

Posted: 2012 Oct 04 13:50
by zirualas
Taigi iškilo bėda, noriu išimti buyzone, kad nieks negalėtu pirkti. Naudojau:

Code: Select all

remove_entity_name("func_buyzone")
plugin_init funkcijoje, bet tik viena raundą tai veikė.
Antras klausimas, kaip padaryti taip, kad hudmessage rodytu string %s.
Pas mane yra padaryta

Code: Select all

pClass[33][3];
O kaip padaryti, kad hudmessage atspindėtu kiekvieną klasės id kaip žodį? Pvz jei yra

Code: Select all

 pClass[id][1]
rašytu pirma klasė

Re: Dėl buyzone ir %s

Posted: 2012 Oct 04 14:05
by hleV

Re: Dėl buyzone ir %s

Posted: 2012 Oct 04 14:07
by zirualas
Ačiū. O kaip dėl antro klausimo? Jei neišku galiu pamėgint aiškiau papasakot.

Re: Dėl buyzone ir %s

Posted: 2012 Oct 04 14:59
by InvIs
show_hudmessage(id, "%s", pClass[id][1]) ?

Žiūrint kam tas pClass yra lygus

Re: Dėl buyzone ir %s

Posted: 2012 Oct 04 16:09
by zirualas
Jis lygus 0 arba 1, 1 reiškia, kad tas žaidėjas yra ta klasė. Pvz.
pClass[id][1] = 1; //pirma klasė
pClass[id][2] = 0; //Ne antra klasė
pClass[id][klasės id, jie yra nurodyti komentaruose mano plugine];

Re: Dėl buyzone ir %s

Posted: 2012 Oct 04 20:21
by hleV
Kam tu tą array kuri?

Code: Select all

enum{    CLASS_1,    CLASS_2    CLASS_3}; new const ClassNames[][] ={    "Pirma",    "Antra",    "Trecia"}; new pClass[33]; SomeFunction(client){    if (pClass[client])    {        show_hudmessage(client, "%s klase", ClassNames[pClass[client]]);    }}

Re: Dėl buyzone ir %s

Posted: 2012 Oct 05 07:30
by zirualas
Tai dabar klasę nustatyti reikia taip?
pClass[id] = class id
Nelabai aš suprantu tu enumu

-EDIT-

Prie to pačio norėčiau paklausti kaip su tuo formatex() daryti. Aš bandžiau taip:

Code: Select all

new shopMenuu[255];        formatex(shopMenuu, charsmax(shopMenuu), "\r Tiiitle");        new shopMenu = menu_create(shopMenu, "shopMenuHandler");

Re: Dėl buyzone ir %s

Posted: 2012 Oct 05 14:08
by InvIs
Kam tie enumai? Manau jų išvis ten nereikia ar klystu?

Code: Select all

new shopMenuu[255];       formatex(shopMenuu, charsmax(shopMenuu), "\r Tiiitle");       new shopMenu = menu_create(shopMenuu, "shopMenuHandler");
Bet tai galima ir:

Code: Select all

new shopMenu = menu_create("\r Title", "shopMenuHandler");

Re: Dėl buyzone ir %s

Posted: 2012 Oct 05 14:57
by zirualas
InvIs wrote:

Code: Select all

new shopMenuu[255];       formatex(shopMenuu, charsmax(shopMenuu), "\r Tiiitle");       new shopMenu = menu_create(shopMenuu, "shopMenuHandler");
Bet tai galima ir:

Code: Select all

new shopMenu = menu_create("\r Title", "shopMenuHandler");
žinau, kad galima taip, bet ar tu į tokia menu įdėsi ML kodus? Ar įdėsi %s kurie rašytu kainą pagal cVar?

-EDIT-
susigėdau, vis tas mano žioplumas, jau pastebėjau, kad viena u pamiršau prirašyt :oops:

O tai jei darau su formatex, tai kurti kiekvienam atskira pavadinimą? Pvz shopMenu1 ; shopMenu2 ir t.t?

-EDIT 2 -

Sukompilina viską gerai, bet neveikia, consolėj metą error:
L 10/05/2012 - 18:00:39: String formatted incorrectly - parameter 4 (total 4)
L 10/05/2012 - 18:00:39: [AMXX] Displaying debug trace (plugin "Untitled.amxx")
L 10/05/2012 - 18:00:39: [AMXX] Run time error 25: parameter error
L 10/05/2012 - 18:00:39: [AMXX] [0] Untitled.sma::OpenShopMenu (line 168)
L 10/05/2012 - 18:00:39: [AMXX] [1] Untitled.sma::mainMenuHandler (line 155)
Dėl error [1] nesijaudinkit, jei ištaisysim [0] veiks ir tas tada.

Kodas:

Code: Select all

new shopMenuu[255];        formatex(shopMenuu, charsmax(shopMenuu), "\r%L", "SHOP_MENU_TITLE");        new shopMenu = menu_create(shopMenuu, "shopMenuHandler");

Re: Dėl buyzone ir %s

Posted: 2012 Oct 05 17:28
by psychical

Code: Select all

    new shopMenuu[255];    formatex(shopMenuu, charsmax(shopMenuu), "\r%L", id, "SHOP_MENU_TITLE");    new shopMenu = menu_create(shopMenuu, "shopMenuHandler");