Page 1 of 1

Vote vienai komandai

Posted: 2013 Jan 26 18:44
by xedga
Turiu toki vote koda. Kaip reiktu padaryti, kad balsuoti duotu tik tai komandai, kurios žmogus iškvietė vote?

Code: Select all

public Vote() {    new title[64]    formatex(title, charsmax(title), "\r%L", LANG_PLAYER, "TITLE")    g_fVoteMenu = menu_create(title, "voteVV");        new itemOn[10], itemOff[10]    formatex(itemOn, charsmax(itemOn), "%L", LANG_PLAYER, "MENU_ITEM_ON")    formatex(itemOff, charsmax(itemOff), "%L", LANG_PLAYER, "MENU_ITEM_OFF")        menu_additem(g_fVoteMenu, itemOn)    menu_additem(g_fVoteMenu, itemOff)        new pplayers[32], ppnum, ptempid;        get_players(pplayers, ppnum, "ch");     for( new i; i<ppnum; i++ ){        ptempid = pplayers[i]        client_print(ptempid, print_chat, "%s %L", PREFIX, LANG_PLAYER, "PICK")        menu_display(ptempid, g_fVoteMenu, 0)    }    set_task(10.0, "EndVote"    return PLUGIN_HANDLED}
Pvz tiems kas nesuprato: Petras, kuris yra CT komandoje parašo atitinkamą komandą, tarkim /vote ir visa CT komanda gauna balsavima. O pvz praejus kažkiek laiko Jonas is T komandos sugalvoja parašyti /vote ir šį balsavimą gauna T komanda. Ačiū už pagalbą

Re: Vote vienai komandai

Posted: 2013 Jan 26 19:29
by Spag
xedga wrote:Turiu toki vote koda. Kaip reiktu padaryti, kad balsuoti duotu tik tai komandai, kurios žmogus iškvietė vote?

Code: Select all

public Vote() {    new title[64]    formatex(title, charsmax(title), "\r%L", LANG_PLAYER, "TITLE")    g_fVoteMenu = menu_create(title, "voteVV");        new itemOn[10], itemOff[10]    formatex(itemOn, charsmax(itemOn), "%L", LANG_PLAYER, "MENU_ITEM_ON")    formatex(itemOff, charsmax(itemOff), "%L", LANG_PLAYER, "MENU_ITEM_OFF")        menu_additem(g_fVoteMenu, itemOn)    menu_additem(g_fVoteMenu, itemOff)        new pplayers[32], ppnum, ptempid;        get_players(pplayers, ppnum, "ch");     for( new i; i<ppnum; i++ ){        ptempid = pplayers[i]        client_print(ptempid, print_chat, "%s %L", PREFIX, LANG_PLAYER, "PICK")        menu_display(ptempid, g_fVoteMenu, 0)    }    set_task(10.0, "EndVote"    return PLUGIN_HANDLED}
Pvz tiems kas nesuprato: Petras, kuris yra CT komandoje parašo atitinkamą komandą, tarkim /vote ir visa CT komanda gauna balsavima. O pvz praejus kažkiek laiko Jonas is T komandos sugalvoja parašyti /vote ir šį balsavimą gauna T komanda. Ačiū už pagalbą

maybe

Code: Select all

public Vote() {    new title[64]    formatex(title, charsmax(title), "\r%L", LANG_PLAYER, "TITLE")    g_fVoteMenu = menu_create(title, "voteVV");        new itemOn[10], itemOff[10]    formatex(itemOn, charsmax(itemOn), "%L", LANG_PLAYER, "MENU_ITEM_ON")    formatex(itemOff, charsmax(itemOff), "%L", LANG_PLAYER, "MENU_ITEM_OFF")        menu_additem(g_fVoteMenu, itemOn)    menu_additem(g_fVoteMenu, itemOff)        new players[32], num    get_players(players, num, "ae", "CT")     for( new i; i<num; i++ )    {        client_print(players[i], print_chat, "%s %L", PREFIX, LANG_PLAYER, "PICK")        menu_display(players[i], g_fVoteMenu, 0)    }    set_task(10.0, "EndVote")    return PLUGIN_HANDLED}

Re: Vote vienai komandai

Posted: 2013 Jan 26 19:34
by psychical
Spag wrote:
xedga wrote:Turiu toki vote koda. Kaip reiktu padaryti, kad balsuoti duotu tik tai komandai, kurios žmogus iškvietė vote?

Code: Select all

public Vote() {    new title[64]    formatex(title, charsmax(title), "\r%L", LANG_PLAYER, "TITLE")    g_fVoteMenu = menu_create(title, "voteVV");        new itemOn[10], itemOff[10]    formatex(itemOn, charsmax(itemOn), "%L", LANG_PLAYER, "MENU_ITEM_ON")    formatex(itemOff, charsmax(itemOff), "%L", LANG_PLAYER, "MENU_ITEM_OFF")        menu_additem(g_fVoteMenu, itemOn)    menu_additem(g_fVoteMenu, itemOff)        new pplayers[32], ppnum, ptempid;        get_players(pplayers, ppnum, "ch");     for( new i; i<ppnum; i++ ){        ptempid = pplayers[i]        client_print(ptempid, print_chat, "%s %L", PREFIX, LANG_PLAYER, "PICK")        menu_display(ptempid, g_fVoteMenu, 0)    }    set_task(10.0, "EndVote"    return PLUGIN_HANDLED}
Pvz tiems kas nesuprato: Petras, kuris yra CT komandoje parašo atitinkamą komandą, tarkim /vote ir visa CT komanda gauna balsavima. O pvz praejus kažkiek laiko Jonas is T komandos sugalvoja parašyti /vote ir šį balsavimą gauna T komanda. Ačiū už pagalbą

maybe

Code: Select all

public Vote() {    new title[64]    formatex(title, charsmax(title), "\r%L", LANG_PLAYER, "TITLE")    g_fVoteMenu = menu_create(title, "voteVV");        new itemOn[10], itemOff[10]    formatex(itemOn, charsmax(itemOn), "%L", LANG_PLAYER, "MENU_ITEM_ON")    formatex(itemOff, charsmax(itemOff), "%L", LANG_PLAYER, "MENU_ITEM_OFF")        menu_additem(g_fVoteMenu, itemOn)    menu_additem(g_fVoteMenu, itemOff)        new players[32], num    get_players(players, num, "ae", "CT")     for( new i; i<num; i++ )    {        client_print(players[i], print_chat, "%s %L", PREFIX, LANG_PLAYER, "PICK")        menu_display(players[i], g_fVoteMenu, 0)    }    set_task(10.0, "EndVote")    return PLUGIN_HANDLED}

Tavo atveju, vote gaus TIK Counter-Terrorist komanda

Code: Select all

public Vote(id) {    new title[64]    formatex(title, charsmax(title), "\r%L", LANG_PLAYER, "TITLE")    g_fVoteMenu = menu_create(title, "voteVV");        new item[63];    formatex(item, charsmax(item), "%L", LANG_PLAYER, "MENU_ITEM_ON");    menu_additem(g_fVoteMenu, item);    formatex(item, charsmax(item), "%L", LANG_PLAYER, "MENU_ITEM_OFF");    menu_additem(g_fVoteMenu, item);        new players[32], num, player;    get_players(players, num, "ae");     for( new i; i<num; i++ )    {        player = players[i];         if(get_user_team(id) == get_user_team(id))        {            client_print(players[i], print_chat, "%s %L", PREFIX, LANG_PLAYER, "PICK");            menu_display(players[i], g_fVoteMenu, 0);        }    }    set_task(10.0, "EndVote");    return PLUGIN_HANDLED;}
Kažkas tokio, GAL

Re: Vote vienai komandai

Posted: 2013 Jan 26 22:22
by hleV

Code: Select all

//public Vote() {public Vote(id) {

Code: Select all

//get_players(pplayers, ppnum, "ch");new team[16];get_user_team(id, team, charsmax(team));get_players(pplayers, ppnum, "ceh", team);
Iššaukdamas Vote funkciją, perduok jai žaidėjo, kuris iškvietė vote, ID (Vote(id)).

Re: Vote vienai komandai

Posted: 2013 Jan 27 11:39
by xedga
Ačiū hleV. Atrodo viskas veikia :)