Cześć, mam następujący problem, a mianowicie, chcę, żeby odpowiedniemu graczowi dawało tyle dolarów, ile się wpisze. Jednak nie wiem jak zdobyć nick gracza, którego wybraliśmy z menu.
Kod to:
public Daj(id) { new szText[555 char] formatex(szText, charsmax(szText), "\rBaseBuilder\y | \w Daj \rDolary^nDolarow masz:\w %d$", cs_get_user_money(id)) new menu = menu_create(szText, "handler2"); new key[8], players[32], plnum,formats[64]; get_players(players, plnum, "ch"); for(new i=0; i<=plnum;++i) { if(is_user_alive(players[i])) { get_user_name(players[i], name, charsmax(name)); formatex(formats, charsmax(name), "%s", name); formatex(key, charsmax(key), "%d", players[i]); menu_additem(menu, formats, key); } } menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_setprop(menu, MPROP_BACKNAME, "Wroc"); menu_setprop(menu, MPROP_NEXTNAME, "Dalej"); menu_setprop(menu, MPROP_EXITNAME, "Wyjdz"); menu_display(id, menu, 0); return PLUGIN_HANDLED; } public handler2(id, menu, item) { if(item == MENU_EXIT) { menu_cancel(id); return PLUGIN_HANDLED; } new command[6], name[64], access, callback; menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback); //nie wiem jak zdobyc wybranego gracza z menu GetTrescDolary(id) menu_destroy(menu); return PLUGIN_HANDLED; } public GetTrescDolary(id) { console_cmd(id, "messagemode Dolary") } public GetDolaryAdm(id) { new szTextAdm[192] read_argv(1, szTextAdm, 191) new VALUE = str_to_num(szTextAdm) new idn = get_user_index(name) new iuserid = get_user_userid(idn) new Namee[32]; get_user_name(id, Namee, 31) cs_set_user_money(id, cs_get_user_money(id) - VALUE) cs_set_user_money(iuserid, cs_get_user_money(iuserid) + VALUE) return PLUGIN_CONTINUE }
Proszę o pomoc, z góry dzięki.