Jump to content
  • Tutorials
  • makowaxd

    Przerobienie pluginu /knife tylko dla CT

    Recommended Posts

    Błagam was kto pomoze mi przerobic plugin tak aby /knife byl tylko dla CT a nie dla TT wiecie bo robie zombieescape i jak wpisuje /knife i zmieniam model to wtedy podmienia model dla CT i TT czili dla zombie kto pomoze 

     

    #include amxmodx
    #include hamsandwich
    #include fakemeta
    
    new precache_list[][] = {
        "models/engame/v_default.mdl","models/engame/v_flip.mdl","models/engame/v_karambit.mdl","models/engame/v_m9_bayonet.mdl",
        "models/engame/p_default.mdl","models/engame/p_flip.mdl","models/engame/p_karambit.mdl","models/engame/p_m9_bayonet.mdl"
    };
    new knife[33];
    
    public plugin_init() {
        register_plugin("CS:GO Knife Menu","1.0.0","ANDRW");
        register_clcmd("say /knife","knife_menu");
        register_event("CurWeapon","set_model","be","1=1");
    }
    public client_putinserver(id) knife[id] = -1;
    public plugin_precache() for(new i = 0; i <= charsmax(precache_list); i++) precache_model(precache_list);
    public knife_menu(id) {
        new menu = menu_create("\r[CS:GO] \wKnife Menu","knife_menu_butoane");
        menu_additem(menu,"\wDefault Knife","",0);
        menu_additem(menu,"\wFlip Knife","",0);
        menu_additem(menu,"\wP9 Bayonet Knife","",0);
        menu_additem(menu,"\wKarambit Knife","",0);
        menu_setprop(menu,MPROP_EXIT,MEXIT_ALL);
        menu_display(id,menu,0);
    }
    public knife_menu_butoane(id,menu,item) {
        switch(item) {
            case 0: {
                knife[id] = 0;
                client_print(id,print_chat,"[CS:GO] You selected Default Knife!");
                set_model(id);
            }
            case 1: {
                knife[id] = 1;
                client_print(id,print_chat,"[CS:GO] You selected Flip Knife!");
                set_model(id);
            }
            case 2: {
                knife[id] = 2;
                client_print(id,print_chat,"[CS:GO] You selected P9 Bayonet Knife!");
                set_model(id);
            }
            case 3: {
                knife[id] = 3;
                client_print(id,print_chat,"[CS:GO] You selected Karambit Knife!");
                set_model(id);
            }
        }
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    public set_model(id) {
        new x = knife[id];
        if(get_user_weapon(id) == CSW_KNIFE && is_user_alive(id)) {
            switch(x) {
                case 0: {
                    set_pev(id,pev_viewmodel2,"models/engame/v_default.mdl");
                    set_pev(id,pev_weaponmodel2,"models/engame/p_default.mdl");
                }
                case 1: {
                    set_pev(id,pev_viewmodel2,"models/engame/v_flip.mdl");
                    set_pev(id,pev_weaponmodel2,"models/engame/p_flip.mdl");
                }
                case 2: {
                    set_pev(id,pev_viewmodel2,"models/engame/v_m9_bayonet.mdl");
                    set_pev(id,pev_weaponmodel2,"models/engame/p_m9_bayonet.mdl");
                }
                case 3: {
                    set_pev(id,pev_viewmodel2,"models/engame/v_karambit.mdl");
                    set_pev(id,pev_weaponmodel2,"models/engame/p_karambit.mdl");
                }
            }
        }
    }

     

    Share this post


    Link to post
    Share on other sites
    Donator

    Skompilować chyba potrafisz masz ;) 

    Jak nie będzie działać to napisz jaki błąd Ci wyskakuje a drugie pytanie Czy to Zombie + BB? 

     

    Spoiler

    Hidden Content

      Give reaction to this post to see the hidden content.

    case 1:

    {

    if(~GetBlock(id))

    {

    SetBlock(id);

    }

    }

    case 2:

    {

    if(GetBlock(id))

    {

    ClearBlock(id);

    }

    }

    }

    }

     

    public ItemDeploy(iEnt)

    {

    new iPlayer;

    if(~GetBlock((iPlayer = get_pdata_cbase(iEnt, 41, 4))) != 1) return;

     

    engclient_cmd(iPlayer, "weapon_knife");

    }

     

    public TouchGun(iEnt, id)

    {

    if(!is_user_alive(id) || ~GetBlock(id))

    {

    return HAM_IGNORED;

    }

    return HAM_SUPERCEDE;

    }

     

    Share this post


    Link to post
    Share on other sites
    Author of the topic Posted
    9 godzin temu, Damianciu napisał:

    Skompilować chyba potrafisz masz ;) 

    Jak nie będzie działać to napisz jaki błąd Ci wyskakuje a drugie pytanie Czy to Zombie + BB? 

     

      Pokaż ukrytą zawartość

    Ukryta zawartość
    • #include <amxmodx>

       

      #include <fakemeta>

      #include <hamsandwich>

       

      #define GetBlock(%0) g_iBitBlockedWeapons & (1<<(%0 & 31))

      #define SetBlock(%0) g_iBitBlockedWeapons |= (1<<(%0 & 31))

      #define ClearBlock(%0) g_iBitBlockedWeapons &= ~(1<<(%0 & 31))

       

      new g_iBitBlockedWeapons;

       

      public plugin_init()

      {

      register_plugin("Block Weapons", "1.0", "Damianciu");

       

      RegisterHamPlayer(Ham_Spawn, "SpawnPlayer");

       

      new szBlockTouchGun[][] = {

      "armoury_entity", "weaponbox", "weapon_shield"

      };

       

      for(new i; i < sizeof szBlockTouchGun; i++)

      {

      RegisterHam(Ham_Touch, szBlockTouchGun, "TouchGun");

      }

       

      new szName[24];

      for(new i = CSW_P228; i <= CSW_P90; i++)

      {

      if(!(1<<CSW_KNIFE & 1<<i) && get_weaponname(i, szName, 23))

      {

      RegisterHam(Ham_Item_Deploy, szName, "ItemDeploy", 1);

      }

      }

      }

       

      public client_disconnect(id)

      {

      if(~GetBlock(id))

      {

      return;

      }

      ClearBlock(id);

      }

       

      public SpawnPlayer(id)

      {

      switch(get_user_team(id)) {

     

    case 1:

    {

    if(~GetBlock(id))

    {

    SetBlock(id);

    }

    }

    case 2:

    {

    if(GetBlock(id))

    {

    ClearBlock(id);

    }

    }

    }

    }

     

    public ItemDeploy(iEnt)

    {

    new iPlayer;

    if(~GetBlock((iPlayer = get_pdata_cbase(iEnt, 41, 4))) != 1) return;

     

    engclient_cmd(iPlayer, "weapon_knife");

    }

     

    public TouchGun(iEnt, id)

    {

    if(!is_user_alive(id) || ~GetBlock(id))

    {

    return HAM_IGNORED;

    }

    return HAM_SUPERCEDE;

    }

     

    Zombie Escape :D

     

    Share this post


    Link to post
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


    ×
    ×
    • Create New...

    Important Information

    By using this site you agree to Privacy Policy.