Eklentiden model kaldırma

Konu

#1
Marsmellow ve burnoutu kaldırabilirmisiniz bir de yapılabiliyorsa 1 level bile 125 hp ile başlıyor onu 100 hp yapabilirseniz sevinirim
.rar XP_System.rar (Dosya Boyutu: 3,28 KB | İndirme Sayısı: 1)
#2
Kod:
#include <amxmodx>
#include <nvault>
#include <reapi>

#define PLUGIN "XP_System"
#define VERSION "3.0"
#define AUTHOR "By.KinG"

#define MAX_LEVEL 50
#define MAX_XP 100000000

new const TAG[] = "Karayel GaminG";
new const KISATAG[] = "KG";

new const LevelUp_Sound[] = "pro/effects/LeveL_Up.wav";

new Xp[33];
new MaxXp[33];
new Level[33];

new Kill_XP;
new HS_Kill_XP;
new Knife_Kill_XP;
new HS_Knife_Kill_XP;
new Grenade_Kill_XP;

new Level_HP_On;
new Level_HP_Inc;

new Level_Armor_On;
new Level_Armor_Inc;

new XP_Inc;
new MaxXP_FirstLevel;



new VaultName;
new SyncHudObject;

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    
    register_clcmd("say /level", "LeveLMenu");

    register_event("CurWeapon", "Event_Change_Weapon", "be", "1=1");
    RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed", .post = true);
    RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn", .post = true);
    
    Kill_XP = register_cvar("XP_Kill", "100");
    HS_Kill_XP = register_cvar("XP_Kill_HS", "250");
    Knife_Kill_XP = register_cvar("XP_Kill_Knife", "250");
    HS_Knife_Kill_XP = register_cvar("XP_Kill_Knife_HS", "500");
    Grenade_Kill_XP = register_cvar("XP_Kill_Grenade", "500");
    
    Level_HP_On = register_cvar("XP_LeveL_HP", "1");
    Level_HP_Inc = register_cvar("XP_LeveL_HP_Inc", "1");
    
    Level_Armor_On = register_cvar("XP_LeveL_AP", "1");
    Level_Armor_Inc = register_cvar("XP_LeveL_AP_Inc", "0.5");
    
    XP_Inc = register_cvar("XP_Inc", "2.0");
    MaxXP_FirstLevel = register_cvar("XP_First_Max_XP", "1");
    
    SyncHudObject = CreateHudSyncObj();
}

public plugin_precache()
{
    precache_sound(LevelUp_Sound);
}

public plugin_cfg()
{
    VaultName = nvault_open("XP_Level");
}

public plugin_end()
{
    nvault_close(VaultName);
}

public plugin_natives()
{
    register_native("Xp_ID", "Get_User_XP", 1);
    register_native("Level_ID", "Get_User_Level", 1);
    register_native("MaxXp_ID", "Get_User_MaxXp", 1);
}

public Get_User_XP(id)
{
    return Xp[id];
}

public Get_User_Level(id)
{
    return Level[id];
}

public Get_User_MaxXp(id)
{
    return MaxXp[id];
}

public client_putinserver(id)
{

    
    new Auth_ID[33], Text[64], Xp_ID[64];
    get_user_authid(id, Auth_ID, 32);
    formatex(Text, 63, "%s", Auth_ID);
    formatex(Xp_ID, 63, "%i#%i#%i", Xp[id], Level[id], MaxXp[id]);
    nvault_get(VaultName, Text, Xp_ID, 63);
    
    replace_all(Xp_ID, 255, "#", " ");
    
    new Player_XP[33], Player_Level[33], Player_MaxXp[33];
    parse(Xp_ID, Player_XP, 32, Player_Level, 32, Player_MaxXp, 32);
    
    Xp[id] = str_to_num(Player_XP);
    Level[id] = str_to_num(Player_Level);
    MaxXp[id] = str_to_num(Player_MaxXp);
    
    set_task(1.0, "Check_MaxXP", id);
}

public client_disconnected(id)
{
    remove_task(id);
}

public Set_Xp(id)
{
    new Auth_ID[33], Text[64], Xp_ID[64];
    get_user_authid(id, Auth_ID, 32);
    
    if (Level[id] > MAX_LEVEL)
    {
        Level[id] = MAX_LEVEL;
    }
    
    if (Xp[id] > MAX_XP)
    {
        Xp[id] = MAX_XP;
    }
    
    formatex(Text, 63, "%s", Auth_ID);
    formatex(Xp_ID, 63, "%i#%i#%i", Xp[id], Level[id], MaxXp[id]);
    nvault_set(VaultName, Text, Xp_ID);
}

public Check_Max_Level(id)
{
    if(!is_user_connected(id))
    {
        return PLUGIN_CONTINUE;
    }

    if(Xp[id] >= MaxXp[id])
    {
        new Name[33];
        get_user_name(id, Name, 32);
        
        Level[id]++;
        MaxXp[id] = floatround(float(MaxXp[id]) * get_pcvar_float(XP_Inc));
        
        Renkli_Yazi(0, "^1[^3%s^1] ^1[^3%s^1] Adli Oyuncu^3 %d ^4Levele Ulasti", TAG, Name, Level[id]);
        
        Set_Xp(id);
        
        message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id);
        write_short(4096*2);
        write_short(4096*5);
        write_short(0x0001);
        write_byte(random(256));
        write_byte(random(256));
        write_byte(random(256));
        write_byte(150);
        message_end();
        
        Check_Max_Level(id);
    }
    
    return PLUGIN_CONTINUE;
}

public Check_MaxXP(id)
{
    new MaxXP_ID = MaxXp[id];
    
    new Max_XP_ID = get_pcvar_num(MaxXP_FirstLevel);
    
    for (new i = 1; i <= Level[id]; i++)
    {
        Max_XP_ID = floatround(float(Max_XP_ID) * get_pcvar_float(XP_Inc));
    }
    
    if (MaxXP_ID != Max_XP_ID)
    {
        MaxXp[id] = Max_XP_ID;
    }
}


public LeveLMenu(id)
{
    static Item[128];
    
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yLeveL Menu", TAG);
    new Menu = menu_create(Item, "LeveLMenu_Handler");
    
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yPlayer LeveL", KISATAG);
    menu_additem(Menu, Item, "1");

    
    menu_setprop(Menu, MPROP_BACKNAME, "\wGeri");
    menu_setprop(Menu, MPROP_NEXTNAME, "\wIleri");
    menu_setprop(Menu, MPROP_EXITNAME, "\wCikis");
    menu_display(id, Menu, 0);
}

public LeveLMenu_Handler(id, Menu, Item)
{
    if(Item == MENU_EXIT)
    {
        menu_destroy(Menu);
        return PLUGIN_HANDLED;
    }
    
    new Data[6], Name[64];
    new Access, CallBack;
    menu_item_getinfo(Menu, Item, Access, Data, 5, Name, 63, CallBack);
    
    new Key = str_to_num(Data);
    
    switch(Key)
    {
        case 1 :
        {
            LevelleriGosterMenu(id);
        }

    }
    return PLUGIN_HANDLED;
}

public LevelleriGosterMenu(id)
{
    static Item[128];
    
    formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \yServerdeki Oyuncularin Levelleri", TAG);
    new Menu = menu_create(Item, "LevelleriGosterMenu_Handler");
    
    new Players[32], NumAll, New_ID, Str[6], Name[33];
    get_players(Players, NumAll);
    
    for(new i; i < NumAll; i++)
    {
        New_ID = Players[i];
        
        if(is_user_bot(New_ID) || is_user_hltv(New_ID)) continue;
        
        get_user_name(New_ID, Name, 32);
        num_to_str(New_ID, Str, 5);
        formatex(Item, charsmax(Item), "\d[\r%s\d] \w| \d[\r%d LeveL\d]", Name, Level[New_ID]);
        menu_additem(Menu, Item, Str);
    }
    
    menu_setprop(Menu, MPROP_BACKNAME, "\wGeri");
    menu_setprop(Menu, MPROP_NEXTNAME, "\wIleri");
    menu_setprop(Menu, MPROP_EXITNAME, "\wCikis");
    menu_display(id, Menu, 0);
}

public LevelleriGosterMenu_Handler(id, Menu, Item)
{
    if(Item == MENU_EXIT)
    {
        menu_destroy(Menu);
        return PLUGIN_HANDLED;
    }
    
    new Data[6], Name[64];
    new Access, CallBack;
    menu_item_getinfo(Menu, Item, Access, Data, 5, Name, 63, CallBack);
    
    new Key = str_to_num(Data);
    
    switch(Key)
    {
        default :
        {
            LeveLMenu(id);
        }
    }
    return PLUGIN_HANDLED;
}


public CBasePlayer_Killed(Victim, Killer)
{
    if(Victim == Killer || !is_user_connected(Killer))
    {
        return HC_CONTINUE;
    }
        
    switch(get_user_weapon(Killer))
    {
        case CSW_KNIFE :
        {
            switch(get_member(Victim, m_bHeadshotKilled))
            {
                case true :
                {
                    if(get_user_flags(Killer) & ADMIN_VOTE)
                    {
                        Xp[Killer] += (get_pcvar_num(HS_Knife_Kill_XP) * 2);
                        set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                        ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", (get_pcvar_num(HS_Knife_Kill_XP) * 2));
                    }
                    else
                    {
                        Xp[Killer] += get_pcvar_num(HS_Knife_Kill_XP);
                        set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                        ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", get_pcvar_num(HS_Knife_Kill_XP));
                    }
                }
                case false :
                {
                    if(get_user_flags(Killer) & ADMIN_VOTE)
                    {
                        Xp[Killer] += (get_pcvar_num(Knife_Kill_XP) * 2);
                        set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                        ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", (get_pcvar_num(Knife_Kill_XP) * 2));
                    }
                    else
                    {
                        Xp[Killer] += get_pcvar_num(Knife_Kill_XP);
                        set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                        ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", get_pcvar_num(Knife_Kill_XP));
                    }
                }
            }
        }
        case CSW_HEGRENADE :
        {
            if(get_user_flags(Killer) & ADMIN_VOTE)
            {
                Xp[Killer] += (get_pcvar_num(Grenade_Kill_XP) * 2);
                set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", (get_pcvar_num(Grenade_Kill_XP) * 2));
            }
            else
            {
                Xp[Killer] += get_pcvar_num(Grenade_Kill_XP);
                set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", get_pcvar_num(Grenade_Kill_XP));
            }
        }
        default :
        {
            switch(get_member(Victim, m_bHeadshotKilled))
            {
                case true :
                {
                    if(get_user_flags(Killer) & ADMIN_VOTE)
                    {
                        Xp[Killer] += (get_pcvar_num(HS_Kill_XP) * 2);
                        set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                        ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", (get_pcvar_num(HS_Kill_XP) * 2));
                    }
                    else
                    {
                        Xp[Killer] += get_pcvar_num(HS_Kill_XP);
                        set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                        ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", get_pcvar_num(HS_Kill_XP));
                    }
                }
                case false :
                {
                    if(get_user_flags(Killer) & ADMIN_VOTE)
                    {
                        Xp[Killer] += (get_pcvar_num(Kill_XP) * 2);
                        set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                        ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", (get_pcvar_num(Kill_XP) * 2));
                    }
                    else
                    {
                        Xp[Killer] += get_pcvar_num(Kill_XP);
                        set_hudmessage(255, 255, 255, -1.0, 0.40, 1, 3.0, 10.0);
                        ShowSyncHudMsg(Killer, SyncHudObject, "[ - %d XP Kazandin - ]", get_pcvar_num(Kill_XP));
                    }
                }
            }
        }
    }
    
    Set_Xp(Killer);
    Check_Max_Level(Killer);
    
    return HC_CONTINUE;
}

public CBasePlayer_Spawn(id)
{
        switch(get_pcvar_num(Level_HP_On))
    {
        case 1 :
        {
            set_entvar(id, var_health, Float: get_entvar(id, var_health) + floatround(float(Level[id]) * get_pcvar_float(Level_HP_Inc)));
        }
    }
    
    switch(get_pcvar_num(Level_Armor_On))
    {
        case 1 :
        {
            set_entvar(id, var_armorvalue, Float: get_entvar(id, var_armorvalue) + floatround(float(Level[id]) * get_pcvar_float(Level_Armor_Inc)));
        }
    }
    
    
    return PLUGIN_CONTINUE;
}

stock Renkli_Yazi(const ID, const InPut[], any:...)
{
    new Count = 1, Players[32];
    static Message[191];
    vformat(Message, 190, InPut, 3);
    
    /* ^1 | ^x01 --> Default - Yellow - Sarı */
    /* ^4 | ^x04 --> Green - YeÅŸil */
    /* ^3 | ^x03 --> Team Color - Takım Rengi */
    
    /* Team Color ==> T Takımında Kırmızı - CT Takımında Mavi - SPECTATOR Takımında Beyaz */
    
    replace_all(Message, 190, "^1", "^x01");
    replace_all(Message, 190, "^4", "^x04");
    replace_all(Message, 190, "^3", "^x03");
    
    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(Message);
                message_end();
            }
        }
    }
}

reCs:Go Rank Menu (%50)
#3
Denicem birazdan teşekkürler

tekrardan teşekkür ederim.Konu çözülmüştür.
Son Düzenleme: 02-11-2020, 11:32, Düzenleyen: Efe*.
#4
Bunlar Basit Bi İşlem Yavastan Kendinizide Ogrenmeye Baslaya Bilirisiniz

@By.KinG
~ Ücretli Eklenti İçin 'DM' ~ Discord ~
#5
Konunuz "Çözülmüş İsteklere" taşınmıştır.
213.238.173.43

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

Yorum yapmak için üye olmanız gerekiyor

ya da

Benzer Konular

Kayıt Ol
Discord Adresimize Katılın