decalfrequency 0 for vip/admins only

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Post Reply
User avatar
ShoX
Gana aktyvus vartotojas
Posts: 217
Joined: 2010 Nov 15 19:45
Location: Lithuania

decalfrequency 0 for vip/admins only

Post by ShoX »

Sveiki ,gal galit pataisyt sita plugina kad veiktu nes dabar jis man kazko nieko nereguoja (neveikia)
error jokiu ner bet neveikia.
reikia padaryti kad acc butu T raide.
tas kas neturi t flag suskamba no.wav (reikia ji pridet.)

Code: Select all

/*    Copyright © 2009, ConnorMcLeod      Admin Spray is free software;     you can redistribute it and/or modify it under the terms of the     GNU General Public License as published by the Free Software Foundation.      This program is distributed in the hope that it will be useful,     but WITHOUT ANY WARRANTY; without even the implied warranty of     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     GNU General Public License for more details.      You should have received a copy of the GNU General Public License     along with Admin Spray; if not, write to the     Free Software Foundation, Inc., 59 Temple Place - Suite 330,     Boston, MA 02111-1307, USA. */  #define FLAG_ADMIN_SPRAY        ADMIN_LEVEL_A  #include <amxmodx> #include <engine> #include <fakemeta>  #define PLUGIN "Admin Spray" #define AUTHOR "ConnorMcLeod" #define VERSION "0.0.1"  #define MAX_PLAYERS    32  #define m_flNextDecalTime 486  new g_bAdmin[MAX_PLAYERS+1]  public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)      register_impulse(201, "Player_Spray") }  public client_authorized(id) {     g_bAdmin[id] = !!(get_user_flags(id) & FLAG_ADMIN_SPRAY) }  public Player_Spray(id) {     if( g_bAdmin[id] )     {         set_pdata_float(id, m_flNextDecalTime, 0.0)     } }  

newb
Pluginų patvirtintojas
Posts: 1047
Joined: 2010 Sep 23 21:43
Location: Wonderland
Contact:

Re: decalfrequency 0 for vip/admins only

Post by newb »

Code: Select all

#include <amxmodx>#include <engine>#include <fakemeta> #define PLUGIN "Admin Spray"#define AUTHOR "ConnorMcLeod"#define VERSION "0.0.1" #define FLAG_ADMIN_SPRAY        ADMIN_LEVEL_H#define MAX_PLAYERS    32 #define m_flNextDecalTime 486 new g_bAdmin[MAX_PLAYERS+1] public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR)    register_impulse(201, "Player_Spray")} public client_putinserver(id)    g_bAdmin[id] = get_user_flags(id) & FLAG_ADMIN_SPRAY public Player_Spray(id)    if(g_bAdmin[id]) set_pdata_float(id, m_flNextDecalTime, 0.0)
Tik nesupratau kam cia toks bajeris buvo

Code: Select all

g_bAdmin[id] = !!(get_user_flags(id) & FLAG_ADMIN_SPRAY)
Gal Arnai paaiskinsi ? :D

User avatar
ShoX
Gana aktyvus vartotojas
Posts: 217
Joined: 2010 Nov 15 19:45
Location: Lithuania

Re: decalfrequency 0 for vip/admins only

Post by ShoX »

ta negi niekas negali pataisyti? :hm: :shok:

newb
Pluginų patvirtintojas
Posts: 1047
Joined: 2010 Sep 23 21:43
Location: Wonderland
Contact:

Re: decalfrequency 0 for vip/admins only

Post by newb »

O ka tavo manimu uzpostinau virsuj ?.. :/

P.S. Jau prigalvojau kam ten buvo !! Nes jei yra flagas H, g_bAdmin[id] buna ten kazkas panasaus i 54321, o su !! pasidaro 1. Seip nematau skirtumo...

User avatar
ShoX
Gana aktyvus vartotojas
Posts: 217
Joined: 2010 Nov 15 19:45
Location: Lithuania

Re: decalfrequency 0 for vip/admins only

Post by ShoX »

:D fail :D
ps: neveikai ....

newb
Pluginų patvirtintojas
Posts: 1047
Joined: 2010 Sep 23 21:43
Location: Wonderland
Contact:

Re: decalfrequency 0 for vip/admins only

Post by newb »

Jis gali neveikt tik jei uzeini ne vipu, o veliau pakeiti nick i vipo. Jei pagal IP vip/admin tai turi veikti.
Tik kad ta no nepridejau...

User avatar
ShoX
Gana aktyvus vartotojas
Posts: 217
Joined: 2010 Nov 15 19:45
Location: Lithuania

Re: decalfrequency 0 for vip/admins only

Post by ShoX »

tai kaip tu ji padarei kad vip/admin galetu naudotis spray ar negaletu?

User avatar
aaarnas
Vyr. diskusijų administratorius
Posts: 3891
Joined: 2010 Aug 31 13:21
Skype: fiarno
Contact:

Re: decalfrequency 0 for vip/admins only

Post by aaarnas »

Code: Select all

#define FLAG_ADMIN_SPRAY        ADMIN_LEVEL_A  #include <amxmodx> #include <engine>  #define PLUGIN "Admin Spray" #define AUTHOR "ConnorMcLeod" #define VERSION "0.0.1"  public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_impulse(201, "Player_Spray") }  public plugin_precache() precache_sound("misc/no.wav") public Player_Spray(id) {     if(!(get_user_flags(id) & FLAG_ADMIN_SPRAY))     {         client_cmd(id, "spk sound/misc/no.wav")        return PLUGIN_HANDLED_MAIN    }    return PLUGIN_CONTINUE} 
newb wrote:Tik nesupratau kam cia toks bajeris buvo

Code: Select all

g_bAdmin[id] = !!(get_user_flags(id) & FLAG_ADMIN_SPRAY)
Gal Arnai paaiskinsi ? :D

Code: Select all

 (get_user_flags(id) & FLAG_ADMIN_SPRAY) = 1/true!(get_user_flags(id) & FLAG_ADMIN_SPRAY) = 0/false!!(get_user_flags(id) & FLAG_ADMIN_SPRAY) = 1/true 
Tai kaip ir sakei - nėra skirtumo. Šioje vietoje čia nesąmonė.

!! naudojama čia:

Code: Select all

 54684 = 54684!54684 = 0!!54684 = 1 
!
Šis operatorius reiškia netiesą. Pvz:

Code: Select all

kintamasis != 1 // Bus nustatyta reikšmė - 0kintamasis != 0 // Bus nustatyta reikšmė - 1kintamasis = 5if(!!kintamasis) // Bus tiesa, nes ! pakeis reikšmę į 0, o antras ! pakeis į 1.
Palikau CS pasaulį ;/ . Nebepasiekiamas.

User avatar
ShoX
Gana aktyvus vartotojas
Posts: 217
Joined: 2010 Nov 15 19:45
Location: Lithuania

Re: decalfrequency 0 for vip/admins only

Post by ShoX »

dekui viskas veikia :)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests