Page 1 of 1

decalfrequency 0 for vip/admins only

Posted: 2010 Dec 18 23:02
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)     } }  

Re: decalfrequency 0 for vip/admins only

Posted: 2010 Dec 19 07:45
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

Re: decalfrequency 0 for vip/admins only

Posted: 2010 Dec 20 14:57
by ShoX
ta negi niekas negali pataisyti? :hm: :shok:

Re: decalfrequency 0 for vip/admins only

Posted: 2010 Dec 20 15:15
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...

Re: decalfrequency 0 for vip/admins only

Posted: 2010 Dec 20 16:43
by ShoX
:D fail :D
ps: neveikai ....

Re: decalfrequency 0 for vip/admins only

Posted: 2010 Dec 20 18:47
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...

Re: decalfrequency 0 for vip/admins only

Posted: 2010 Dec 20 18:53
by ShoX
tai kaip tu ji padarei kad vip/admin galetu naudotis spray ar negaletu?

Re: decalfrequency 0 for vip/admins only

Posted: 2010 Dec 20 19:00
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.

Re: decalfrequency 0 for vip/admins only

Posted: 2010 Dec 20 19:58
by ShoX
dekui viskas veikia :)