[Pomoc] oko modifikacije plugina
Results 1 to 5 of 5
  1. #1
    Junior Member Array
    Join Date
    Apr 2020
    Karma
    0

    Unhappy [Pomoc] oko modifikacije plugina

    Imam ovaj plugin za menjanje skinova admina i radi savrseno.

    Voleo bih da mi neko pomogne jer nisam programer da doda u taj plugin opciju ako je igrac CT da ima CT menu i da ima npr samo skin "Assasin" i "Iron" a ako je T da ima T menu sa skinom npr "Joker" i "Death".
    I bilo bi super da moze da sa vrati na default skin kao opcija 3 u meniju.

    Primer za CT:
    Menu CT
    1. Assasin
    2. Iron
    3. Original skin
    i tako za terore.

    Skapirao sam da kada obrisem "& ADMIN_LEVEL_H" i dodam access flag "U" da taj igrac moze da koristi ovo

    HTML Code:
    if (get_user_flags(id) & ADMIN_LEVEL_H)
    		{
    			model_menu(id)
    		}
    		else
    Evo coda tog plugina za menjanje skinova koji radi odlicno samo mi treba ta modifikacija:

    HTML Code:
    #include <amxmodx>
    #include <amxmisc>
    #include <cstrike>
    
    
    #define PLUGIN "Admin Model Menu"
    #define VERSION "1.0"
    #define AUTHOR "Dimision"
    #define ADMIN_LEVEL_Q	ADMIN_LEVEL_C
    
    public plugin_init() 
    {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_clcmd("say /admodels", "admin")
    }
    
    public plugin_precache() 
    {
            precache_model("models/player/Asasin/Asasin.mdl")
            precache_model("models/player/Death/Death.mdl")
            precache_model("models/player/Dobby/Dobby.mdl")
            precache_model("models/player/Sonic/Sonic.mdl")
            precache_model("models/player/Skeleton/Skeleton.mdl")
            precache_model("models/player/Joker/Joker.mdl")
            precache_model("models/player/Iron/Iron.mdl")
    }
    		
    public admin(id)
    {
    	if (get_user_flags(id) & ADMIN_LEVEL_H)
    		{
    			model_menu(id)
    		}
    		else
            {
                   ChatColor(id, "!g>> !nAceste modele sunt doar pentru !gAdmini !n!")
            }
    	
    }
    public model_menu(id)
    {
        new menu = menu_create("\r[\wAdmin Models\r]\r", "menu_wybierz")
        
        menu_additem(menu, "\wAsasin", "1", 0)
        menu_additem(menu, "\wDeath", "2", 0)
        menu_additem(menu, "\wDobby", "3", 0)
        menu_additem(menu, "\wSonic", "4", 0)
        menu_additem(menu, "\wSkeleton", "5", 0)
        menu_additem(menu, "\wJoker", "6", 0)
        menu_additem(menu, "\wIron", "7", 0)
    
        
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
        
        menu_display(id, menu, 0)
    }
    
    public menu_wybierz(id, menu, item)
    {
        if (item == MENU_EXIT)
        {
            menu_destroy(menu)
            return PLUGIN_HANDLED
        }
        new data[6], iName[64]
        new acces, callback
        menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
        
        new key = str_to_num(data)
        
        switch(key)
        { 
           case 1 : cs_set_user_model(id, "Asasin")
           case 2 : cs_set_user_model(id, "Death")
           case 3 : cs_set_user_model(id, "Dobby")
           case 4 : cs_set_user_model(id, "Sonic")
           case 5 : cs_set_user_model(id, "Skeleton")
           case 6 : cs_set_user_model(id, "Joker")
           case 7 : cs_set_user_model(id, "Iron")
        }
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }  
    stock ChatColor(const id, const input[], any:...) {
    	new count = 1, players[32];
    	static msg[191];
    	vformat(msg, 190, input, 3);
    	
    	replace_all(msg, 190, "!g", "^4"); // verde
    	replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
    	replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
    	replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
    	
    	if (id) players[0] = id; else get_players(players, count, "ch");
    	{
    		for (new i = 0; i < count; i++)
    			{
    			if (is_user_connected(players[i]))
    				{
    				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
    				write_byte(players[i]);
    				write_string(msg);
    				message_end();
    			}
    		}
    	}
    }

    Ovde u ovom pluginu koji takodje super radi sam nasao opciju "Cameleon" ciji bi kod verujem da moze da se iskoristi za vracanje na originalni skin https://forums.alliedmods.net/showthread.php?t=86041


    Hvala unapred

  2. #2

    Default

    Quote Originally Posted by MilosKG View Post
    Imam ovaj plugin za menjanje skinova admina i radi savrseno.

    Skapirao sam da kada obrisem "& ADMIN_LEVEL_H" i dodam access flag "U" da taj igrac moze da koristi ovo
    Pogledaj u cmdaccess.ini na kojem je flagu namestena ta komanda pa stavi u .SMA... Jer je Y magican flag (sto znaci ukoliko ima bilo koji flag moze daaaaa koristi to)
    Last edited by InsaNe Shone; 11-05-2020 at 11:55.

  3. #3
    Senior Member Array
    Join Date
    Aug 2013
    Location
    Forbidden Forest
    Karma
    14

    Default

    Kakav magicni flag ?
    Pomoc oko plugina, TS3-a, discord-a mozete dobiti samo u vidu objasnjenja.
    P.S. Nemojte smarati/hejtovati obzirom da to niko ne voli a ja licno cu samo da vas kuliram.
    P.P.S. Nemojte pitati stvari na PM vec otvori temu.

  4. #4

    Default

    Quote Originally Posted by SkazzY View Post
    Kakav magicni flag ?

    #define ADMIN_ALL 0 //Everyone
    #define ADMIN_IMMUNITY 1 //Flag "a", immunity
    #define ADMIN_RESERVATION 2 //Flag "b", reservation
    #define ADMIN_KICK 4 //Flag "c", kick
    #define ADMIN_BAN 8 //Flag "d", ban
    #define ADMIN_SLAY 16 //Flag "e", slay
    #define ADMIN_MAP 32 //Flag "f", map change
    #define ADMIN_CVAR 64 //Flag "g", cvar change
    #define ADMIN_CFG 128 //Flag "h", config execution
    #define ADMIN_CHAT 256 //Flag "i", chat
    #define ADMIN_VOTE 512 //Flag "j", vote
    #define ADMIN_PASSWORD 1024 //Flag "k", sv_password
    #define ADMIN_RCON 2048 //Flag "l", rcon access
    #define ADMIN_LEVEL_A 4096 //Flag "m", custom
    #define ADMIN_LEVEL_B 8192 //Flag "n", custom
    #define ADMIN_LEVEL_C 16384 //Flag "o", custom
    #define ADMIN_LEVEL_D 32768 //Flag "p", custom
    #define ADMIN_LEVEL_E 65536 //Flag "q", custom
    #define ADMIN_LEVEL_F 131072 //Flag "r", custom
    #define ADMIN_LEVEL_G 262144 //Flag "s", custom
    #define ADMIN_LEVEL_H 524288 //Flag "t", custom
    #define ADMIN_MENU 1048576 //Flag "u", menus
    #define ADMIN_ADMIN 16777216 //Flag "y", default admin
    #define ADMIN_USER 33554432 //Flag "z", default user

  5. #5
    Senior Member Array
    Join Date
    Aug 2013
    Location
    Forbidden Forest
    Karma
    14

    Default

    To je flag kao i bilo koji drugi. Nema on nikakvu magiju, samo se tako zove.
    Pomoc oko plugina, TS3-a, discord-a mozete dobiti samo u vidu objasnjenja.
    P.S. Nemojte smarati/hejtovati obzirom da to niko ne voli a ja licno cu samo da vas kuliram.
    P.P.S. Nemojte pitati stvari na PM vec otvori temu.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •