Fast typing event

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 152 times

02 Jan 2013, 19:57

Descriere: din x in x secunde (CVAR), pluginul creaza un set de caractere aleatoare ce vor fi afisate ca si mesaj hud. Jucatorul care scrie primul aceste caractere este recompensat prin bani (CVAR). Din versiunea 2.2, a fost implementat un sistem de restrictie. Practic, acest plugin creaza un fisier in folder-ul /configs/. Folosirea comenzii de restrictie va adauga numele jucatorului in fisier. Pe de alta parte, daca se scoate restrictia unui player, plugin-ul va adauga ; inaintea numelui jucatorului. un vault (3.0) in care se salveaza starea restrictiei.

Descarcare: .sma
.amxx
.txt (fisier ML)

Autor: compaq
Versiune: 3.2


Instalare:
1. Fisierul fastevent.sma il puneti in addons/amxmodx/scripting
2. Fisierul fastevent.amxx il puneti in addons/amxmodx/plugins
3. Fisierul fastevent.txt il puneti in addons/amxmodx/data/lang
3. Intrati in addons/amxmodx/configs/plugins.ini si adaugati:

Code: Select all

fastevent.amxx
CVAR-uri:
fastev_responsetime (default: 20.0)
fastev_moneyprize (default: 5000)
fastev_repeattime (default: 120.0)
fastev_randomamount (default: 1)
fastev_randommin (default: 500)
fastev_randommax (default: 5000)
fastev_hudtime (default: 25.0)

Nota: daca fastev_randomamount este setat pe 1, pluginul va ignora fastev_moneyprize.

Module:
cstrike
nvault
RoyalServer
User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

04 Jan 2013, 10:34

Il stiu, foarte util pluginul ! Felicitari compaq !
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

05 Jan 2013, 14:48

Felicitari , este grozav plugin'ul =D> + multumesc.

Are un bug , tine doar 4-5 secunde si dispare , eu am setat

fastev_responsetime 35.0
fastev_moneyprize 12000
fastev_repeattime 320.0
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
User avatar
CryWolf
Administrator
Administrator
Posts: 6505
Joined: 07 Aug 2008, 16:33
Detinator Steam: Da
Reputatie: Administrator
Fost Scripter
Manager CS2.eXtream.Ro
Fost Detinator ZM.eXtream.Ro
Fost manager CS.eXtream.Ro
Fost manager CSGO.eXtream.Ro
Fost manager global
Location: Botosani
Discord: crywolf1989
Has thanked: 202 times
Been thanked: 850 times
Contact:

27 Jan 2013, 13:51

Fantasy1 wrote:Felicitari , este grozav plugin'ul =D> + multumesc.

Are un bug , tine doar 4-5 secunde si dispare , eu am setat

fastev_responsetime 35.0
fastev_moneyprize 12000
fastev_repeattime 320.0
Ce dispare mesajul hud sau timpul de raspuns ? daca e de la mesajul hud incearca versiunea cu MsgSync
fastevent.sma | Afiseaza codul
[code=php]
/*
    Changelog:
        2.2     - added the restriction system for players
        2.1    - temporary solution for % and ;
        2.0     - new random system
            - code optimization
        
        1.0     - first release
*/

#include < amxmodx >
#include < amxmisc >
#include < cstrike >

#define PLUGIN_NAME "Fast typing event"
#define PLUGIN_AUTHOR "floatman"
#define PLUGIN_VERSION "2.2"

#define FLAGS 9

// Timpul cat sa tina mesajul
#define HOLD_TIME    10.0 // 10 secunde

new g_Codename[ 20 ];
new g_On = 0;
new g_Time, g_Prize, g_RepTime;

new const g_Filename[] = "fastev_restrictedusers.ini";
new g_File[ 256 ];
new MsgSync;

public plugin_init()
{
    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );

    register_clcmd( "say", "cmdentered" );
    register_clcmd( "say_team", "cmdentered" );

    register_concmd( "amx_fevrestrict", "cmdRestrict", ADMIN_BAN, " < name > - restricts a player from taking part of the event." );
    register_concmd( "amx_fevunrestrict", "cmdUnRestrict", ADMIN_BAN, " < name > - deleting the restriction of a player." );

    register_dictionary( "fastevent.txt" );

    register_cvar( "fevent_version", PLUGIN_VERSION, FCVAR_SERVER | FCVAR_SPONLY );
    set_cvar_string( "fevent_version", PLUGIN_VERSION );

    g_Time = register_cvar( "fastev_responsetime", "12.0" );
    g_Prize = register_cvar( "fastev_moneyprize", "5000" );
    g_RepTime = register_cvar( "fastev_repeattime", "120.0" );
    
    MsgSync = CreateHudSyncObj ( );
}

public plugin_cfg()
{
    set_task( get_pcvar_float( g_RepTime ), "create", _, _, _, "b" );
    
    get_configsdir( g_File, charsmax( g_File ) );
    formatex( g_File, charsmax( g_File ), "%s/%s", g_File, g_Filename );
    
    if( !file_exists( g_File ) )
        write_file( g_File, ";[FEVENT] Restricted users" );
}

public cmdRestrict( i_Index, iLevel, iCid )
{
    if( !cmd_access( i_Index, iLevel, iCid, 2 ) )
        return PLUGIN_HANDLED;

    new szArg[ 32 ];
    read_argv( 1, szArg, charsmax( szArg ) )

    new iPlayer = cmd_target( i_Index, szArg, FLAGS );

    if( !iPlayer )
        return PLUGIN_HANDLED;

    new szName[ 32 ];
    get_user_name( iPlayer, szName, charsmax( szName ) );

    new szReadData[ 256 ], szParsedName[ 32 ], iLine = 0, iLen, iDone = 0;
    new bool:bIsOk = false;

    while( read_file( g_File, iLine++, szReadData, charsmax( szReadData ), iLen ) )
    {
        parse( szReadData, szParsedName, charsmax( szParsedName ) )

        if( szParsedName[ 0 ] == ';' )
        {
            for( new i = 0; i < sizeof szName; i++ )
            {
                for( new j = 1; j < sizeof szParsedName; j++ )
                {
                    if( equali( szName[ i ], szParsedName[ j ] ) )
                    {
                        client_print( i_Index, print_chat, "[FEVENT] %L", LANG_PLAYER, "RESTRICTION_ADDED", szName );

                        bIsOk = true;
                        iDone = 1;
                        break;
                    }

                    break;
                }
            
            }
        }

        if( bIsOk == true )
        {
            formatex( szParsedName, charsmax( szParsedName ), "%s", szName );
            write_file( g_File, szParsedName, iLine - 1 );
            break;
            
        }

        if( equali( szName, szParsedName ) )
        {
            client_print( i_Index, print_chat, "[FEVENT] %L", LANG_PLAYER, "HAS_RESTRICTION", szName );
            iDone = 1;

            break;
        }
    }

    if( iDone != 1 )
    {
        write_file( g_File, szName );
        client_print( i_Index, print_chat, "[FEVENT] %L", LANG_PLAYER, "RESTRICTION_ADDED", szName );
    }

    return PLUGIN_HANDLED;
}

public cmdUnRestrict( i_Index, iLevel, iCid )
{
    if( !cmd_access( i_Index, iLevel, iCid, 2 ) )
        return PLUGIN_HANDLED;

    new szArg[ 32 ];
    read_argv( 1, szArg, charsmax( szArg ) )

    new iPlayer = cmd_target( i_Index, szArg, FLAGS );

    if( !iPlayer )
        return PLUGIN_HANDLED;

    new szName[ 32 ];
    get_user_name( iPlayer, szName, charsmax( szName ) );

    new szReadData[ 256 ], szParsedName[ 32 ], iLine = 0, iLen;

    while( read_file( g_File, iLine++, szReadData, charsmax( szReadData ), iLen ) )
    {
        parse( szReadData, szParsedName, charsmax( szParsedName ) )

        if( szParsedName[ 0 ] == ';' )
        {
            for( new i = 0; i < sizeof szName; i++ )
            {
                for( new j = 1; j < sizeof szParsedName; j++ )
                {
                    if( equali( szName, szParsedName ) )
                    {
                        formatex( szParsedName, charsmax( szParsedName ), ";%s", szName );
                        write_file( g_File, szParsedName, iLine - 1 );

                        client_print( i_Index, print_chat, "[FEVENT] %L", LANG_PLAYER, "RESTRICTION_DELETED", szName );

                        return PLUGIN_HANDLED;
                    }
                }
            }
        }

        if( equali( szName, szParsedName ) )
        {
            break;
        }
    }

    formatex( szParsedName, charsmax( szParsedName ), ";%s", szName );
    write_file( g_File, szParsedName, iLine - 1 );

    client_print( i_Index, print_chat, "[FEVENT] %L", LANG_PLAYER, "RESTRICTION_DELETED", szName );

    return PLUGIN_HANDLED;
}    

public create()
{
    g_On = 1;

    for( new j = 0; j < sizeof g_Codename - 1; j++ )
    {
        g_Codename[ j ] = random_num( '!', '~' );

        if( g_Codename[ j ] == '%' || g_Codename[ j ] == ';' )
            g_Codename[ j ] = ',';
        
    }
    
    new szMessage[ 192 ];

    formatex( szMessage, charsmax( szMessage ), "[EVENT] %L ", LANG_PLAYER, "NEW_CODE", g_Codename );

    set_hudmessage( 255, 0, 0, 0.07, 0.21, 0, 6.0, HOLD_TIME );
    ShowSyncHudMsg ( 0, MsgSync, szMessage );

    new Float:cleartime = get_pcvar_float( g_Time );
    set_task( cleartime, "clear_vars" );
}

public clear_vars()
{
    g_Codename[ 0 ] = EOS;
    g_On = 0;
}

public cmdentered( i_Index )
{
    if( g_On == 1 )
    {
        new szSaid[ 192 ];
        read_args( szSaid, charsmax( szSaid ) );
        remove_quotes( szSaid );
        trim( szSaid );

        if( equal( szSaid, g_Codename ) )
        {
            new szName[ 32 ];
            get_user_name( i_Index, szName, charsmax( szName ) );

            new szReadData[ 256 ], szParsedName[ 32 ], iLine = 0, iLen;

            while( read_file( g_File, iLine++, szReadData, charsmax( szReadData ), iLen ) )
            {
                parse( szReadData, szParsedName, charsmax( szParsedName ) )

                if( equal( szName, szParsedName ) )
                {
                    client_print( i_Index, print_chat, "[FEVENT] %L", LANG_PLAYER, "CODE_NOTACCESS" );
                    return PLUGIN_HANDLED;
                }
            }

            client_print( 0, print_chat, "[EVENT] %L", LANG_PLAYER, "ANNOUNCE_WINNER", szName, get_pcvar_num( g_Prize ) );

            cs_set_user_money( i_Index, (cs_get_user_money(i_Index) + get_pcvar_num(g_Prize)) );

            g_On = 0;
        }

        if( equali( szSaid, "" ) )
            return PLUGIN_HANDLED;
    }

    return PLUGIN_CONTINUE;
} [/code]
Good Job compaq pentru plugin.
NU IMI MAI DA-TI PM CU CERERE AJUTOR/SAMD, FOLOSITI FORUMUL, CITESC MAJORITATEA TOPICURILOR.
www.dark-arena.com , SERVERE CS / CS2 / L4D AU REVENIT ONLINE.
www.diasporaiptv.ro - SERVICII PREMIUM IPTV

Image

Image
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 152 times

27 Jan 2013, 14:25

Am facut un update si am fixat bug-ul. Totodata, am adaugat un CVAR pentru bani random.
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 152 times

10 Feb 2013, 17:03

Updatat la versiunea 3.0:
  • Imbunatatiri majore in cod;
  • modulul nvault e necesar;
  • sistemul de restrictie foloseste steamid-uri.
User avatar
Arion
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3317
Joined: 15 May 2008, 21:19
Detinator Steam: Da
SteamID: arion1338
Reputatie: Fost Mapper eXtreamCS
Fost Detinator HNS.eXtreamCS.com
Nume anterior : Seekers
Scripter Echipa eXtreamCS
Fost Moderator jutator
Discord: laurentiuandrei
Has thanked: 402 times
Been thanked: 413 times
Contact:

13 Feb 2013, 16:16

Interesanta idee :D
Felicitari.
User avatar
sDs|Aragon*
Membru, skill +2
Membru, skill +2
Posts: 576
Joined: 29 Dec 2011, 21:38
Detinator Steam: Da
SteamID: Mihai_Parkour10
Reputatie: Fost scripter eXtreamCS
Has thanked: 4 times
Been thanked: 132 times

16 Feb 2013, 16:29

Bravo, o idee buna si noua.
Felicitari!
User avatar
h4wk
Fost moderator
Fost moderator
Posts: 3806
Joined: 22 Sep 2009, 13:10
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Nume anterior : DaZ , zimpe , Dan eXtream
Location: Iasi
Has thanked: 306 times
Been thanked: 321 times
Contact:

16 Feb 2013, 16:33

Din descriere pare un plugin interesant...Felicitari + buna ideea.

Code: Select all

"Daca ai culoare nu inseamna ca esti mai presus ca un utilizator. Culoare e un fel de "rasplata" pentru ca te implici in "ridicarea" acestei comunitati.
Unii nu realizeaza ca daca ai culoare nu inseamna ca esti smecher." -- by Alexey
:troll :troll

Spui ceva,dar faci altceva !
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

21 Feb 2013, 18:09

Am eu cateva idei/cereri:
Una dintre ele e ca mesajele sa fie afisate in chat cu o culoare diferita rosu etc si sau hud pe un font care sa se vada mai bine
A doua este cea ca combinatiile sa fie doar de litere si cifre fara semne de punctuatie etc
A treia este ca combinatiile sa fie facute de noi intr-un fisier de timp txt cfg sau orice al tip

:-? Ce ziceti /:)
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 152 times

21 Feb 2013, 19:10

Mr.SpRyTe wrote:Una dintre ele e ca mesajele sa fie afisate in chat cu o culoare diferita rosu etc si sau hud pe un font care sa se vada mai bine
Voi folosi dhudmessage in urmatoarea versiune.
Mr.SpRyTe wrote:A doua este cea ca combinatiile sa fie doar de litere si cifre fara semne de punctuatie etc
Nu.
Mr.SpRyTe wrote:A treia este ca combinatiile sa fie facute de noi intr-un fisier de timp txt cfg sau orice al tip
Nu sunt de acord. Scopul plugin-ului e sa genereze caractere aleatoare si nu sa le citeasca dintr-un fisier.
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

21 Feb 2013, 19:13

Deci astept urmatoarea versiune.Succes!
Post Reply

Return to “Pluginuri eXtream”

  • Information