[Plugin] VIP + Expired System
Results 1 to 12 of 12
  1. #1
    Senior Member Array
    Join Date
    Jun 2015
    Location
    Home
    Karma
    0

    Default VIP + Expired System

    VIP + Expired System
    Version 0.1
    by Croxeye

    Instalacija:
    • c_vip.amxx ubacite u addons/amxmodx/plugins folden.
    • U plugins.ini napravite novu liniju: 'c_vip.amxx' (without quotes).
    • c_vip.ini ubacite addons/amxmodx/configs/ folder.


    VIP Flags
    Code:
     [a = +$3000 /round | b = VIP u Scores Table | c = +15 HP, AP /Kill & +30 HP, AP /Headshot]
    Vipa registrujete u c_vips.ini fajlu na sljedeci nacin:
    Code:
    "nick" "password" "flags" "expired"
    VIP LOGIN:
    Code:
    setinfo _vip "password"
    Expired System
    U c_vips.ini/"expired" kucate broj dana koliko ce taj igrac imati vipa ili ako necete da tom igracu istekne vip, kucajte "Permanent".

    Primjeri:
    (VIP istici za 30 dana)
    Code:
    "Croxeye" "Crxy123" "abc" "30"
    (VIP traje zauvjek)
    Code:
    "Croxeye" "Crxy123" "abc" "Permanent"
    * SMA *
    PHP Code:
    #pragma ctrlchar '\'

    #include <amxmodx>
    #include <amxmisc>
    #include <fun>
    #include <cstrike>
    #include <hamsandwich>

    #define PLUGIN "VIP System"
    #define VERSION "v0.1"
    #define AUTHOR "Croxeye"

    new Array:g_Names;
    new Array:
    g_Passwords;
    new Array:
    g_Flags;
    new Array:
    g_Days;

    new 
    g_Name[33][32];
    new 
    g_Password[33][32];
    new 
    g_sFlags[33][32];

    new 
    g_timeNow[8];

    stock __DHud_Color;
    stock __DHud_X;
    stock __DHud_Y;
    stock __DHud_Effect;
    stock __DHud_FXTime;
    stock __DHud_HoldTime;
    stock __DHud_FadeInTime;
    stock __DHud_FadeOutTime;

    prepareDHudMessage(Red 0Green 0Blue 0Float:0.0Float:0.0Effect 2, \
        
    Float:FXTime 0.0Float:HoldTime 0.0Float:FadeInTime 0.0Float:FadeOutTime 0.0)
    {
        
    __DHud_Color Blue + (Green << 8) + (Red << 16);
        
    __DHud_X _:X;
        
    __DHud_Y _:Y;
        
    __DHud_Effect Effect;
        
    __DHud_FXTime _:FXTime;
        
    __DHud_HoldTime _:HoldTime;
        
    __DHud_FadeInTime _:FadeInTime;
        
    __DHud_FadeOutTime _:FadeOutTime;

        return 
    1;
    }

    sendDHudMessage(TargetFormat[], any:... /** 3 */)
    {
        static 
    Buffer[256] = { 0, ... }, Length 0;

        
    Length vformat(Buffercharsmax(Buffer), Format/** 3 */);

        
    message_begin(Target && is_user_connected(Target) ? MSG_ONE_UNRELIABLE MSG_BROADCAST, \
            
    SVC_DIRECTOR_Target);
        
    write_byte(Length 31);
        
    write_byte(DRC_CMD_MESSAGE);
        
    write_byte(__DHud_Effect);
        
    write_long(__DHud_Color);
        
    write_long(__DHud_X);
        
    write_long(__DHud_Y);
        
    write_long(__DHud_FadeInTime);
        
    write_long(__DHud_FadeOutTime);
        
    write_long(__DHud_HoldTime);
        
    write_long(__DHud_FXTime);
        
    write_string(Buffer);
        
    message_end();

        return 
    Length;
    }


    public 
    plugin_init() {
        
    register_plugin(PLUGINVERSIONAUTHOR)
        
        
    RegisterHam(Ham_Spawn"player""onSpawn"1);

        
    register_event("ResetHUD""onResetHUD""b");
        
    register_event("ResetHUD""onResetHUD""be");
        
    register_event("DeathMsg""onDeathMsg""a");

        
    get_time("%H"g_timeNowcharsmax(g_timeNow));

        
    g_Names ArrayCreate(32);
        
    g_Passwords ArrayCreate(32);
        
    g_Flags ArrayCreate(32);
        
    g_Days ArrayCreate(32);
    }

    public 
    onSpawn(Player)
    {
        if (
    is_user_alive(Player))
        {
            if (
    containi(g_sFlags[Player], "a") != -1)
                
    cs_set_user_money(Playerclamp(cs_get_user_money(Player) + 3000016000));

            if (
    containi(g_sFlags[Player], "b") != -1)
                
    set_task(0.1"onResetHUD"Player__"a"5);
        }
    }

    public 
    onDeathMsg()
    {
        new 
    Killer read_data(1);
        new 
    Victim read_data(2);
        new 
    Headshot read_data(3);

        if (
    Killer >= && Killer != Victim && containi(g_sFlags[Killer], "c") != -1)
        {
            
    message_begin(MSG_ONE_UNRELIABLEget_user_msgid("ScreenFade"), _Killer);
            
    write_short(512); // 4096 - 1 second, 2048 - 0.5 seconds, 1024 - 0.25 seconds, 512 - 0.125 seconds
            
    write_short(512); // 4096 - 1 second, 2048 - 0.5 seconds, 1024 - 0.25 seconds, 512 - 0.125 seconds
            
    write_short(0x0001); // FADE IN
            
    write_byte(150); // red [ 0-255 ]
            
    write_byte(10); // green [ 0-255 ]
            
    write_byte(225); // blue [ 0-255 ]
            
    write_byte(160); // alpha - opacity [ 0-255 ]
            
    message_end();

            
    set_user_health(Killerclamp(get_user_health(Killer) + (Headshot 30 15), 0200));
            
    cs_set_user_armor(Killerclamp(get_user_armor(Killer) + (Headshot 30 15), 0200), CS_ARMOR_VESTHELM);
        }
    }

    public 
    onResetHUD(Id)
    {
        if (
    is_user_alive(Id))
        {
            
    message_begin(MSG_BROADCASTget_user_msgid("ScoreAttrib"));
            
    write_byte(Id);
            
    write_byte(4);
            
    message_end();
        }
    }

    public 
    plugin_cfg()
    {
        
    readVIPs();
        
    rewriteVIPs();
    }

    public 
    plugin_natives()
    {
        
    registerLibrary();
        
    registerFunctions();
    }

    public 
    client_connect(Client)
    {
        
    get_user_name(Clientg_Name[Client], charsmax(g_Name));

        
    formatex(g_sFlags[Client], charsmax(g_sFlags[]), "");
        
    formatex(g_Password[Client], charsmax(g_Password[]), "");
    }

    public 
    client_disconnect(Client)
    {
        
    formatex(g_Name[Client], charsmax(g_Name[]), "");
        
    formatex(g_sFlags[Client], charsmax(g_sFlags[]), "");
        
    formatex(g_Password[Client], charsmax(g_Password[]), "");
    }

    public 
    client_putinserver(Client)
    {
        new 
    aName[32], aPassword[32], aFlags[32];

        
    get_user_name(Clientg_Name[Client], charsmax(g_Name[]));
        
    get_user_info(Client"_vip"g_Password[Client], charsmax(g_Password[]));

        for (new 
    Iter 0Iter ArraySize(g_Names); Iter++)
        {
            
    ArrayGetString(g_NamesIteraName31);
            
    ArrayGetString(g_PasswordsIteraPassword31);
            
    ArrayGetString(g_FlagsIteraFlags31);

            if (
    equali(g_Name[Client], aName))
            {
                if (
    equali(aPasswordg_Password[Client]))
                {
                    
    formatex(g_sFlags[Client], 31"%s"aFlags);
                    
    set_task(5.0"welcomeMsg"Client);
                    break;
                }

                else
                {
                    
    server_cmd("kick #%d  Incorrect VIP password!"get_user_userid(Client));
                    break;
                }
            }
        }
    }

    public 
    welcomeMsg(Id)
    {
        if (
    is_user_connected(Id))
        {
            
    prepareDHudMessage(150102250.030.675526.03.0);
            
    sendDHudMessage(Id"You are now VIP!");
        }
    }

    public 
    __get_user_c_vip(PluginParams)
    {
        if (
    Params == 1)
        {
            new 
    Player get_param(1);

            if (
    Player && Player <= get_maxplayers())
                return 
    strlen(g_sFlags[Player]) > 0;
        }

        return 
    0;
    }

    /**
    * Update VIPs, subtract 1 day if needed...
    */
    rewriteVIPs()
    {
        new 
    fileName[256];
        
    get_configsdir(fileNamecharsmax(fileName));
        
    add(fileNamecharsmax(fileName), "/c_vips.ini");

        new 
    File fopen(fileName"w+");
        if (
    File)
        {
            new 
    IterCell;
            
    fprintf(File"; [a = +$3000 /round | b = VIP in Scores Table | c = +15 HP, AP /Kill & +30 HP, AP /Headshot]\r\n");
            
    fprintf(File"; Usage :  \"name\" \"password\" \"flags\" \"days\"\r\n");
            
    fprintf(File"; Usage :  \"name\" \"password\" \"flags\" \"Permanent\" ; never expires\r\n\r\n");

            for (
    Iter 0Iter ArraySize(g_Names); Iter++)
            {
                
    Cell ArrayGetCell(g_DaysIter);

                if (
    equali(g_timeNow"06") && ((Cell 1) <= 0))
                    continue;

                if (
    Cell 2048)
                    
    fprintf(File"\"%a\" \"%a\" \"%a\" \"Permanent\"\r\n"ArrayGetStringHandle(g_NamesIter),
                        
    ArrayGetStringHandle(g_PasswordsIter),
                        
    ArrayGetStringHandle(g_FlagsIter));

                else
                    
    fprintf(File"\"%a\" \"%a\" \"%a\" \"%d\"\r\n"ArrayGetStringHandle(g_NamesIter),
                        
    ArrayGetStringHandle(g_PasswordsIter),
                        
    ArrayGetStringHandle(g_FlagsIter),
                        
    equali(g_timeNow"06") ? Cell Cell);
            }

            
    fclose(File);
        }
    }

    readVIPs()
    {
        new 
    fileName[256];
        
    get_configsdir(fileNamecharsmax(fileName));
        
    add(fileNamecharsmax(fileName), "/c_vips.ini");

        new 
    File fopen(fileName"r");
        if (
    File)
        {
            new 
    String[512], \
                
    Name[32], Password[32], Flags[32], remainingDays[64];

            while (!
    feof(File))
            {
                
    fgets(FileStringcharsmax(String));
                
    trim(String);

                if (
    String[0] == '"' && \
                    
    parse(StringNamecharsmax(Name), Passwordcharsmax(Password), \
                    
    Flagscharsmax(Flags), remainingDayscharsmax(remainingDays)) >= 4)
                {
                    
    ArrayPushString(g_NamesName);
                    
    ArrayPushString(g_PasswordsPassword);
                    
    ArrayPushString(g_FlagsFlags);

                    if (
    remainingDays[0] == '\0' || remainingDays[0] == 'p' || remainingDays[0] == 'P')
                        
    ArrayPushCell(g_Days4096);

                    else
                        
    ArrayPushCell(g_Daysstr_to_num(remainingDays));
                }
            }

            
    fclose(File);
        }
    }

    /**
    * Register Plug-in Library
    */
    registerLibrary()
    {
        
    register_library("c_vip");
    }

    /**
    * Register Plug-in Functions
    */
    registerFunctions()
    {
        
    register_native("get_user_c_vip""__get_user_c_vip");

    * DOWNLOAD *
    Tu mozete skinuti AMXX i c_vips.ini
    https://forums.alliedmods.net/showthread.php?t=267747

    U novoj verziji plugina cu ubaciti da se vip moze dodavati preko Steam ID-a (Jer su na tome insistirali na Allied-u) kao i novu komandu pomocu koje mozete provjeriti za koliko dana vam istice vip.
    Last edited by Croxeye; 31-01-2016 at 15:26.

  2. #2
    Moderator Array Megastorm's Avatar
    Join Date
    Sep 2011
    Location
    Tokyo, Japan
    Age
    23
    Karma
    34

    Default

    Otvoreno mogu reci da ne verujem da si ti ovo pravio...
    previse mi je poznat plugin od nekud...

  3. #3
    Senior Member Array
    Join Date
    Jun 2015
    Location
    Home
    Karma
    0

    Default

    Ja sam taj plugin napravio i objavio na allied... https://forums.alliedmods.net/showthread.php?t=267747 Nezz u cemu je problem.

  4. #4
    Banovani spamer Array
    Join Date
    Apr 2011
    Location
    При́п'ять
    Age
    21
    Karma
    0

    Default

    Quote Originally Posted by Croxeye View Post
    Ja sam taj plugin napravio i objavio na allied... https://forums.alliedmods.net/showthread.php?t=267747 Nezz u cemu je problem.
    Dokazi, u temi na allied-u dodaj pri dnu prvog posta: Pozdrav za Kgb ekipu

  5. #5
    Super Moderator Array klipica's Avatar
    Join Date
    Apr 2010
    Karma
    29

    Default

    Quote Originally Posted by milutinke2 View Post
    Dokazi, u temi na allied-u dodaj pri dnu prvog posta: Pozdrav za Kgb ekipu
    Znam ja da je on Croxeye sa AM, ne mora nista dokazivati.
    Code:
    #YoMama {
        width: 200%;
        overflow: visible;
    }

  6. #6
    Senior Member Array
    Join Date
    Jun 2015
    Location
    Home
    Karma
    0

    Default

    Quote Originally Posted by milutinke2 View Post
    Dokazi, u temi na allied-u dodaj pri dnu prvog posta: Pozdrav za Kgb ekipu
    https://forums.alliedmods.net/showth...10#post2388710

    Zadovoljan ?

  7. #7
    Banovani spamer Array
    Join Date
    Jan 2016
    Location
    Niš
    Age
    30
    Karma
    0

    Default

    cestitam !

  8. #8
    Senior Member Array
    Join Date
    Mar 2014
    Location
    Бања Лука
    Karma
    8

    Default

    Ovo sam već vidio negdje, ja mislim da je pravio Exolent koliko se sjećam. Bravo za trud ali već viđeno

  9. #9

  10. #10
    Banovani spamer Array
    Join Date
    Apr 2011
    Location
    При́п'ять
    Age
    21
    Karma
    0

    Default

    Quote Originally Posted by Croxeye View Post
    Nisam, sada mi poslaji 100 €
    Salim se hahaha
    GJ

  11. #11
    Moderator Array Megastorm's Avatar
    Join Date
    Sep 2011
    Location
    Tokyo, Japan
    Age
    23
    Karma
    34

    Default

    Iskreno ja i dalje ne verujem da si ti autor, pre bih rekao da si editovao neciji kod, ali nebitno, ako drugi smatraju da jesi autor, ok.
    Od mene imas approve na osnovu solidno napisanog koda i to je to.

  12. #12
    Senior Member Array
    Join Date
    Jun 2013
    Location
    K und K monarhija
    Karma
    20

    Default

    Nije los plugin, ali i ja mislim da si ga 'sklopio' iz vise plugina(tutova,topica kako god).. Svakako srecno u daljem radu, ako si stvarno sam pisao sve i nisi bas pocetnik
    double penetration sadomazo satisfaction
    kao svedski akcioni kada kazu action

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
  •