Restrict

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Post Reply
Terror
Senbūvis
Posts: 1086
Joined: 2015 Feb 27 19:29
Location: Alytus

Restrict

Post by Terror »

Sveiki, iškilo problema kažkodėl neveikia nieko neblokuoja toks kodas kur cia klaida ? :)

ter_restrict "32 25 4"
ct_restrict "32 25"

Code: Select all

public ter_restrict() {    new args[128];    read_args(args, charsmax(args));        add_to_restriction(CS_TEAM_T, args);        return PLUGIN_HANDLED;} public ct_restrict() {    new args[128];    read_args(args, charsmax(args));        add_to_restriction(CS_TEAM_CT, args);     return PLUGIN_HANDLED;} stock add_to_restriction(any:team, args[]) {    remove_quotes(args);    trim(args);        restrictions[team] = 0;        if(args[0])     {        new arg[32], pos;                while((pos = argparse(args, pos, arg, charsmax(arg))) != -1)         {            restrictions[team] |= (1 << (str_to_num(arg) - 1));        }    }} public CS_OnBuy(id, item) {       if(item > 32 && item != CSI_SHIELDGUN)     {        return PLUGIN_CONTINUE;    }        if(item == CSI_VEST || item == CSI_VESTHELM)     {        return check_restriction(id, CSI_VEST);    }     else         if(item == CSI_SHIELDGUN)         {        return check_restriction(id, CSI_VESTHELM);    }        return check_restriction(id, item);} stock check_restriction(id, item) {    if(restrictions[players_team[id]] && (1 << (item - 1)))     {        return PLUGIN_HANDLED;    }        return PLUGIN_CONTINUE;}
Last edited by Terror on 2017 Sep 12 05:00, edited 1 time in total.

Softero
Jau po truputį tampa savu
Posts: 174
Joined: 2016 Jan 17 20:11
Skype: Einartas10

Re: Restrict

Post by Softero »

[php]  if(restrictions[players_team[id]] && (1 << (item - 1))) [/php]
galbut turetu buti tik vienas & ?
cs1.6 pluginų , bei web sistemų kūrimas
discord: Softero#0457
Email: [email protected]

Terror
Senbūvis
Posts: 1086
Joined: 2015 Feb 27 19:29
Location: Alytus

Re: Restrict

Post by Terror »

Softero wrote:[php]  if(restrictions[players_team[id]] && (1 << (item - 1))) [/php]
galbut turetu buti tik vienas & ?
Ne, jau tikrinau pries tai irgi apie tai pagalvojau bet ne

User avatar
laimiukas3
Moderatorius
Posts: 4569
Joined: 2012 Aug 03 01:12
Skype: laimiukas3
Location: Vilnius
Contact:

Re: Restrict

Post by laimiukas3 »

gal sitas tiks reapi
Attachments
items_restrict_ultimate_0.0.4.zip
(4.38 KiB) Downloaded 262 times
Image
Image
Image

Terror
Senbūvis
Posts: 1086
Joined: 2015 Feb 27 19:29
Location: Alytus

Re: Restrict

Post by Terror »

laimiukas3 wrote:gal sitas tiks
Kiek suprantu cia tiek T tiek CT.
Man reik jog Butent Tik T komandai užblokuoti HE pirkima.

-- 2017 Rgs 12 01:24 --

Nebereikia, susitvarkiau (rakinkite)

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests