Konu

#1
Oyuncunun oyuna giriş yaptığında en son kullandığı crosshair hangisi ise onda kalmasını ayarlarmısınız?

Kod:
#include <amxmodx>
#include <fakemeta>
#include <nvault>
#include <reapi>

new const PLUGIN[] = "Croshair_Menu";
new const VERSION[] = "Premium";
new const AUTHOR[] = "By.KinG";

new const TAG[] = "ZeuS";
new const KISA_TAG[] = "Zs";

new const ClCmd_Crosshair_Menu[][] =
{
    "say /cross",
    "say !cross",
    "say .cross",
    "say /crosshair",
    "say !crosshair",
    "say .crosshair",
    "say /crosshairmenu",
    "say !crosshairmenu",
    "say .crosshairmenu",
    "say /crosshair_menu",
    "say !crosshair_menu",
    "say .crosshair_menu",
    "say_team /cross",
    "say_team !cross",
    "say_team .cross",
    "say_team /crosshair",
    "say_team !crosshair",
    "say_team .crosshair",
    "say_team /crosshairmenu",
    "say_team !crosshairmenu",
    "say_team .crosshairmenu",
    "say_team /crosshair_menu",
    "say_team !crosshair_menu",
    "say_team .crosshair_menu",
    "radio3"
};

new const CrossHair_Infos[][][64] =
{
    { "CrossHair_Name", "CrossHair_Sprite", "CrossHair_TxT_Name", "CrossHair_TxT" },
    { "CS:GO Buyuk", "sprites/CSGO_Crosshair_Buyuk.spr", "CSGO_Crosshair_Buyuk_TxT", "sprites/CSGO_Crosshair_Buyuk_TxT.txt" },
    { "CS:GO Buyuk 2", "sprites/CSGO_Crosshair_Buyuk_2.spr", "CSGO_Crosshair_Buyuk_2_TxT", "sprites/CSGO_Crosshair_Buyuk_2_TxT.txt" },
    { "CS:GO Kucuk", "sprites/CSGO_Crosshair.spr", "CSGO_Crosshair_TxT", "sprites/CSGO_Crosshair_TxT.txt" },
    { "CS:GO Yeni", "sprites/CSGO_Crosshair_New.spr", "CSGO_Crosshair_New_TxT", "sprites/CSGO_Crosshair_New_TxT.txt" },
    { "CS:GO Baslangic", "sprites/CSGO_Started.spr", "CSGO_Started_TxT", "sprites/CSGO_Started_TxT.txt" },
    { "CS:GO Baslangic 2", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_1", "sprites/CSGO_CrossHair_Pack_1.txt" },
    { "CS:GO Yeni Mavi", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_2", "sprites/CSGO_CrossHair_Pack_2.txt" },
    { "CS:GO Yeni Yesil", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_3", "sprites/CSGO_CrossHair_Pack_3.txt" },
    { "CS:GO Yeni Yesil 2", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_4", "sprites/CSGO_CrossHair_Pack_4.txt" },
    { "CS:GO Yeni Mavi", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_5", "sprites/CSGO_CrossHair_Pack_5.txt" },
    { "CS:GO Yeni Mavi 2", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_6", "sprites/CSGO_CrossHair_Pack_6.txt" },
    { "CS:GO Yesil", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_7", "sprites/CSGO_CrossHair_Pack_7.txt" },
    { "CS:GO Kirmizi", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_8", "sprites/CSGO_CrossHair_Pack_8.txt" },
    { "CS:GO Sari Kucuk", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_9", "sprites/CSGO_CrossHair_Pack_9.txt" },
    { "CS:GO Mavi Kucuk", "sprites/CSGO_CrossHair_Pack.spr", "CSGO_CrossHair_Pack_10", "sprites/CSGO_CrossHair_Pack_10.txt" }
};

new Vault;
new CrossHair_ID[33], Fov_ID[33];

enum _:Messages
{
    Message_WeaponList,
    Message_ScreenFade,
    Message_CurWeapon,
    Message_ForceCam,
    Message_SetFov,
    Message_HideWeapon
};

new Message_New[Messages];

new Messages_Names[Messages][] =
{
    "WeaponList",
    "ScreenFade",
    "CurWeapon",
    "ForceCam",
    "SetFOV",
    "HideWeapon"
};

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);

    for(new i; i < sizeof(ClCmd_Crosshair_Menu); i++)
    {
        register_clcmd(ClCmd_Crosshair_Menu[i], "CrossHair_Menu");
    }

    for(new i; i < sizeof(Message_New); i++)
    {
        Message_New[i] = get_user_msgid(Messages_Names[i]);
    }

    register_event("CurWeapon", "Event_CurWeapon", "be", "1=1");
    register_forward(FM_CmdStart, "Forward_CmdStart", 0);
}

public plugin_precache()
{
    for(new i = 1; i < sizeof(CrossHair_Infos); i++)
    {
        precache_generic(CrossHair_Infos[i][1]);
        precache_generic(CrossHair_Infos[i][3]);
    }
}

public plugin_cfg()
{
    Vault = nvault_open("CrossHair");
    
    if(Vault == INVALID_HANDLE)
    {
        set_fail_state("NVault Dosyasi Acilamadi");
    }
}

public plugin_end()
{
    nvault_close(Vault);
}

public client_connect(ID)
{
    new Auth_ID[33], Key[64], Data[256], CrossHair_Num;
    get_user_authid(ID, Auth_ID, charsmax(Auth_ID));
    formatex(Key, 63, "%s-ID", Auth_ID);
    nvault_get(Vault, Key, Data, charsmax(Data));
    CrossHair_Num = str_to_num(Data);
    
    if(CrossHair_Num == 0)
    {
        CrossHair_ID[ID] = random_num(1, 15);
    }
    else
    {
        CrossHair_ID[ID] = str_to_num(Data);
    }
}

public client_putinserver(ID)
{
    Fov_ID[ID] = 1;
}

public CrossHair_Menu(ID)
{
    new Str[6];
    static Item[128];
    
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yCrossHair Menu \rPremium \d[\rC\d]", TAG);
    new Menu = menu_create(Item, "CrossHair_Menu_Handler");
    
    for(new i = 1; i <= 5; i++)
    {
        num_to_str(i, Str, 5);
        
        if(CrossHair_ID[ID] == i)
        {
            formatex(Item, charsmax(Item), "\r%s", CrossHair_Infos[i][0]);
        }
        else
        {
            formatex(Item, charsmax(Item), "\w%s", CrossHair_Infos[i][0]);
        }
        
        menu_additem(Menu, Item, Str);
    }
    
    formatex(Item, charsmax(Item), "\dNormal CrossHair^n");
    menu_additem(Menu, Item, "16");
    formatex(Item, charsmax(Item), "\rGorus Acisi Menu");
    menu_additem(Menu, Item, "17");
    
    for(new i = 6; i <= 10; i++)
    {
        num_to_str(i, Str, 5);
        
        if(CrossHair_ID[ID] == i)
        {
            formatex(Item, charsmax(Item), "\r%s", CrossHair_Infos[i][0]);
        }
        else
        {
            formatex(Item, charsmax(Item), "\w%s", CrossHair_Infos[i][0]);
        }
        
        menu_additem(Menu, Item, Str);
    }
    
    formatex(Item, charsmax(Item), "\dNormal CrossHair^n");
    menu_additem(Menu, Item, "16");
    formatex(Item, charsmax(Item), "\rGorus Acisi Menu");
    menu_additem(Menu, Item, "17");
    
    for(new i = 11; i <= 15; i++)
    {
        num_to_str(i, Str, 5);
        
        if(CrossHair_ID[ID] == i)
        {
            formatex(Item, charsmax(Item), "\r%s", CrossHair_Infos[i][0]);
        }
        else
        {
            formatex(Item, charsmax(Item), "\w%s", CrossHair_Infos[i][0]);
        }
        
        menu_additem(Menu, Item, Str);
    }
    
    formatex(Item, charsmax(Item), "\dNormal CrossHair^n");
    menu_additem(Menu, Item, "16");
    formatex(Item, charsmax(Item), "\rGorus Acisi Menu");
    menu_additem(Menu, Item, "17");
    
    menu_setprop(Menu, MPROP_NUMBER_COLOR, "\r");
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yGeri", KISA_TAG);
    menu_setprop(Menu, MPROP_BACKNAME, Item);
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yIleri", KISA_TAG);
    menu_setprop(Menu, MPROP_NEXTNAME, Item);
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yCikis", KISA_TAG);
    menu_setprop(Menu, MPROP_EXITNAME, Item);
    menu_display(ID, Menu, 0);

    return PLUGIN_HANDLED;
}

public CrossHair_Menu_Handler(ID, Menu, Item)
{
    if(Item == MENU_EXIT)
    {
        menu_destroy(Menu);
        return PLUGIN_HANDLED;
    }
    
    new Access, Data[6], Menu_Name[64], Call_Back;
    menu_item_getinfo(Menu, Item, Access, Data, 5, Menu_Name, 63, Call_Back);
    new Key = str_to_num(Data);
    
    switch(Key)
    {
        case 17 :
        {
            Gorus_Acisi_Menu(ID);
        }
        default :
        {
            if(get_user_weapon(ID) == CSW_KNIFE)
            {
                client_print_color(ID, ID, "^3[%s] ^4Elinizde ^3Bicak ^4Varken ^3CrossHair ^4Degistiremezsiniz", TAG);
                CrossHair_Menu(ID);
            }
            else
            {
                if(CrossHair_ID[ID] == Key)
                {
                    client_print_color(ID, ID, "^3[%s] ^4Sectiginiz CrossHair Zaten ^3Aktif", TAG);
                    CrossHair_Menu(ID);
                }
                else
                {
                    CrossHair_ID[ID] = Key;
                    client_cmd(ID, "lastinv; wait; wait; wait; wait; wait; wait; wait; wait; wait; wait; lastinv");
                    
                    if(Key == 16)
                    {
                        client_print_color(ID, ID, "^3[%s] ^4Basarili Bir Sekilde ^3Normal ^4CrossHair'i Aktif Ettin", TAG);
                    }
                    else
                    {
                        client_print_color(ID, ID, "^3[%s] ^4Basarili Bir Sekilde ^3%s ^4CrossHair'ini Aktif Ettin", TAG, CrossHair_Infos[Key][0]);
                    }
                    
                    CrossHair_Menu(ID);
                }
            }
        }
    }

    return PLUGIN_HANDLED;
}

public Gorus_Acisi_Menu(ID)
{
    static Item[128];
    
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yGorus Acisi Menu", TAG);
    new Menu = menu_create(Item, "Gorus_Acisi_Menu_Handler");
    
    formatex(Item, charsmax(Item), "\wNormal");
    menu_additem(Menu, Item, "1");
    formatex(Item, charsmax(Item), "\wUzak");
    menu_additem(Menu, Item, "2");
    formatex(Item, charsmax(Item), "\wUzak 2^n");
    menu_additem(Menu, Item, "3");
    
    formatex(Item, charsmax(Item), "\d[ \w- \rCrossHair Menu\yye Don \w- \d]");
    menu_additem(Menu, Item, "4");
    
    menu_setprop(Menu, MPROP_NUMBER_COLOR, "\r");
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yGeri", KISA_TAG);
    menu_setprop(Menu, MPROP_BACKNAME, Item);
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yIleri", KISA_TAG);
    menu_setprop(Menu, MPROP_NEXTNAME, Item);
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yCikis", KISA_TAG);
    menu_setprop(Menu, MPROP_EXITNAME, Item);
    menu_display(ID, Menu, 0);
    
    return PLUGIN_HANDLED;
}

public Gorus_Acisi_Menu_Handler(ID, Menu, Item)
{
    if(Item == MENU_EXIT)
    {
        menu_destroy(Menu);
        return PLUGIN_HANDLED;
    }

    new Access, Data[6], Menu_Name[64], Call_Back;
    menu_item_getinfo(Menu, Item, Access, Data, 5, Menu_Name, 63, Call_Back);
    new Key = str_to_num(Data);
    
    switch(Key)
    {
        case 1 :
        {
            Fov_ID[ID] = 1;
            Gorus_Acisi_Menu(ID);
        }
        case 2 :
        {
            Fov_ID[ID] = 2;
            Gorus_Acisi_Menu(ID);
        }
        case 3 :
        {
            Fov_ID[ID] = 3;
            Gorus_Acisi_Menu(ID);
        }
        case 4 :
        {
            CrossHair_Menu(ID);
        }
    }

    return PLUGIN_HANDLED;
}

public Event_CurWeapon(ID)
{
    if(!is_user_connected(ID))
    {
        return PLUGIN_HANDLED;
    }
    
    Control_CrossHair(ID);
    return PLUGIN_HANDLED;
}

public Forward_CmdStart(ID, Handle)
{
    if(!is_user_connected(ID))
    {
        return PLUGIN_HANDLED;
    }
    
    Control_CrossHair(ID);
    return PLUGIN_HANDLED;
}

public Control_CrossHair(ID)
{    
    static Weapon_ID, Primary, Sprite_TxT[52];
    Weapon_ID = get_user_weapon(ID, Primary);
    
    if(get_member(ID, m_iFOV) != 90)
    {
        return PLUGIN_HANDLED;
    }
    if(Weapon_ID == CSW_SCOUT || Weapon_ID == CSW_AWP || Weapon_ID== CSW_G3SG1 || Weapon_ID == CSW_SG550)
    {
        return PLUGIN_HANDLED;
    }
    else if(CrossHair_ID[ID] == 16)
    {
        switch(Fov_ID[ID])
        {
            case 1 :
            {
                Message_Set_FOV(ID, 90);
            }
            case 2 :
            {
                Message_Set_FOV(ID, 100);
            }
            case 3 :
            {
                Message_Set_FOV(ID, 110);
            }
        }
        
        Hide_CrossHair(ID, 2);

        return PLUGIN_HANDLED;
    }
    else
    {
        set_pdata_int(ID, 361, get_pdata_int(ID, 361) | (1<<6));
        formatex(Sprite_TxT, charsmax(Sprite_TxT), "%s", CrossHair_Infos[CrossHair_ID[ID]][2]);
        
        switch(Weapon_ID)
        {
            case CSW_P228 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 9, 52, -1, -1, 0, 11, 2, 0);
            }
            case CSW_HEGRENADE :
            {
                Message_Weapon_List(ID, Sprite_TxT, 12, 1, -1, -1, 0, 11, 2, 0);
            }
            case CSW_XM1014 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 5, 32, -1, -1, 0, 11, 2, 0);
            }
            case CSW_C4 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 14, 1, -1, -1, 0, 11, 2, 0);
            }
            case CSW_MAC10 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 6, 100, -1, -1, 0, 11, 2, 0);
            }
            case CSW_AUG :
            {
                Message_Weapon_List(ID, Sprite_TxT, 4, 90, -1, -1, 0, 11, 2, 0);
            }
            case CSW_SMOKEGRENADE :
            {
                Message_Weapon_List(ID, Sprite_TxT, 13, 1, -1, -1, 0, 11, 2, 0);
            }
            case CSW_ELITE :
            {
                Message_Weapon_List(ID, Sprite_TxT, 10, 120, -1, -1, 0, 11, 2, 0);
            }
            case CSW_FIVESEVEN :
            {
                Message_Weapon_List(ID, Sprite_TxT, 7, 100, -1, -1, 0, 11, 2, 0);
            }
            case CSW_UMP45 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 6, 100, -1, -1, 0, 11, 2, 0);
            }
            case CSW_GALIL :
            {
                Message_Weapon_List(ID, Sprite_TxT, 4, 90, -1, -1, 0, 11, 2, 0);
            }
            case CSW_FAMAS :
            {
                Message_Weapon_List(ID, Sprite_TxT, 4, 90, -1, -1, 0, 11, 2, 0);
            }
            case CSW_USP :
            {
                Message_Weapon_List(ID, Sprite_TxT, 6, 100, -1, -1, 0, 11, 2, 0);
            }
            case CSW_GLOCK18 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 10, 120, -1, -1, 0, 11, 2, 0);
            }
            case CSW_MP5NAVY :
            {
                Message_Weapon_List(ID, Sprite_TxT, 10, 120, -1, -1, 0, 11, 2, 0);
            }
            case CSW_M249 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 3, 200, -1, -1, 0, 11, 2, 0);
            }
            case CSW_M3 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 5, 32, -1, -1, 0, 11, 2, 0);
            }
            case CSW_M4A1 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 4, 90, -1, -1, 0, 11, 2, 0);
            }
            case CSW_TMP :
            {
                Message_Weapon_List(ID, Sprite_TxT, 10, 120, -1, -1, 0, 11, 2, 0);
            }
            case CSW_FLASHBANG :
            {
                Message_Weapon_List(ID, Sprite_TxT, 11, 2, -1, -1, 0, 11, 2, 0);
            }
            case CSW_DEAGLE :
            {
                Message_Weapon_List(ID, Sprite_TxT, 8, 35, -1, -1, 0, 11, 2, 0);
            }
            case CSW_SG552 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 4, 90, -1, -1, 0, 11, 2, 0);
            }
            case CSW_AK47 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 2, 90, -1, -1, 0, 11, 2, 0);
            }
            case CSW_KNIFE :
            {
                Message_Weapon_List(ID, Sprite_TxT, -1, -1, -1,-1,0,11, 2, 0);
            }
            case CSW_P90 :
            {
                Message_Weapon_List(ID, Sprite_TxT, 7, 100, -1, -1, 0, 11, 2, 0);
            }
        }
        
        switch(Fov_ID[ID])
        {
            case 1 :
            {
                Message_Set_FOV(ID, 89);
                Message_Cur_Weapon(ID, 1, 2, Primary);
                Message_Set_FOV(ID, 90);
            }
            case 2 :
            {
                Message_Set_FOV(ID, 89);
                Message_Cur_Weapon(ID, 1, 2, Primary);
                Message_Set_FOV(ID, 100);
            }
            case 3 :
            {
                Message_Set_FOV(ID, 89);
                Message_Cur_Weapon(ID, 1, 2, Primary);
                Message_Set_FOV(ID, 110);
            }
        }
    }
    
    new Auth_ID[33], Key[64], Data[256];
    get_user_authid(ID, Auth_ID, charsmax(Auth_ID));
    formatex(Key, 63, "%s-ID", Auth_ID);
    formatex(Data, 255, "%i", CrossHair_ID[ID]);
    nvault_pset(Vault, Key, Data);
    
    return PLUGIN_HANDLED;
}

stock Hide_CrossHair(ID, Num)
{
    switch(Num)
    {
        case 1 :
        {
            set_pdata_int(ID, 361, get_pdata_int(ID, 361) | (1<<6));
        }
        case 2 :
        {
            set_pdata_int(ID, 361, get_pdata_int(ID, 361) & ~(1<<6));
        }
    }
}

stock Message_Cur_Weapon(ID, Active, Weapon_ID, Clip_Ammo)
{
    message_begin(MSG_ONE, Message_New[Message_CurWeapon], {0, 0, 0}, ID);
    write_byte(Active);
    write_byte(Weapon_ID);
    write_byte(Clip_Ammo);
    message_end();
}

stock Message_Weapon_List(ID, const Weapon_Name[], Primary_Ammo_ID, Primary_Ammo_Max_Amount, Secondary_Ammo_ID, Secondary_Ammo_Max_Amount, Slot_ID, Number_In_Slot, Weapon_ID, Flags)
{
    message_begin(MSG_ONE, Message_New[Message_WeaponList], _, ID);
    {
        write_string(Weapon_Name);
        write_byte(Primary_Ammo_ID);
        write_byte(Primary_Ammo_Max_Amount);
        write_byte(Secondary_Ammo_ID);
        write_byte(Secondary_Ammo_Max_Amount);
        write_byte(Slot_ID);
        write_byte(Number_In_Slot);
        write_byte(Weapon_ID);
        write_byte(Flags);
    }

    message_end();
}

stock Message_Set_FOV(ID, Degrees)
{
    message_begin(MSG_ONE, Message_New[Message_SetFov], {0, 0, 0}, ID);
    write_byte(Degrees);
    message_end();
}

Son Düzenleme: 13-12-2021, 21:36, Düzenleyen: justminute.
#2
Bunun için nvault sistemi lazım, ama alttaki eklentiyi bir dene bakalım :
PHP Kod:
#include <amxmodx>
#include <fakemeta>
#include <nvault>
#include <reapi>

new const PLUGIN[] = "Croshair_Menu";
new const 
VERSION[] = "Premium";
new const 
AUTHOR[] = "By.KinG";

new const 
TAG[] = "ZeuS";
new const 
KISA_TAG[] = "Zs";

new const 
ClCmd_Crosshair_Menu[][] =
{
    "say /cross",
    "say !cross",
    "say .cross",
    "say /crosshair",
    "say !crosshair",
    "say .crosshair",
    "say /crosshairmenu",
    "say !crosshairmenu",
    "say .crosshairmenu",
    "say /crosshair_menu",
    "say !crosshair_menu",
    "say .crosshair_menu",
    "say_team /cross",
    "say_team !cross",
    "say_team .cross",
    "say_team /crosshair",
    "say_team !crosshair",
    "say_team .crosshair",
    "say_team /crosshairmenu",
    "say_team !crosshairmenu",
    "say_team .crosshairmenu",
    "say_team /crosshair_menu",
    "say_team !crosshair_menu",
    "say_team .crosshair_menu",
    "radio3"
};

new const 
CrossHair_Infos[][][64] =
{
    "CrossHair_Name""CrossHair_Sprite""CrossHair_TxT_Name""CrossHair_TxT" },
    "CS:GO Buyuk""sprites/CSGO_Crosshair_Buyuk.spr""CSGO_Crosshair_Buyuk_TxT""sprites/CSGO_Crosshair_Buyuk_TxT.txt" },
    "CS:GO Buyuk 2""sprites/CSGO_Crosshair_Buyuk_2.spr""CSGO_Crosshair_Buyuk_2_TxT""sprites/CSGO_Crosshair_Buyuk_2_TxT.txt" },
    "CS:GO Kucuk""sprites/CSGO_Crosshair.spr""CSGO_Crosshair_TxT""sprites/CSGO_Crosshair_TxT.txt" },
    "CS:GO Yeni""sprites/CSGO_Crosshair_New.spr""CSGO_Crosshair_New_TxT""sprites/CSGO_Crosshair_New_TxT.txt" },
    "CS:GO Baslangic""sprites/CSGO_Started.spr""CSGO_Started_TxT""sprites/CSGO_Started_TxT.txt" },
    "CS:GO Baslangic 2""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_1""sprites/CSGO_CrossHair_Pack_1.txt" },
    "CS:GO Yeni Mavi""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_2""sprites/CSGO_CrossHair_Pack_2.txt" },
    "CS:GO Yeni Yesil""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_3""sprites/CSGO_CrossHair_Pack_3.txt" },
    "CS:GO Yeni Yesil 2""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_4""sprites/CSGO_CrossHair_Pack_4.txt" },
    "CS:GO Yeni Mavi""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_5""sprites/CSGO_CrossHair_Pack_5.txt" },
    "CS:GO Yeni Mavi 2""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_6""sprites/CSGO_CrossHair_Pack_6.txt" },
    "CS:GO Yesil""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_7""sprites/CSGO_CrossHair_Pack_7.txt" },
    "CS:GO Kirmizi""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_8""sprites/CSGO_CrossHair_Pack_8.txt" },
    "CS:GO Sari Kucuk""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_9""sprites/CSGO_CrossHair_Pack_9.txt" },
    "CS:GO Mavi Kucuk""sprites/CSGO_CrossHair_Pack.spr""CSGO_CrossHair_Pack_10""sprites/CSGO_CrossHair_Pack_10.txt" }
};

new 
Vault;
new 
CrossHair_ID[33], Fov_ID[33];

enum _:Messages
{
    Message_WeaponList,
    Message_ScreenFade,
    Message_CurWeapon,
    Message_ForceCam,
    Message_SetFov,
    Message_HideWeapon
};

new 
Message_New[Messages];

new 
Messages_Names[Messages][] =
{
    "WeaponList",
    "ScreenFade",
    "CurWeapon",
    "ForceCam",
    "SetFOV",
    "HideWeapon"
};

public 
plugin_init()
{
    register_plugin(PLUGINVERSIONAUTHOR);

    for(new isizeof(ClCmd_Crosshair_Menu); i++)
    {
        register_clcmd(ClCmd_Crosshair_Menu[i], "CrossHair_Menu");
    }

    for(new isizeof(Message_New); i++)
    {
        Message_New[i] = get_user_msgid(Messages_Names[i]);
    }

    register_event("CurWeapon""Event_CurWeapon""be""1=1");
    register_forward(FM_CmdStart"Forward_CmdStart"0);
}

public 
plugin_precache()
{
    for(new 1sizeof(CrossHair_Infos); i++)
    {
        precache_generic(CrossHair_Infos[i][1]);
        precache_generic(CrossHair_Infos[i][3]);
    }
}

public 
plugin_cfg()
{
    Vault nvault_open("CrossHair");
    
    
if(Vault == INVALID_HANDLE)
    {
        set_fail_state("NVault Dosyasi Acilamadi");
    }
}

public 
plugin_end()
{
    nvault_close(Vault);
}

public 
client_connect(ID)
{
    new Auth_ID[33], Key[64], Data[256], CrossHair_Num;
    get_user_authid(IDAuth_IDcharsmax(Auth_ID));
    formatex(Key63"%s-ID"Auth_ID);
    nvault_get(VaultKeyDatacharsmax(Data));
    CrossHair_Num str_to_num(Data);
    
    
if(CrossHair_Num == 0)
    {
        CrossHair_ID[ID] = random_num(115);
    }
    else
    {
        CrossHair_ID[ID] = str_to_num(Data);
    }
}
public 
CrossHair_Menu(ID)
{
    new Str[6];
    static Item[128];
    
    formatex
(Itemcharsmax(Item), "\d[\r%s\d] \w| \yCrossHair Menu \rPremium \d[\rC\d]"TAG);
    new Menu menu_create(Item"CrossHair_Menu_Handler");
    
    
for(new 1<= 5i++)
    {
        num_to_str(iStr5);
        
        
if(CrossHair_ID[ID] == i)
        {
            formatex(Itemcharsmax(Item), "\r%s"CrossHair_Infos[i][0]);
        }
        else
        {
            formatex(Itemcharsmax(Item), "\w%s"CrossHair_Infos[i][0]);
        }
        
        menu_additem
(MenuItemStr);
    }
    
    formatex
(Itemcharsmax(Item), "\dNormal CrossHair^n");
    menu_additem(MenuItem"16");
    formatex(Itemcharsmax(Item), "\rGorus Acisi Menu");
    menu_additem(MenuItem"17");
    
    
for(new 6<= 10i++)
    {
        num_to_str(iStr5);
        
        
if(CrossHair_ID[ID] == i)
        {
            formatex(Itemcharsmax(Item), "\r%s"CrossHair_Infos[i][0]);
        }
        else
        {
            formatex(Itemcharsmax(Item), "\w%s"CrossHair_Infos[i][0]);
        }
        
        menu_additem
(MenuItemStr);
    }
    
    formatex
(Itemcharsmax(Item), "\dNormal CrossHair^n");
    menu_additem(MenuItem"16");
    formatex(Itemcharsmax(Item), "\rGorus Acisi Menu");
    menu_additem(MenuItem"17");
    
    
for(new 11<= 15i++)
    {
        num_to_str(iStr5);
        
        
if(CrossHair_ID[ID] == i)
        {
            formatex(Itemcharsmax(Item), "\r%s"CrossHair_Infos[i][0]);
        }
        else
        {
            formatex(Itemcharsmax(Item), "\w%s"CrossHair_Infos[i][0]);
        }
        
        menu_additem
(MenuItemStr);
    }
    
    formatex
(Itemcharsmax(Item), "\dNormal CrossHair^n");
    menu_additem(MenuItem"16");
    formatex(Itemcharsmax(Item), "\rGorus Acisi Menu");
    menu_additem(MenuItem"17");
    
    menu_setprop
(MenuMPROP_NUMBER_COLOR"\r");
    formatex(Itemcharsmax(Item), "\d[\r%s\d] \w| \yGeri"KISA_TAG);
    menu_setprop(MenuMPROP_BACKNAMEItem);
    formatex(Itemcharsmax(Item), "\d[\r%s\d] \w| \yIleri"KISA_TAG);
    menu_setprop(MenuMPROP_NEXTNAMEItem);
    formatex(Itemcharsmax(Item), "\d[\r%s\d] \w| \yCikis"KISA_TAG);
    menu_setprop(MenuMPROP_EXITNAMEItem);
    menu_display(IDMenu0);

    return PLUGIN_HANDLED;
}

public 
CrossHair_Menu_Handler(IDMenuItem)
{
    if(Item == MENU_EXIT)
    {
        menu_destroy(Menu);
        return PLUGIN_HANDLED;
    }
    
    
new AccessData[6], Menu_Name[64], Call_Back;
    menu_item_getinfo(MenuItemAccessData5Menu_Name63Call_Back);
    new Key str_to_num(Data);
    
    
switch(Key)
    {
        case 17 :
        {
            Gorus_Acisi_Menu(ID);
        }
        default :
        {
            if(get_user_weapon(ID) == CSW_KNIFE)
            {
                client_print_color(IDID"^3[%s] ^4Elinizde ^3Bicak ^4Varken ^3CrossHair ^4Degistiremezsiniz"TAG);
                CrossHair_Menu(ID);
            }
            else
            {
                if(CrossHair_ID[ID] == Key)
                {
                    client_print_color(IDID"^3[%s] ^4Sectiginiz CrossHair Zaten ^3Aktif"TAG);
                    CrossHair_Menu(ID);
                }
                else
                {
                    CrossHair_ID[ID] = Key;
                    client_cmd(ID"lastinv; wait; wait; wait; wait; wait; wait; wait; wait; wait; wait; lastinv");
                    
                    
if(Key == 16)
                    {
                        client_print_color(IDID"^3[%s] ^4Basarili Bir Sekilde ^3Normal ^4CrossHair'i Aktif Ettin"TAG);
                    }
                    else
                    {
                        client_print_color(IDID"^3[%s] ^4Basarili Bir Sekilde ^3%s ^4CrossHair'ini Aktif Ettin"TAGCrossHair_Infos[Key][0]);
                    }
                    
                    CrossHair_Menu
(ID);
                }
            }
        }
    }

    return PLUGIN_HANDLED;
}

public 
Gorus_Acisi_Menu(ID)
{
    static Item[128];
    
    formatex
(Itemcharsmax(Item), "\d[\r%s\d] \w| \yGorus Acisi Menu"TAG);
    new Menu menu_create(Item"Gorus_Acisi_Menu_Handler");
    
    formatex
(Itemcharsmax(Item), "\wNormal");
    menu_additem(MenuItem"1");
    formatex(Itemcharsmax(Item), "\wUzak");
    menu_additem(MenuItem"2");
    formatex(Itemcharsmax(Item), "\wUzak 2^n");
    menu_additem(MenuItem"3");
    
    formatex
(Itemcharsmax(Item), "\d[ \w- \rCrossHair Menu\yye Don \w- \d]");
    menu_additem(MenuItem"4");
    
    menu_setprop
(MenuMPROP_NUMBER_COLOR"\r");
    formatex(Itemcharsmax(Item), "\d[\r%s\d] \w| \yGeri"KISA_TAG);
    menu_setprop(MenuMPROP_BACKNAMEItem);
    formatex(Itemcharsmax(Item), "\d[\r%s\d] \w| \yIleri"KISA_TAG);
    menu_setprop(MenuMPROP_NEXTNAMEItem);
    formatex(Itemcharsmax(Item), "\d[\r%s\d] \w| \yCikis"KISA_TAG);
    menu_setprop(MenuMPROP_EXITNAMEItem);
    menu_display(IDMenu0);
    
    
return PLUGIN_HANDLED;
}

public 
Gorus_Acisi_Menu_Handler(IDMenuItem)
{
    if(Item == MENU_EXIT)
    {
        menu_destroy(Menu);
        return PLUGIN_HANDLED;
    }

    new AccessData[6], Menu_Name[64], Call_Back;
    menu_item_getinfo(MenuItemAccessData5Menu_Name63Call_Back);
    new Key str_to_num(Data);
    
    
switch(Key)
    {
        case :
        {
            Fov_ID[ID] = 1;
            Gorus_Acisi_Menu(ID);
        }
        case :
        {
            Fov_ID[ID] = 2;
            Gorus_Acisi_Menu(ID);
        }
        case :
        {
            Fov_ID[ID] = 3;
            Gorus_Acisi_Menu(ID);
        }
        case :
        {
            CrossHair_Menu(ID);
        }
    }

    return PLUGIN_HANDLED;
}

public 
Event_CurWeapon(ID)
{
    if(!is_user_connected(ID))
    {
        return PLUGIN_HANDLED;
    }
    
    Control_CrossHair
(ID);
    return PLUGIN_HANDLED;
}

public 
Forward_CmdStart(IDHandle)
{
    if(!is_user_connected(ID))
    {
        return PLUGIN_HANDLED;
    }
    
    Control_CrossHair
(ID);
    return PLUGIN_HANDLED;
}

public 
Control_CrossHair(ID)
{
    
    
static Weapon_IDPrimarySprite_TxT[52];
    Weapon_ID get_user_weapon(IDPrimary);
    
    
if(get_member(IDm_iFOV) != 90)
    {
        return PLUGIN_HANDLED;
    }
    if(Weapon_ID == CSW_SCOUT || Weapon_ID == CSW_AWP || Weapon_ID== CSW_G3SG1 || Weapon_ID == CSW_SG550)
    {
        return PLUGIN_HANDLED;
    }
    else if(CrossHair_ID[ID] == 16)
    {
        switch(Fov_ID[ID])
        {
            case :
            {
                Message_Set_FOV(ID90);
            }
            case :
            {
                Message_Set_FOV(ID100);
            }
            case :
            {
                Message_Set_FOV(ID110);
            }
        }
        
        Hide_CrossHair
(ID2);

        return PLUGIN_HANDLED;
    }
    else
    {
        set_pdata_int(ID361get_pdata_int(ID361) | (1<<6));
        formatex(Sprite_TxTcharsmax(Sprite_TxT), "%s"CrossHair_Infos[CrossHair_ID[ID]][2]);
        
        
switch(Weapon_ID)
        {
            case CSW_P228 :
            {
                Message_Weapon_List(IDSprite_TxT952, -1, -101120);
            }
            case CSW_HEGRENADE :
            {
                Message_Weapon_List(IDSprite_TxT121, -1, -101120);
            }
            case CSW_XM1014 :
            {
                Message_Weapon_List(IDSprite_TxT532, -1, -101120);
            }
            case CSW_C4 :
            {
                Message_Weapon_List(IDSprite_TxT141, -1, -101120);
            }
            case CSW_MAC10 :
            {
                Message_Weapon_List(IDSprite_TxT6100, -1, -101120);
            }
            case CSW_AUG :
            {
                Message_Weapon_List(IDSprite_TxT490, -1, -101120);
            }
            case CSW_SMOKEGRENADE :
            {
                Message_Weapon_List(IDSprite_TxT131, -1, -101120);
            }
            case CSW_ELITE :
            {
                Message_Weapon_List(IDSprite_TxT10120, -1, -101120);
            }
            case CSW_FIVESEVEN :
            {
                Message_Weapon_List(IDSprite_TxT7100, -1, -101120);
            }
            case CSW_UMP45 :
            {
                Message_Weapon_List(IDSprite_TxT6100, -1, -101120);
            }
            case CSW_GALIL :
            {
                Message_Weapon_List(IDSprite_TxT490, -1, -101120);
            }
            case CSW_FAMAS :
            {
                Message_Weapon_List(IDSprite_TxT490, -1, -101120);
            }
            case CSW_USP :
            {
                Message_Weapon_List(IDSprite_TxT6100, -1, -101120);
            }
            case CSW_GLOCK18 :
            {
                Message_Weapon_List(IDSprite_TxT10120, -1, -101120);
            }
            case CSW_MP5NAVY :
            {
                Message_Weapon_List(IDSprite_TxT10120, -1, -101120);
            }
            case CSW_M249 :
            {
                Message_Weapon_List(IDSprite_TxT3200, -1, -101120);
            }
            case CSW_M3 :
            {
                Message_Weapon_List(IDSprite_TxT532, -1, -101120);
            }
            case CSW_M4A1 :
            {
                Message_Weapon_List(IDSprite_TxT490, -1, -101120);
            }
            case CSW_TMP :
            {
                Message_Weapon_List(IDSprite_TxT10120, -1, -101120);
            }
            case CSW_FLASHBANG :
            {
                Message_Weapon_List(IDSprite_TxT112, -1, -101120);
            }
            case CSW_DEAGLE :
            {
                Message_Weapon_List(IDSprite_TxT835, -1, -101120);
            }
            case CSW_SG552 :
            {
                Message_Weapon_List(IDSprite_TxT490, -1, -101120);
            }
            case CSW_AK47 :
            {
                Message_Weapon_List(IDSprite_TxT290, -1, -101120);
            }
            case CSW_KNIFE :
            {
                Message_Weapon_List(IDSprite_TxT, -1, -1, -1,-1,0,1120);
            }
            case CSW_P90 :
            {
                Message_Weapon_List(IDSprite_TxT7100, -1, -101120);
            }
        }
        
        
switch(Fov_ID[ID])
        {
            case :
            {
                Message_Set_FOV(ID89);
                Message_Cur_Weapon(ID12Primary);
                Message_Set_FOV(ID90);
            }
            case :
            {
                Message_Set_FOV(ID89);
                Message_Cur_Weapon(ID12Primary);
                Message_Set_FOV(ID100);
            }
            case :
            {
                Message_Set_FOV(ID89);
                Message_Cur_Weapon(ID12Primary);
                Message_Set_FOV(ID110);
            }
        }
    }
    
    
new Auth_ID[33], Key[64], Data[256];
    get_user_authid(IDAuth_IDcharsmax(Auth_ID));
    formatex(Key63"%s-ID"Auth_ID);
    formatex(Data255"%i"CrossHair_ID[ID]);
    nvault_pset(VaultKeyData);
    
    
return PLUGIN_HANDLED;
}

stock Hide_CrossHair(IDNum)
{
    switch(Num)
    {
        case :
        {
            set_pdata_int(ID361get_pdata_int(ID361) | (1<<6));
        }
        case :
        {
            set_pdata_int(ID361get_pdata_int(ID361) & ~(1<<6));
        }
    }
}

stock Message_Cur_Weapon(IDActiveWeapon_IDClip_Ammo)
{
    message_begin(MSG_ONEMessage_New[Message_CurWeapon], {000}, ID);
    write_byte(Active);
    write_byte(Weapon_ID);
    write_byte(Clip_Ammo);
    message_end();
}

stock Message_Weapon_List(ID, const Weapon_Name[], Primary_Ammo_IDPrimary_Ammo_Max_AmountSecondary_Ammo_IDSecondary_Ammo_Max_AmountSlot_IDNumber_In_SlotWeapon_IDFlags)
{
    message_begin(MSG_ONEMessage_New[Message_WeaponList], _ID);
    {
        write_string(Weapon_Name);
        write_byte(Primary_Ammo_ID);
        write_byte(Primary_Ammo_Max_Amount);
        write_byte(Secondary_Ammo_ID);
        write_byte(Secondary_Ammo_Max_Amount);
        write_byte(Slot_ID);
        write_byte(Number_In_Slot);
        write_byte(Weapon_ID);
        write_byte(Flags);
    }

    message_end();
}

stock Message_Set_FOV(IDDegrees)
{
    message_begin(MSG_ONEMessage_New[Message_SetFov], {000}, ID);
    write_byte(Degrees);
    message_end();

(- Ücretli Eklenti Yaptırmak İsteyen -)
#3
Aim komple gitti
#5
Evet aynısını kullanıyorum fakat oyuncu oyuna gir çık yapınca crosshair sıfırlanıyor
#7
İstek konusu, @suriyelikene adlı kullanıcı tarafından 4 saat içinde çözülmüştür.
İsteği çözdüğü için suriyelikene Adlı kullanıcıya 1 rep puanı ve 1 yardım etme puanı otomatik olarak verilmiştir.
suriyelikene Adlı kullanıcı sizin dışınızda toplam 842 kişiye yardım etmiştir.

Herhangi bir konuda hata olduğunu düşünüyorsanız destek sistemi üzerinden iletişim kurabilirsiniz.

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Benzer Konular

2
Yorum
2.722
Okunma
23-01-2022, 20:46
10
Yorum
2.967
Okunma
17-01-2022, 22:09
15
Yorum
3.231
Okunma
04-01-2022, 19:15
11
Yorum
3.593
Okunma
27-12-2021, 18:04
5
Yorum
3.427
Okunma
19-12-2021, 02:56
2
Yorum
3.497
Okunma
18-12-2021, 17:40
4
Yorum
3.892
Okunma
06-12-2021, 20:25
Task
Kayıt Ol
Discord Adresimize Katılın