Cerere shop

Aici veti gasi toate topicurile neacceptate pe acest forum ! (inclusiv cele care incalca regulile)

Moderators: Moderatori ajutatori, Moderatori

Locked
floringold01
Membru, skill +1
Membru, skill +1
Posts: 205
Joined: 02 Jan 2017, 03:01
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: DA
SteamID: NU
Fond eXtream: 0
Contact:

31 Jul 2022, 00:16

Buna scuzati... am nevoie si eu de un plugin un shop care la un anumite puncte stranse sa sa poti cumpara vip pe 30zile pe 60zile pe 90zile .Ma poate ajuta cineva ?


Multumesc anticipat
Image
User avatar
Robertsasab
Membru, skill 0
Membru, skill 0
Posts: 32
Joined: 16 May 2022, 11:18
Detinator Steam: Da
CS Status: BlackGames.Ro
Detinator server CS: BBX.NEXTCS.RO
Fond eXtream: 0
Location: Romania
Discord: Robertsasa#3020
Has thanked: 1 time
Been thanked: 1 time
Contact:

31 Jul 2022, 11:02

Daca ziceai si ce mod de joc folosesti....
BlackGames.Ro
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2493
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 20 times
Been thanked: 53 times
Contact:

31 Jul 2022, 13:31

Robertsasab wrote:
31 Jul 2022, 11:02
Daca ziceai si ce mod de joc folosesti....
Respawn
no...
User avatar
Robertsasab
Membru, skill 0
Membru, skill 0
Posts: 32
Joined: 16 May 2022, 11:18
Detinator Steam: Da
CS Status: BlackGames.Ro
Detinator server CS: BBX.NEXTCS.RO
Fond eXtream: 0
Location: Romania
Discord: Robertsasa#3020
Has thanked: 1 time
Been thanked: 1 time
Contact:

31 Jul 2022, 16:47

Incearca asta nu zic ca merge, daca nu merge lasi un reply

Code: Select all

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

#pragma tabsize 0

native get_user_points( id )
native set_user_points( id, points )

new bool: Speed[17];
bool: ParolaSetata [33]
BuySlot [33]
Secunde [33] = 0 , Timp, Slot
Cumparat [33]
new const szTg[] = "Shop";

public plugin_init( ) {

    register_plugin( "1", "shop", "Mihai" );

    RegisterHam( Ham_Spawn, "player", "Sp", true );
    register_event("CurWeapon" , "CWeapon" , "be" , "1=1" );

    register_clcmd( "say shop", "TS", -1 );
    register_clcmd( "say /shop", "TS", -1 );
    register_clcmd( "say_team shop", "TS", -1 );
    register_clcmd( "say_team /shop", "TS", -1 );
}
public client_putinserver( id ) {
Speed[id] = false;
Secunde [id] = 0;
ParolaSetata [id] = false;
}

public TS( id ) {

    if( is_user_connected( id ) && is_user_alive( id ) ) {
        switch( get_user_team( id ) )
            {
                case 1,2: SM( id );    
            }
    }
    else
    client_printcolor( id, "^4[%s]^1Trebuie sa fi in viata pentru a deschide ^3Shopul ^1!", szTg );
}

public SM( id ) {

    new szMenu[ 10 char ];
    format( szMenu, charsmax( szMenu ), "\r[%s] \wMenu",szTg);
    new menu = menu_create ( szMenu , "Menu" );

    menu_additem( menu, "\wVIP 30 Zile \r[5 Puncte]", "1", 0);
    menu_additem( menu, "\wVIP 60 Zile \r[5 Puncte]", "2", 0);
    menu_additem( menu, "\wVip 90 Zile \y400 \r[2 Puncte]", "3", 0);

    menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
    menu_display ( id, menu, 0 );
    return 1;
}


public Menu( id, menu, item ) {

    if( item == MENU_EXIT )
        {
            return 1;
        }
    
    new data [ 6 ], szName [ 64 ];
    new access, callback;
    menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
    new key = str_to_num ( data );    
    switch(key)
    {
        case 1:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
        }
        }
        }
        case 2:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
        }
        }
        }
        case 3:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
            
            
        }
    }
    return 1;
}


public CWeapon( id ) {

    if( Speed[ id ] ) {
        if( get_user_weapon(id)) {
            set_user_maxspeed(id, 450.0);
        }
    }
}

public Sp( id ) {
Speed[id] = false;
set_user_gravity(id, 1.0);
}

stock client_printcolor(const id, const input[], any:...)
{
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
    
    replace_all(msg, 190, "!g", "^x04"); // Green Color
    replace_all(msg, 190, "!n", "^x01"); // Default Color
    replace_all(msg, 190, "!t", "^x03"); // Team Color
    
    if(id)
        players[0] = id;
    else
        get_players(players, count, "ch");
    
    for (new i = 0; i < count; i++)
    {
        message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
        write_byte(players[i]);
        write_string(msg);
        message_end();
    }
}
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < CC_ColorChat >
#include < csx >
#include < cstrike >

#pragma semicolon 1

#define ADMIN_ACCESS ADMIN_IMMUNITY
#define is_user_player(%1) ( 1 <= %1 <= g_MaxPlayers )

#define PLUGIN_NAME     "Engine Sistem Puncte"
#define PLUGIN_VERSION     "1.1"
#define PLUGIN_AUTHOR     "Bobbu!"

new const g_szTag[ ] = "[SHOP]";

// Make files?
new const szWriteCvarsPoints[  ] = "addons/amxmodx/configs/points/points.cfg";
new const szLocationPoints[  ] = "addons/amxmodx/configs/points";

const PEV_SPEC_TARGET = pev_iuser2;

new g_iUserPoints[ 33 ];
new File[ 128 ];

new points_gamename;
new SyncHudMessage, g_MaxPlayers;

enum _:iCvars {

    EnableBombEvents,
    ShowType,
    CostOnePoint,
    PointsPerHS,
    PointsBombPlanted,
    PointsBombExploded,
    PointsBombDefused,
    AddPointsNewRound,
    EnableRespawn,
    PointsForRespawn,
    PointsForRespawnChance
}
;
new g_iCvar[ iCvars ];

public plugin_init( ) {

    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
    
    register_event( "DeathMsg", "event_DeathMsg", "a" );

    register_forward( FM_GetGameDescription, "GameDesc" ); 
    register_forward( FM_PlayerPreThink, "fwd_PlayerPreThink" );

    RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawned_Post", 1 );
    RegisterHam( Ham_Killed, "player", "Ham_PlayerKilled", 1 );
    
    register_clcmd( "say /cp", "ClCmdSayBuyPoint" );
    register_clcmd( "say_team /cp", "ClCmdSayBuyPoint" );

    register_clcmd( "say /top", "ClCmdSayShowAllPoints" );
    register_clcmd( "say_team /top", "ClCmdSayShowAllPoints" );

    register_clcmd( "say /puncte", "ClCmdSayPoints" );
    register_clcmd( "say_team /puncte", "ClCmdSayPoints" );

    register_concmd( "amx_acorda_puncte" ,"ClCmdGivePoints", ADMIN_ACCESS, "< nume / @ALL / @T / @CT > < Puncte >" );
    register_concmd( "amx_retrage_puncte", "ClCmdTakePoints", ADMIN_ACCESS, "< nume > < Puncte >" );
    register_concmd( "amx_reset_puncte", "ClCmdResetPoints", ADMIN_ACCESS, "< nume / @ALL >" );
    
    g_iCvar[ ShowType ] = register_cvar( "points_show_info", "1" );
    g_iCvar[ EnableBombEvents ] = register_cvar( "points_bombevents_rewards", "1" );
    g_iCvar[ CostOnePoint ] = register_cvar( "points_costonepoint", "4000" );
    g_iCvar[ PointsPerHS ] = register_cvar( "points_per_headshot", "2" );
    g_iCvar[ PointsBombPlanted ] = register_cvar( "points_bomb_planted", "4" );
    g_iCvar[ PointsBombExploded ] = register_cvar( "points_bomb_exploded", "1" );
    g_iCvar[ PointsBombDefused ] = register_cvar( "points_bomb_defused", "5" );
    g_iCvar[ PointsForRespawn ] = register_cvar( "points_for_respawn", "10" );
    g_iCvar[ PointsForRespawnChance ] = register_cvar( "points_respawn_chance", "70" );
    g_iCvar[ EnableRespawn ] = register_cvar( "points_enable_respawn", "1" );
    points_gamename = register_cvar( "points_gamename", "RUN INDUNGI SISTEMS" );

    SyncHudMessage = CreateHudSyncObj(  );
    g_MaxPlayers = global_get( glb_maxClients );

    new DataDir[ 64 ];
    get_datadir( DataDir, 63 );
    format( File, 127, "%s/AdvancedPointsSystem.dat", DataDir );
}

public plugin_precache(  ) {

    server_cmd( "exec %s", szWriteCvarsPoints );
       
    if( !dir_exists( szLocationPoints ) )
        mkdir( szLocationPoints );

    if( !file_exists( szWriteCvarsPoints ) ) {

        write_file( szWriteCvarsPoints, "// In acest fisier se afla cvar-urile legate despre puncte:");
        write_file( szWriteCvarsPoints, " ");
        write_file( szWriteCvarsPoints, "points_show_info ^"1^" // 0: Afiseaza datele in HUD sub radar | 1: Afiseaza datele deasupra vietii" );
        write_file( szWriteCvarsPoints, "points_bombevents_rewards ^"1^" // 0: Dezactivat | 1: Activat -> Puncte obtinute pe plantarea/dezamorsarea/explodearea bombei" );
        write_file( szWriteCvarsPoints, "points_costonepoint ^"4000^" // Cat sa coste un punct atunci cand il cumperi prin comanda /buypoint" );
        write_file( szWriteCvarsPoints, "points_per_headshot ^"2^" // Cate puncte sa primesti pe HeadShot !" );
        write_file( szWriteCvarsPoints, "points_bomb_planted ^"1^" // Cate puncte sa primesti pe plantarea bombei" );
        write_file( szWriteCvarsPoints, "points_bomb_exploded ^"2^" // Cate puncte sa primesti pe explodarea bombei" );
        write_file( szWriteCvarsPoints, "points_bomb_defused ^"1^" // Cate puncte sa primesti pe dezamorsarea bombei" );
        write_file( szWriteCvarsPoints, "points_enable_respawn ^"1^" // Activeaza / Dezactiveaza respawn-ul cand victima moare doar daca are X PUNCTE" );
        write_file( szWriteCvarsPoints, "points_for_respawn ^"1000^" // Cate puncte sa aiba victima ca sa poata reinvia atunci cand este omorata" );
        write_file( szWriteCvarsPoints, "points_respawn_chance ^"40^" // Cate sanse sa aiba victima ca sa poata reinvia" );
        write_file( szWriteCvarsPoints, "points_gamename ^"Adv. Points System v1.1^" // Schimbi numele default( Counter-Strike ) cu altul" );
        //write_file( szWriteCvarsPoints, "cvar ^"1 / 0^" // De cate sanse are nevoie victima ca sa invie atunci cand are X PUNCTE" );
    }
}

public plugin_natives( ) {

    register_native( "get_user_points", "native_get_user_points", 1 );
    register_native( "set_user_points", "native_set_user_points", 1 );
}

public native_get_user_points( id ) {

    return g_iUserPoints[ id ];
}

public native_set_user_points( id, points ) {

    g_iUserPoints[ id ] = points;
}

public client_putinserver( id ) {

    LoadUserPoints( id );
}

public client_disconnect( id ) {

    SaveUserPoints( id );
    ParolaSetata [id] = false;
}

public GameDesc( ) {

    static szGameName[ 32 ];

    get_pcvar_string( points_gamename, szGameName, 31 );
    forward_return( FMV_STRING, szGameName );

    return FMRES_SUPERCEDE; 
}

public fwdPlayerPreThink( id ) {
    
    if( is_user_alive( id ) ) {
        
        new target, body; 
        get_user_aiming( id, target, body, 9999 );
        
        new CsTeams:team = cs_get_user_team( id );
        
        if( is_user_alive( target ) ) {

            if( is_user_player( target ) ) {
            
                new CsTeams:targetTeam = cs_get_user_team( target );
                
                new szName[ 32 ];
                get_user_name( target,  szName, sizeof( szName ) -1 );
                            
                new sMessage[ 64 ];
                if( targetTeam == team ) {

                    formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Puncte: %i", is_user_vip( target ) ? "VIP" : "Friend", szName, get_user_health( target ), g_iUserPoints[ target ] );
                }

                else if( targetTeam != team && team != CS_TEAM_CT ) {

                    formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Puncte: %i", is_user_vip( target ) ? "VIP" : "Enemy", szName, get_user_health( target ), g_iUserPoints[ target ] );
                }
                    
                if( targetTeam == CS_TEAM_CT ) {

                    set_hudmessage( 0, 255, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
                }

                else if( targetTeam == CS_TEAM_T ) {

                    set_hudmessage( 127, 0, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
                }    
                
                show_hudmessage( id, "%s",  sMessage );
            }
        }
    }
    
    return FMRES_IGNORED;
}

public event_DeathMsg( ) {

    new iKiller = read_data( 1 );
    new iVictim = read_data( 2 );
    new iHeadshot = read_data( 3 );
    
    if( !is_user_connected( iKiller ) || !is_user_connected( iVictim ) ) {

        return;
    }
    
    if( iKiller == iVictim ) {

        return;
    }
    
    if( iHeadshot ) {

        g_iUserPoints[ iKiller ] += get_pcvar_num( g_iCvar[ PointsPerHS ] );
        set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 1, 6.0, 7.0 );
        show_hudmessage( iKiller, "+%i points", get_pcvar_num( g_iCvar[ PointsPerHS ] ) );
    }

    else {

        g_iUserPoints[ iKiller ]++;
        set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 0, 6.0, 7.0 );
        show_hudmessage( iKiller, "+1 point" );
    }
}

public Ham_PlayerSpawned_Post( id ) {

    if( is_user_connected( id ) && is_user_alive( id ) ) {

        set_task( 1.0, "ShowHud", id, _, _, "b" );
    }
}

public Ham_PlayerKilled( iVictim, iAttacker, iShouldgib ) {

    if( get_pcvar_num( g_iCvar[ EnableRespawn ] ) == 0 || !is_user_connected( iVictim ) )
        return PLUGIN_CONTINUE;

    new iPoints = get_pcvar_num( g_iCvar[ PointsForRespawn ] );
    new iChance = random_num( 1, 100 );
    new iAccepted = get_pcvar_num( g_iCvar[ PointsForRespawnChance ] );

    if( g_iUserPoints[ iVictim ] == iPoints ) {

        if( iChance <= iAccepted ) {

            ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai fost inviat pentru ca ai avut^x03 %i^x01 sanse !", g_szTag, iChance );
        }

        if( iChance >= iAccepted ) {

            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Poate runda viitoare vei avea^x03 %i^x01 sanse pentru a putea reinvia !", g_szTag, iChance );
        }
    }

    return PLUGIN_CONTINUE;
}

public ShowHud( id ) {

    switch( get_pcvar_num( g_iCvar[ ShowType ] ) ) {

        case 0: {
    
            if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.23, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "HP: %d^nPoints: %d", get_user_health( id ), g_iUserPoints[ id ] );
            }

            else {

                new idSpec;
                new iPlayerName[ 32 ];

                idSpec = pev( id, PEV_SPEC_TARGET );
                get_user_name( idSpec, iPlayerName, 31 );

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.22, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPuncte: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
            }
        }

        case 1: {
    
            if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

                set_hudmessage( 0, 0, 254, 0.01, 0.91, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "HP: %d | AP: %d | Puncte: %d", get_user_health( id ), get_user_armor( id ), g_iUserPoints[ id ] );
            }

            else {

                new idSpec;
                new iPlayerName[ 32 ];

                idSpec = pev( id, PEV_SPEC_TARGET );
                get_user_name( idSpec, iPlayerName, 31 );

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), -1.0, 0.7, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPuncte: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
            }
        }
    }
}

public ClCmdSayBuyPoint( id ) {

    if( is_user_connected( id ) )
    {
        new g_iUserMoney = cs_get_user_money( id );
        new iNeededMoney = get_pcvar_num( g_iCvar[ CostOnePoint ] );
 
        if( g_iUserMoney < iNeededMoney )
 
        ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Mai ai nevoie de^x03 %d $^x01 pentru a cumpara^x03 1 punct^x01 !", g_szTag, iNeededMoney - g_iUserMoney );
 
        else {
 
            g_iUserPoints[ id ] += 1;
            cs_set_user_money( id, g_iUserMoney - iNeededMoney );
            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai cumparat^x03 1 punct^x01 pentru^x03 %d $ !", g_szTag, iNeededMoney );
        }
    }
}

public ClCmdSayShowAllPoints( id ) {

    new iPlayers[ 32 ], iPlayersNum, szName[ 40 ], szMotd[ 1024 ], len;

    len = formatex( szMotd, charsmax( szMotd ), "<html> ");
    get_players( iPlayers, iPlayersNum );

    for( new i = 0 ; i < iPlayersNum ; i++ ) {

        get_user_name( iPlayers[ i ], szName, charsmax( szName ) );
        len += formatex( szMotd[ len ], charsmax( szMotd ) - len, "<br> <center> <font color=#008000>Name:</font> <font color=#8A2BE2>%s</font> | <font color=#008000>Points:</font> <font color=#8A2BE2>%i</font> </center> <br>", szName, g_iUserPoints[ iPlayers[ i ] ] );
    }

    formatex( szMotd[ len ], charsmax( szMotd ) - len, </html>
BlackGames.Ro
User avatar
N3v3rM1nd
Membru, skill +2
Membru, skill +2
Posts: 735
Joined: 06 Oct 2018, 14:41
Detinator Steam: Da
SteamID: /id/kidd0x/
Fond eXtream: 0
Location: Constangeles
Discord: kidd0x#1886
Has thanked: 122 times
Been thanked: 67 times

31 Jul 2022, 18:36

Robertsasab wrote:
31 Jul 2022, 16:47
Incearca asta nu zic ca merge, daca nu merge lasi un reply

Code: Select all

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

#pragma tabsize 0

native get_user_points( id )
native set_user_points( id, points )

new bool: Speed[17];
bool: ParolaSetata [33]
BuySlot [33]
Secunde [33] = 0 , Timp, Slot
Cumparat [33]
new const szTg[] = "Shop";

public plugin_init( ) {

    register_plugin( "1", "shop", "Mihai" );

    RegisterHam( Ham_Spawn, "player", "Sp", true );
    register_event("CurWeapon" , "CWeapon" , "be" , "1=1" );

    register_clcmd( "say shop", "TS", -1 );
    register_clcmd( "say /shop", "TS", -1 );
    register_clcmd( "say_team shop", "TS", -1 );
    register_clcmd( "say_team /shop", "TS", -1 );
}
public client_putinserver( id ) {
Speed[id] = false;
Secunde [id] = 0;
ParolaSetata [id] = false;
}

public TS( id ) {

    if( is_user_connected( id ) && is_user_alive( id ) ) {
        switch( get_user_team( id ) )
            {
                case 1,2: SM( id );    
            }
    }
    else
    client_printcolor( id, "^4[%s]^1Trebuie sa fi in viata pentru a deschide ^3Shopul ^1!", szTg );
}

public SM( id ) {

    new szMenu[ 10 char ];
    format( szMenu, charsmax( szMenu ), "\r[%s] \wMenu",szTg);
    new menu = menu_create ( szMenu , "Menu" );

    menu_additem( menu, "\wVIP 30 Zile \r[5 Puncte]", "1", 0);
    menu_additem( menu, "\wVIP 60 Zile \r[5 Puncte]", "2", 0);
    menu_additem( menu, "\wVip 90 Zile \y400 \r[2 Puncte]", "3", 0);

    menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
    menu_display ( id, menu, 0 );
    return 1;
}


public Menu( id, menu, item ) {

    if( item == MENU_EXIT )
        {
            return 1;
        }
    
    new data [ 6 ], szName [ 64 ];
    new access, callback;
    menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
    new key = str_to_num ( data );    
    switch(key)
    {
        case 1:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
        }
        }
        }
        case 2:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
        }
        }
        }
        case 3:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
            
            
        }
    }
    return 1;
}


public CWeapon( id ) {

    if( Speed[ id ] ) {
        if( get_user_weapon(id)) {
            set_user_maxspeed(id, 450.0);
        }
    }
}

public Sp( id ) {
Speed[id] = false;
set_user_gravity(id, 1.0);
}

stock client_printcolor(const id, const input[], any:...)
{
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
    
    replace_all(msg, 190, "!g", "^x04"); // Green Color
    replace_all(msg, 190, "!n", "^x01"); // Default Color
    replace_all(msg, 190, "!t", "^x03"); // Team Color
    
    if(id)
        players[0] = id;
    else
        get_players(players, count, "ch");
    
    for (new i = 0; i < count; i++)
    {
        message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
        write_byte(players[i]);
        write_string(msg);
        message_end();
    }
}
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < CC_ColorChat >
#include < csx >
#include < cstrike >

#pragma semicolon 1

#define ADMIN_ACCESS ADMIN_IMMUNITY
#define is_user_player(%1) ( 1 <= %1 <= g_MaxPlayers )

#define PLUGIN_NAME     "Engine Sistem Puncte"
#define PLUGIN_VERSION     "1.1"
#define PLUGIN_AUTHOR     "Bobbu!"

new const g_szTag[ ] = "[SHOP]";

// Make files?
new const szWriteCvarsPoints[  ] = "addons/amxmodx/configs/points/points.cfg";
new const szLocationPoints[  ] = "addons/amxmodx/configs/points";

const PEV_SPEC_TARGET = pev_iuser2;

new g_iUserPoints[ 33 ];
new File[ 128 ];

new points_gamename;
new SyncHudMessage, g_MaxPlayers;

enum _:iCvars {

    EnableBombEvents,
    ShowType,
    CostOnePoint,
    PointsPerHS,
    PointsBombPlanted,
    PointsBombExploded,
    PointsBombDefused,
    AddPointsNewRound,
    EnableRespawn,
    PointsForRespawn,
    PointsForRespawnChance
}
;
new g_iCvar[ iCvars ];

public plugin_init( ) {

    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
    
    register_event( "DeathMsg", "event_DeathMsg", "a" );

    register_forward( FM_GetGameDescription, "GameDesc" ); 
    register_forward( FM_PlayerPreThink, "fwd_PlayerPreThink" );

    RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawned_Post", 1 );
    RegisterHam( Ham_Killed, "player", "Ham_PlayerKilled", 1 );
    
    register_clcmd( "say /cp", "ClCmdSayBuyPoint" );
    register_clcmd( "say_team /cp", "ClCmdSayBuyPoint" );

    register_clcmd( "say /top", "ClCmdSayShowAllPoints" );
    register_clcmd( "say_team /top", "ClCmdSayShowAllPoints" );

    register_clcmd( "say /puncte", "ClCmdSayPoints" );
    register_clcmd( "say_team /puncte", "ClCmdSayPoints" );

    register_concmd( "amx_acorda_puncte" ,"ClCmdGivePoints", ADMIN_ACCESS, "< nume / @ALL / @T / @CT > < Puncte >" );
    register_concmd( "amx_retrage_puncte", "ClCmdTakePoints", ADMIN_ACCESS, "< nume > < Puncte >" );
    register_concmd( "amx_reset_puncte", "ClCmdResetPoints", ADMIN_ACCESS, "< nume / @ALL >" );
    
    g_iCvar[ ShowType ] = register_cvar( "points_show_info", "1" );
    g_iCvar[ EnableBombEvents ] = register_cvar( "points_bombevents_rewards", "1" );
    g_iCvar[ CostOnePoint ] = register_cvar( "points_costonepoint", "4000" );
    g_iCvar[ PointsPerHS ] = register_cvar( "points_per_headshot", "2" );
    g_iCvar[ PointsBombPlanted ] = register_cvar( "points_bomb_planted", "4" );
    g_iCvar[ PointsBombExploded ] = register_cvar( "points_bomb_exploded", "1" );
    g_iCvar[ PointsBombDefused ] = register_cvar( "points_bomb_defused", "5" );
    g_iCvar[ PointsForRespawn ] = register_cvar( "points_for_respawn", "10" );
    g_iCvar[ PointsForRespawnChance ] = register_cvar( "points_respawn_chance", "70" );
    g_iCvar[ EnableRespawn ] = register_cvar( "points_enable_respawn", "1" );
    points_gamename = register_cvar( "points_gamename", "RUN INDUNGI SISTEMS" );

    SyncHudMessage = CreateHudSyncObj(  );
    g_MaxPlayers = global_get( glb_maxClients );

    new DataDir[ 64 ];
    get_datadir( DataDir, 63 );
    format( File, 127, "%s/AdvancedPointsSystem.dat", DataDir );
}

public plugin_precache(  ) {

    server_cmd( "exec %s", szWriteCvarsPoints );
       
    if( !dir_exists( szLocationPoints ) )
        mkdir( szLocationPoints );

    if( !file_exists( szWriteCvarsPoints ) ) {

        write_file( szWriteCvarsPoints, "// In acest fisier se afla cvar-urile legate despre puncte:");
        write_file( szWriteCvarsPoints, " ");
        write_file( szWriteCvarsPoints, "points_show_info ^"1^" // 0: Afiseaza datele in HUD sub radar | 1: Afiseaza datele deasupra vietii" );
        write_file( szWriteCvarsPoints, "points_bombevents_rewards ^"1^" // 0: Dezactivat | 1: Activat -> Puncte obtinute pe plantarea/dezamorsarea/explodearea bombei" );
        write_file( szWriteCvarsPoints, "points_costonepoint ^"4000^" // Cat sa coste un punct atunci cand il cumperi prin comanda /buypoint" );
        write_file( szWriteCvarsPoints, "points_per_headshot ^"2^" // Cate puncte sa primesti pe HeadShot !" );
        write_file( szWriteCvarsPoints, "points_bomb_planted ^"1^" // Cate puncte sa primesti pe plantarea bombei" );
        write_file( szWriteCvarsPoints, "points_bomb_exploded ^"2^" // Cate puncte sa primesti pe explodarea bombei" );
        write_file( szWriteCvarsPoints, "points_bomb_defused ^"1^" // Cate puncte sa primesti pe dezamorsarea bombei" );
        write_file( szWriteCvarsPoints, "points_enable_respawn ^"1^" // Activeaza / Dezactiveaza respawn-ul cand victima moare doar daca are X PUNCTE" );
        write_file( szWriteCvarsPoints, "points_for_respawn ^"1000^" // Cate puncte sa aiba victima ca sa poata reinvia atunci cand este omorata" );
        write_file( szWriteCvarsPoints, "points_respawn_chance ^"40^" // Cate sanse sa aiba victima ca sa poata reinvia" );
        write_file( szWriteCvarsPoints, "points_gamename ^"Adv. Points System v1.1^" // Schimbi numele default( Counter-Strike ) cu altul" );
        //write_file( szWriteCvarsPoints, "cvar ^"1 / 0^" // De cate sanse are nevoie victima ca sa invie atunci cand are X PUNCTE" );
    }
}

public plugin_natives( ) {

    register_native( "get_user_points", "native_get_user_points", 1 );
    register_native( "set_user_points", "native_set_user_points", 1 );
}

public native_get_user_points( id ) {

    return g_iUserPoints[ id ];
}

public native_set_user_points( id, points ) {

    g_iUserPoints[ id ] = points;
}

public client_putinserver( id ) {

    LoadUserPoints( id );
}

public client_disconnect( id ) {

    SaveUserPoints( id );
    ParolaSetata [id] = false;
}

public GameDesc( ) {

    static szGameName[ 32 ];

    get_pcvar_string( points_gamename, szGameName, 31 );
    forward_return( FMV_STRING, szGameName );

    return FMRES_SUPERCEDE; 
}

public fwdPlayerPreThink( id ) {
    
    if( is_user_alive( id ) ) {
        
        new target, body; 
        get_user_aiming( id, target, body, 9999 );
        
        new CsTeams:team = cs_get_user_team( id );
        
        if( is_user_alive( target ) ) {

            if( is_user_player( target ) ) {
            
                new CsTeams:targetTeam = cs_get_user_team( target );
                
                new szName[ 32 ];
                get_user_name( target,  szName, sizeof( szName ) -1 );
                            
                new sMessage[ 64 ];
                if( targetTeam == team ) {

                    formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Puncte: %i", is_user_vip( target ) ? "VIP" : "Friend", szName, get_user_health( target ), g_iUserPoints[ target ] );
                }

                else if( targetTeam != team && team != CS_TEAM_CT ) {

                    formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Puncte: %i", is_user_vip( target ) ? "VIP" : "Enemy", szName, get_user_health( target ), g_iUserPoints[ target ] );
                }
                    
                if( targetTeam == CS_TEAM_CT ) {

                    set_hudmessage( 0, 255, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
                }

                else if( targetTeam == CS_TEAM_T ) {

                    set_hudmessage( 127, 0, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
                }    
                
                show_hudmessage( id, "%s",  sMessage );
            }
        }
    }
    
    return FMRES_IGNORED;
}

public event_DeathMsg( ) {

    new iKiller = read_data( 1 );
    new iVictim = read_data( 2 );
    new iHeadshot = read_data( 3 );
    
    if( !is_user_connected( iKiller ) || !is_user_connected( iVictim ) ) {

        return;
    }
    
    if( iKiller == iVictim ) {

        return;
    }
    
    if( iHeadshot ) {

        g_iUserPoints[ iKiller ] += get_pcvar_num( g_iCvar[ PointsPerHS ] );
        set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 1, 6.0, 7.0 );
        show_hudmessage( iKiller, "+%i points", get_pcvar_num( g_iCvar[ PointsPerHS ] ) );
    }

    else {

        g_iUserPoints[ iKiller ]++;
        set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 0, 6.0, 7.0 );
        show_hudmessage( iKiller, "+1 point" );
    }
}

public Ham_PlayerSpawned_Post( id ) {

    if( is_user_connected( id ) && is_user_alive( id ) ) {

        set_task( 1.0, "ShowHud", id, _, _, "b" );
    }
}

public Ham_PlayerKilled( iVictim, iAttacker, iShouldgib ) {

    if( get_pcvar_num( g_iCvar[ EnableRespawn ] ) == 0 || !is_user_connected( iVictim ) )
        return PLUGIN_CONTINUE;

    new iPoints = get_pcvar_num( g_iCvar[ PointsForRespawn ] );
    new iChance = random_num( 1, 100 );
    new iAccepted = get_pcvar_num( g_iCvar[ PointsForRespawnChance ] );

    if( g_iUserPoints[ iVictim ] == iPoints ) {

        if( iChance <= iAccepted ) {

            ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai fost inviat pentru ca ai avut^x03 %i^x01 sanse !", g_szTag, iChance );
        }

        if( iChance >= iAccepted ) {

            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Poate runda viitoare vei avea^x03 %i^x01 sanse pentru a putea reinvia !", g_szTag, iChance );
        }
    }

    return PLUGIN_CONTINUE;
}

public ShowHud( id ) {

    switch( get_pcvar_num( g_iCvar[ ShowType ] ) ) {

        case 0: {
    
            if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.23, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "HP: %d^nPoints: %d", get_user_health( id ), g_iUserPoints[ id ] );
            }

            else {

                new idSpec;
                new iPlayerName[ 32 ];

                idSpec = pev( id, PEV_SPEC_TARGET );
                get_user_name( idSpec, iPlayerName, 31 );

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.22, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPuncte: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
            }
        }

        case 1: {
    
            if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

                set_hudmessage( 0, 0, 254, 0.01, 0.91, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "HP: %d | AP: %d | Puncte: %d", get_user_health( id ), get_user_armor( id ), g_iUserPoints[ id ] );
            }

            else {

                new idSpec;
                new iPlayerName[ 32 ];

                idSpec = pev( id, PEV_SPEC_TARGET );
                get_user_name( idSpec, iPlayerName, 31 );

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), -1.0, 0.7, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPuncte: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
            }
        }
    }
}

public ClCmdSayBuyPoint( id ) {

    if( is_user_connected( id ) )
    {
        new g_iUserMoney = cs_get_user_money( id );
        new iNeededMoney = get_pcvar_num( g_iCvar[ CostOnePoint ] );
 
        if( g_iUserMoney < iNeededMoney )
 
        ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Mai ai nevoie de^x03 %d $^x01 pentru a cumpara^x03 1 punct^x01 !", g_szTag, iNeededMoney - g_iUserMoney );
 
        else {
 
            g_iUserPoints[ id ] += 1;
            cs_set_user_money( id, g_iUserMoney - iNeededMoney );
            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai cumparat^x03 1 punct^x01 pentru^x03 %d $ !", g_szTag, iNeededMoney );
        }
    }
}

public ClCmdSayShowAllPoints( id ) {

    new iPlayers[ 32 ], iPlayersNum, szName[ 40 ], szMotd[ 1024 ], len;

    len = formatex( szMotd, charsmax( szMotd ), "<html> ");
    get_players( iPlayers, iPlayersNum );

    for( new i = 0 ; i < iPlayersNum ; i++ ) {

        get_user_name( iPlayers[ i ], szName, charsmax( szName ) );
        len += formatex( szMotd[ len ], charsmax( szMotd ) - len, "<br> <center> <font color=#008000>Name:</font> <font color=#8A2BE2>%s</font> | <font color=#008000>Points:</font> <font color=#8A2BE2>%i</font> </center> <br>", szName, g_iUserPoints[ iPlayers[ i ] ] );
    }

    formatex( szMotd[ len ], charsmax( szMotd ) - len, </html>
Mai bine nu mai lasai reply..
MIX-CORE Apasa aici
floringold01
Membru, skill +1
Membru, skill +1
Posts: 205
Joined: 02 Jan 2017, 03:01
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: DA
SteamID: NU
Fond eXtream: 0
Contact:

31 Jul 2022, 19:42

Da am uitat sa specific mod-ul clasic si vip-ul are litera T. da imi da eroare
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

shop.sma(232) : fatal error 100: cannot read from file: "CC_ColorChat"

Compilation aborted.
1 Error.


ERROR: The plugin you tried to compile needs a 3rd party include file.
Please contact the administrator via email (stefanzanfir00@gmail.com) to add the include.
Image
User avatar
Robertsasab
Membru, skill 0
Membru, skill 0
Posts: 32
Joined: 16 May 2022, 11:18
Detinator Steam: Da
CS Status: BlackGames.Ro
Detinator server CS: BBX.NEXTCS.RO
Fond eXtream: 0
Location: Romania
Discord: Robertsasa#3020
Has thanked: 1 time
Been thanked: 1 time
Contact:

31 Jul 2022, 22:27

Preturile pentru cumparare vip ti le pui tu

Code: Select all

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

#pragma tabsize 0

native get_user_points( id )
native set_user_points( id, points )

new bool: Speed[17];
bool: ParolaSetata [33]
BuyVip [33]
Secunde [33] = 0 , Timp, VIP
Cumparat [33]
new const szTg[] = "Shop";

public plugin_init( ) {

    register_plugin( "1", "shop", "Mihai" );

    RegisterHam( Ham_Spawn, "player", "Sp", true );
    register_event("CurWeapon" , "CWeapon" , "be" , "1=1" );

    register_clcmd( "say shop", "TS", -1 );
    register_clcmd( "say /shop", "TS", -1 );
    register_clcmd( "say_team shop", "TS", -1 );
    register_clcmd( "say_team /shop", "TS", -1 );
}
public client_putinserver( id ) {
Speed[id] = false;
Secunde [id] = 0;
ParolaSetata [id] = false;
}

public TS( id ) {

    if( is_user_connected( id ) && is_user_alive( id ) ) {
        switch( get_user_team( id ) )
            {
                case 1,2: SM( id );    
            }
    }
    else
    client_printcolor( id, "^4[%s]^1Trebuie sa fi in viata pentru a deschide ^3Shopul ^1!", szTg );
}

public SM( id ) {

    new szMenu[ 10 char ];
    format( szMenu, charsmax( szMenu ), "\r[%s] \wMenu",szTg);
    new menu = menu_create ( szMenu , "Menu" );

    menu_additem( menu, "\wVIP 30 Zile \r[5 Puncte]", "1", 0);
    menu_additem( menu, "\wVIP 60 Zile \r[5 Puncte]", "2", 0);
    menu_additem( menu, "\wVip 90 Zile \y400 \r[2 Puncte]", "3", 0);

    menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
    menu_display ( id, menu, 0 );
    return 1;
}


public Menu( id, menu, item ) {

    if( item == MENU_EXIT )
        {
            return 1;
        }
    
    new data [ 6 ], szName [ 64 ];
    new access, callback;
    menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
    new key = str_to_num ( data );    
    switch(key)
    {
        case 1:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
        }
        }
        }
        case 2:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
        }
        }
        }
        case 3:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
            
            
        }
    }
    return 1;
}


public CWeapon( id ) {

    if( Speed[ id ] ) {
        if( get_user_weapon(id)) {
            set_user_maxspeed(id, 450.0);
        }
    }
}

public Sp( id ) {
Speed[id] = false;
set_user_gravity(id, 1.0);
}

stock client_printcolor(const id, const input[], any:...)
{
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
    
    replace_all(msg, 190, "!g", "^x04"); // Green Color
    replace_all(msg, 190, "!n", "^x01"); // Default Color
    replace_all(msg, 190, "!t", "^x03"); // Team Color
    
    if(id)
        players[0] = id;
    else
        get_players(players, count, "ch");
    
    for (new i = 0; i < count; i++)
    {
        message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
        write_byte(players[i]);
        write_string(msg);
        message_end();
    }
}
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < CC_ColorChat >
#include < csx >
#include < cstrike >

#pragma semicolon 1

#define ADMIN_ACCESS ADMIN_IMMUNITY
#define is_user_player(%1) ( 1 <= %1 <= g_MaxPlayers )

#define PLUGIN_NAME     "Engine Sistem Puncte"
#define PLUGIN_VERSION     "1.1"
#define PLUGIN_AUTHOR     "Bobbu!"

new const g_szTag[ ] = "[SHOP]";

// Make files?
new const szWriteCvarsPoints[  ] = "addons/amxmodx/configs/points/points.cfg";
new const szLocationPoints[  ] = "addons/amxmodx/configs/points";

const PEV_SPEC_TARGET = pev_iuser2;

new g_iUserPoints[ 33 ];
new File[ 128 ];

new points_gamename;
new SyncHudMessage, g_MaxPlayers;

enum _:iCvars {

    EnableBombEvents,
    ShowType,
    CostOnePoint,
    PointsPerHS,
    PointsBombPlanted,
    PointsBombExploded,
    PointsBombDefused,
    AddPointsNewRound,
    EnableRespawn,
    PointsForRespawn,
    PointsForRespawnChance
}
;
new g_iCvar[ iCvars ];

public plugin_init( ) {

    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
    
    register_event( "DeathMsg", "event_DeathMsg", "a" );

    register_forward( FM_GetGameDescription, "GameDesc" ); 
    register_forward( FM_PlayerPreThink, "fwd_PlayerPreThink" );

    RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawned_Post", 1 );
    RegisterHam( Ham_Killed, "player", "Ham_PlayerKilled", 1 );
    
    register_clcmd( "say /cp", "ClCmdSayBuyPoint" );
    register_clcmd( "say_team /cp", "ClCmdSayBuyPoint" );

    register_clcmd( "say /top", "ClCmdSayShowAllPoints" );
    register_clcmd( "say_team /top", "ClCmdSayShowAllPoints" );

    register_clcmd( "say /puncte", "ClCmdSayPoints" );
    register_clcmd( "say_team /puncte", "ClCmdSayPoints" );

    register_concmd( "amx_acorda_puncte" ,"ClCmdGivePoints", ADMIN_ACCESS, "< nume / @ALL / @T / @CT > < Puncte >" );
    register_concmd( "amx_retrage_puncte", "ClCmdTakePoints", ADMIN_ACCESS, "< nume > < Puncte >" );
    register_concmd( "amx_reset_puncte", "ClCmdResetPoints", ADMIN_ACCESS, "< nume / @ALL >" );
    
    g_iCvar[ ShowType ] = register_cvar( "points_show_info", "1" );
    g_iCvar[ EnableBombEvents ] = register_cvar( "points_bombevents_rewards", "1" );
    g_iCvar[ CostOnePoint ] = register_cvar( "points_costonepoint", "4000" );
    g_iCvar[ PointsPerHS ] = register_cvar( "points_per_headshot", "2" );
    g_iCvar[ PointsBombPlanted ] = register_cvar( "points_bomb_planted", "4" );
    g_iCvar[ PointsBombExploded ] = register_cvar( "points_bomb_exploded", "1" );
    g_iCvar[ PointsBombDefused ] = register_cvar( "points_bomb_defused", "5" );
    g_iCvar[ PointsForRespawn ] = register_cvar( "points_for_respawn", "10" );
    g_iCvar[ PointsForRespawnChance ] = register_cvar( "points_respawn_chance", "70" );
    g_iCvar[ EnableRespawn ] = register_cvar( "points_enable_respawn", "1" );
    points_gamename = register_cvar( "points_gamename", "RUN INDUNGI SISTEMS" );

    SyncHudMessage = CreateHudSyncObj(  );
    g_MaxPlayers = global_get( glb_maxClients );

    new DataDir[ 64 ];
    get_datadir( DataDir, 63 );
    format( File, 127, "%s/AdvancedPointsSystem.dat", DataDir );
}

public plugin_precache(  ) {

    server_cmd( "exec %s", szWriteCvarsPoints );
       
    if( !dir_exists( szLocationPoints ) )
        mkdir( szLocationPoints );

    if( !file_exists( szWriteCvarsPoints ) ) {

        write_file( szWriteCvarsPoints, "// In acest fisier se afla cvar-urile legate despre puncte:");
        write_file( szWriteCvarsPoints, " ");
        write_file( szWriteCvarsPoints, "points_show_info ^"1^" // 0: Afiseaza datele in HUD sub radar | 1: Afiseaza datele deasupra vietii" );
        write_file( szWriteCvarsPoints, "points_bombevents_rewards ^"1^" // 0: Dezactivat | 1: Activat -> Puncte obtinute pe plantarea/dezamorsarea/explodearea bombei" );
        write_file( szWriteCvarsPoints, "points_costonepoint ^"4000^" // Cat sa coste un punct atunci cand il cumperi prin comanda /buypoint" );
        write_file( szWriteCvarsPoints, "points_per_headshot ^"2^" // Cate puncte sa primesti pe HeadShot !" );
        write_file( szWriteCvarsPoints, "points_bomb_planted ^"1^" // Cate puncte sa primesti pe plantarea bombei" );
        write_file( szWriteCvarsPoints, "points_bomb_exploded ^"2^" // Cate puncte sa primesti pe explodarea bombei" );
        write_file( szWriteCvarsPoints, "points_bomb_defused ^"1^" // Cate puncte sa primesti pe dezamorsarea bombei" );
        write_file( szWriteCvarsPoints, "points_enable_respawn ^"1^" // Activeaza / Dezactiveaza respawn-ul cand victima moare doar daca are X PUNCTE" );
        write_file( szWriteCvarsPoints, "points_for_respawn ^"1000^" // Cate puncte sa aiba victima ca sa poata reinvia atunci cand este omorata" );
        write_file( szWriteCvarsPoints, "points_respawn_chance ^"40^" // Cate sanse sa aiba victima ca sa poata reinvia" );
        write_file( szWriteCvarsPoints, "points_gamename ^"Adv. Points System v1.1^" // Schimbi numele default( Counter-Strike ) cu altul" );
        //write_file( szWriteCvarsPoints, "cvar ^"1 / 0^" // De cate sanse are nevoie victima ca sa invie atunci cand are X PUNCTE" );
    }
}

public plugin_natives( ) {

    register_native( "get_user_points", "native_get_user_points", 1 );
    register_native( "set_user_points", "native_set_user_points", 1 );
}

public native_get_user_points( id ) {

    return g_iUserPoints[ id ];
}

public native_set_user_points( id, points ) {

    g_iUserPoints[ id ] = points;
}

public client_putinserver( id ) {

    LoadUserPoints( id );
}

public client_disconnect( id ) {

    SaveUserPoints( id );
    ParolaSetata [id] = false;
}

public GameDesc( ) {

    static szGameName[ 32 ];

    get_pcvar_string( points_gamename, szGameName, 31 );
    forward_return( FMV_STRING, szGameName );

    return FMRES_SUPERCEDE; 
}

public fwdPlayerPreThink( id ) {
    
    if( is_user_alive( id ) ) {
        
        new target, body; 
        get_user_aiming( id, target, body, 9999 );
        
        new CsTeams:team = cs_get_user_team( id );
        
        if( is_user_alive( target ) ) {

            if( is_user_player( target ) ) {
            
                new CsTeams:targetTeam = cs_get_user_team( target );
                
                new szName[ 32 ];
                get_user_name( target,  szName, sizeof( szName ) -1 );
                            
                new sMessage[ 64 ];
                if( targetTeam == team ) {

                    formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Puncte: %i", is_user_vip( target ) ? "VIP" : "Friend", szName, get_user_health( target ), g_iUserPoints[ target ] );
                }

                else if( targetTeam != team && team != CS_TEAM_CT ) {

                    formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Puncte: %i", is_user_vip( target ) ? "VIP" : "Enemy", szName, get_user_health( target ), g_iUserPoints[ target ] );
                }
                    
                if( targetTeam == CS_TEAM_CT ) {

                    set_hudmessage( 0, 255, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
                }

                else if( targetTeam == CS_TEAM_T ) {

                    set_hudmessage( 127, 0, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
                }    
                
                show_hudmessage( id, "%s",  sMessage );
            }
        }
    }
    
    return FMRES_IGNORED;
}

public event_DeathMsg( ) {

    new iKiller = read_data( 1 );
    new iVictim = read_data( 2 );
    new iHeadshot = read_data( 3 );
    
    if( !is_user_connected( iKiller ) || !is_user_connected( iVictim ) ) {

        return;
    }
    
    if( iKiller == iVictim ) {

        return;
    }
    
    if( iHeadshot ) {

        g_iUserPoints[ iKiller ] += get_pcvar_num( g_iCvar[ PointsPerHS ] );
        set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 1, 6.0, 7.0 );
        show_hudmessage( iKiller, "+%i points", get_pcvar_num( g_iCvar[ PointsPerHS ] ) );
    }

    else {

        g_iUserPoints[ iKiller ]++;
        set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 0, 6.0, 7.0 );
        show_hudmessage( iKiller, "+1 point" );
    }
}

public Ham_PlayerSpawned_Post( id ) {

    if( is_user_connected( id ) && is_user_alive( id ) ) {

        set_task( 1.0, "ShowHud", id, _, _, "b" );
    }
}

public Ham_PlayerKilled( iVictim, iAttacker, iShouldgib ) {

    if( get_pcvar_num( g_iCvar[ EnableRespawn ] ) == 0 || !is_user_connected( iVictim ) )
        return PLUGIN_CONTINUE;

    new iPoints = get_pcvar_num( g_iCvar[ PointsForRespawn ] );
    new iChance = random_num( 1, 100 );
    new iAccepted = get_pcvar_num( g_iCvar[ PointsForRespawnChance ] );

    if( g_iUserPoints[ iVictim ] == iPoints ) {

        if( iChance <= iAccepted ) {

            ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai fost inviat pentru ca ai avut^x03 %i^x01 sanse !", g_szTag, iChance );
        }

        if( iChance >= iAccepted ) {

            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Poate runda viitoare vei avea^x03 %i^x01 sanse pentru a putea reinvia !", g_szTag, iChance );
        }
    }

    return PLUGIN_CONTINUE;
}

public ShowHud( id ) {

    switch( get_pcvar_num( g_iCvar[ ShowType ] ) ) {

        case 0: {
    
            if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.23, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "HP: %d^nPoints: %d", get_user_health( id ), g_iUserPoints[ id ] );
            }

            else {

                new idSpec;
                new iPlayerName[ 32 ];

                idSpec = pev( id, PEV_SPEC_TARGET );
                get_user_name( idSpec, iPlayerName, 31 );

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.22, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPuncte: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
            }
        }

        case 1: {
    
            if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

                set_hudmessage( 0, 0, 254, 0.01, 0.91, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "HP: %d | AP: %d | Puncte: %d", get_user_health( id ), get_user_armor( id ), g_iUserPoints[ id ] );
            }

            else {

                new idSpec;
                new iPlayerName[ 32 ];

                idSpec = pev( id, PEV_SPEC_TARGET );
                get_user_name( idSpec, iPlayerName, 31 );

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), -1.0, 0.7, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPuncte: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
            }
        }
    }
}

public ClCmdSayBuyPoint( id ) {

    if( is_user_connected( id ) )
    {
        new g_iUserMoney = cs_get_user_money( id );
        new iNeededMoney = get_pcvar_num( g_iCvar[ CostOnePoint ] );
 
        if( g_iUserMoney < iNeededMoney )
 
        ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Mai ai nevoie de^x03 %d $^x01 pentru a cumpara^x03 1 punct^x01 !", g_szTag, iNeededMoney - g_iUserMoney );
 
        else {
 
            g_iUserPoints[ id ] += 1;
            cs_set_user_money( id, g_iUserMoney - iNeededMoney );
            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai cumparat^x03 1 punct^x01 pentru^x03 %d $ !", g_szTag, iNeededMoney );
        }
    }
}

public ClCmdSayShowAllPoints( id ) {

    new iPlayers[ 32 ], iPlayersNum, szName[ 40 ], szMotd[ 1024 ], len;

    len = formatex( szMotd, charsmax( szMotd ), "<html> ");
    get_players( iPlayers, iPlayersNum );

    for( new i = 0 ; i < iPlayersNum ; i++ ) {

        get_user_name( iPlayers[ i ], szName, charsmax( szName ) );
        len += formatex( szMotd[ len ], charsmax( szMotd ) - len, "<br> <center> <font color=#008000>Name:</font> <font color=#8A2BE2>%s</font> | <font color=#008000>Points:</font> <font color=#8A2BE2>%i</font> </center> <br>", szName, g_iUserPoints[ iPlayers[ i ] ] );
    }

    formatex( szMotd[ len ], charsmax( szMotd ) - len, </html>
Si vezi ca nu ai include-ul CC_ColorChat
BlackGames.Ro
User avatar
N3v3rM1nd
Membru, skill +2
Membru, skill +2
Posts: 735
Joined: 06 Oct 2018, 14:41
Detinator Steam: Da
SteamID: /id/kidd0x/
Fond eXtream: 0
Location: Constangeles
Discord: kidd0x#1886
Has thanked: 122 times
Been thanked: 67 times

31 Jul 2022, 22:52

Robertsasab wrote:
31 Jul 2022, 22:27
Preturile pentru cumparare vip ti le pui tu

Code: Select all

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

#pragma tabsize 0

native get_user_points( id )
native set_user_points( id, points )

new bool: Speed[17];
bool: ParolaSetata [33]
BuyVip [33]
Secunde [33] = 0 , Timp, VIP
Cumparat [33]
new const szTg[] = "Shop";

public plugin_init( ) {

    register_plugin( "1", "shop", "Mihai" );

    RegisterHam( Ham_Spawn, "player", "Sp", true );
    register_event("CurWeapon" , "CWeapon" , "be" , "1=1" );

    register_clcmd( "say shop", "TS", -1 );
    register_clcmd( "say /shop", "TS", -1 );
    register_clcmd( "say_team shop", "TS", -1 );
    register_clcmd( "say_team /shop", "TS", -1 );
}
public client_putinserver( id ) {
Speed[id] = false;
Secunde [id] = 0;
ParolaSetata [id] = false;
}

public TS( id ) {

    if( is_user_connected( id ) && is_user_alive( id ) ) {
        switch( get_user_team( id ) )
            {
                case 1,2: SM( id );    
            }
    }
    else
    client_printcolor( id, "^4[%s]^1Trebuie sa fi in viata pentru a deschide ^3Shopul ^1!", szTg );
}

public SM( id ) {

    new szMenu[ 10 char ];
    format( szMenu, charsmax( szMenu ), "\r[%s] \wMenu",szTg);
    new menu = menu_create ( szMenu , "Menu" );

    menu_additem( menu, "\wVIP 30 Zile \r[5 Puncte]", "1", 0);
    menu_additem( menu, "\wVIP 60 Zile \r[5 Puncte]", "2", 0);
    menu_additem( menu, "\wVip 90 Zile \y400 \r[2 Puncte]", "3", 0);

    menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
    menu_display ( id, menu, 0 );
    return 1;
}


public Menu( id, menu, item ) {

    if( item == MENU_EXIT )
        {
            return 1;
        }
    
    new data [ 6 ], szName [ 64 ];
    new access, callback;
    menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
    new key = str_to_num ( data );    
    switch(key)
    {
        case 1:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
        }
        }
        }
        case 2:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
        }
        }
        }
        case 3:
        {
            if ( get_user_flag ( id ) & read_flags ( "t" ) )
            {

                ChatColor ( id, "%s!team Ai deja !gVIP!team!", Tag );
                
                SM ( id );
                
                return PLUGIN_HANDLED
            }

            if ( points < get_pcvar_num ( VIP ) )
            {
                ChatColor ( id, "%s!team Nu ai destle !gPuncte!team pentru a cumpara acest item!", Tag );

                SM( id )

                return PLUGIN_HANDLED;
            }
            else
            {
                client_cmd ( id, "messagemode Introdu_Parola" );

                Secunde [id] = get_pcvar_num ( Timp );

                Cumparat [id] = 1;

                Cautare ( id );

                ParolaSetata [id] = true;
            }
            return PLUGIN_HANDLED
            
            
        }
    }
    return 1;
}


public CWeapon( id ) {

    if( Speed[ id ] ) {
        if( get_user_weapon(id)) {
            set_user_maxspeed(id, 450.0);
        }
    }
}

public Sp( id ) {
Speed[id] = false;
set_user_gravity(id, 1.0);
}

stock client_printcolor(const id, const input[], any:...)
{
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
    
    replace_all(msg, 190, "!g", "^x04"); // Green Color
    replace_all(msg, 190, "!n", "^x01"); // Default Color
    replace_all(msg, 190, "!t", "^x03"); // Team Color
    
    if(id)
        players[0] = id;
    else
        get_players(players, count, "ch");
    
    for (new i = 0; i < count; i++)
    {
        message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
        write_byte(players[i]);
        write_string(msg);
        message_end();
    }
}
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < CC_ColorChat >
#include < csx >
#include < cstrike >

#pragma semicolon 1

#define ADMIN_ACCESS ADMIN_IMMUNITY
#define is_user_player(%1) ( 1 <= %1 <= g_MaxPlayers )

#define PLUGIN_NAME     "Engine Sistem Puncte"
#define PLUGIN_VERSION     "1.1"
#define PLUGIN_AUTHOR     "Bobbu!"

new const g_szTag[ ] = "[SHOP]";

// Make files?
new const szWriteCvarsPoints[  ] = "addons/amxmodx/configs/points/points.cfg";
new const szLocationPoints[  ] = "addons/amxmodx/configs/points";

const PEV_SPEC_TARGET = pev_iuser2;

new g_iUserPoints[ 33 ];
new File[ 128 ];

new points_gamename;
new SyncHudMessage, g_MaxPlayers;

enum _:iCvars {

    EnableBombEvents,
    ShowType,
    CostOnePoint,
    PointsPerHS,
    PointsBombPlanted,
    PointsBombExploded,
    PointsBombDefused,
    AddPointsNewRound,
    EnableRespawn,
    PointsForRespawn,
    PointsForRespawnChance
}
;
new g_iCvar[ iCvars ];

public plugin_init( ) {

    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
    
    register_event( "DeathMsg", "event_DeathMsg", "a" );

    register_forward( FM_GetGameDescription, "GameDesc" ); 
    register_forward( FM_PlayerPreThink, "fwd_PlayerPreThink" );

    RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawned_Post", 1 );
    RegisterHam( Ham_Killed, "player", "Ham_PlayerKilled", 1 );
    
    register_clcmd( "say /cp", "ClCmdSayBuyPoint" );
    register_clcmd( "say_team /cp", "ClCmdSayBuyPoint" );

    register_clcmd( "say /top", "ClCmdSayShowAllPoints" );
    register_clcmd( "say_team /top", "ClCmdSayShowAllPoints" );

    register_clcmd( "say /puncte", "ClCmdSayPoints" );
    register_clcmd( "say_team /puncte", "ClCmdSayPoints" );

    register_concmd( "amx_acorda_puncte" ,"ClCmdGivePoints", ADMIN_ACCESS, "< nume / @ALL / @T / @CT > < Puncte >" );
    register_concmd( "amx_retrage_puncte", "ClCmdTakePoints", ADMIN_ACCESS, "< nume > < Puncte >" );
    register_concmd( "amx_reset_puncte", "ClCmdResetPoints", ADMIN_ACCESS, "< nume / @ALL >" );
    
    g_iCvar[ ShowType ] = register_cvar( "points_show_info", "1" );
    g_iCvar[ EnableBombEvents ] = register_cvar( "points_bombevents_rewards", "1" );
    g_iCvar[ CostOnePoint ] = register_cvar( "points_costonepoint", "4000" );
    g_iCvar[ PointsPerHS ] = register_cvar( "points_per_headshot", "2" );
    g_iCvar[ PointsBombPlanted ] = register_cvar( "points_bomb_planted", "4" );
    g_iCvar[ PointsBombExploded ] = register_cvar( "points_bomb_exploded", "1" );
    g_iCvar[ PointsBombDefused ] = register_cvar( "points_bomb_defused", "5" );
    g_iCvar[ PointsForRespawn ] = register_cvar( "points_for_respawn", "10" );
    g_iCvar[ PointsForRespawnChance ] = register_cvar( "points_respawn_chance", "70" );
    g_iCvar[ EnableRespawn ] = register_cvar( "points_enable_respawn", "1" );
    points_gamename = register_cvar( "points_gamename", "RUN INDUNGI SISTEMS" );

    SyncHudMessage = CreateHudSyncObj(  );
    g_MaxPlayers = global_get( glb_maxClients );

    new DataDir[ 64 ];
    get_datadir( DataDir, 63 );
    format( File, 127, "%s/AdvancedPointsSystem.dat", DataDir );
}

public plugin_precache(  ) {

    server_cmd( "exec %s", szWriteCvarsPoints );
       
    if( !dir_exists( szLocationPoints ) )
        mkdir( szLocationPoints );

    if( !file_exists( szWriteCvarsPoints ) ) {

        write_file( szWriteCvarsPoints, "// In acest fisier se afla cvar-urile legate despre puncte:");
        write_file( szWriteCvarsPoints, " ");
        write_file( szWriteCvarsPoints, "points_show_info ^"1^" // 0: Afiseaza datele in HUD sub radar | 1: Afiseaza datele deasupra vietii" );
        write_file( szWriteCvarsPoints, "points_bombevents_rewards ^"1^" // 0: Dezactivat | 1: Activat -> Puncte obtinute pe plantarea/dezamorsarea/explodearea bombei" );
        write_file( szWriteCvarsPoints, "points_costonepoint ^"4000^" // Cat sa coste un punct atunci cand il cumperi prin comanda /buypoint" );
        write_file( szWriteCvarsPoints, "points_per_headshot ^"2^" // Cate puncte sa primesti pe HeadShot !" );
        write_file( szWriteCvarsPoints, "points_bomb_planted ^"1^" // Cate puncte sa primesti pe plantarea bombei" );
        write_file( szWriteCvarsPoints, "points_bomb_exploded ^"2^" // Cate puncte sa primesti pe explodarea bombei" );
        write_file( szWriteCvarsPoints, "points_bomb_defused ^"1^" // Cate puncte sa primesti pe dezamorsarea bombei" );
        write_file( szWriteCvarsPoints, "points_enable_respawn ^"1^" // Activeaza / Dezactiveaza respawn-ul cand victima moare doar daca are X PUNCTE" );
        write_file( szWriteCvarsPoints, "points_for_respawn ^"1000^" // Cate puncte sa aiba victima ca sa poata reinvia atunci cand este omorata" );
        write_file( szWriteCvarsPoints, "points_respawn_chance ^"40^" // Cate sanse sa aiba victima ca sa poata reinvia" );
        write_file( szWriteCvarsPoints, "points_gamename ^"Adv. Points System v1.1^" // Schimbi numele default( Counter-Strike ) cu altul" );
        //write_file( szWriteCvarsPoints, "cvar ^"1 / 0^" // De cate sanse are nevoie victima ca sa invie atunci cand are X PUNCTE" );
    }
}

public plugin_natives( ) {

    register_native( "get_user_points", "native_get_user_points", 1 );
    register_native( "set_user_points", "native_set_user_points", 1 );
}

public native_get_user_points( id ) {

    return g_iUserPoints[ id ];
}

public native_set_user_points( id, points ) {

    g_iUserPoints[ id ] = points;
}

public client_putinserver( id ) {

    LoadUserPoints( id );
}

public client_disconnect( id ) {

    SaveUserPoints( id );
    ParolaSetata [id] = false;
}

public GameDesc( ) {

    static szGameName[ 32 ];

    get_pcvar_string( points_gamename, szGameName, 31 );
    forward_return( FMV_STRING, szGameName );

    return FMRES_SUPERCEDE; 
}

public fwdPlayerPreThink( id ) {
    
    if( is_user_alive( id ) ) {
        
        new target, body; 
        get_user_aiming( id, target, body, 9999 );
        
        new CsTeams:team = cs_get_user_team( id );
        
        if( is_user_alive( target ) ) {

            if( is_user_player( target ) ) {
            
                new CsTeams:targetTeam = cs_get_user_team( target );
                
                new szName[ 32 ];
                get_user_name( target,  szName, sizeof( szName ) -1 );
                            
                new sMessage[ 64 ];
                if( targetTeam == team ) {

                    formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Puncte: %i", is_user_vip( target ) ? "VIP" : "Friend", szName, get_user_health( target ), g_iUserPoints[ target ] );
                }

                else if( targetTeam != team && team != CS_TEAM_CT ) {

                    formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Puncte: %i", is_user_vip( target ) ? "VIP" : "Enemy", szName, get_user_health( target ), g_iUserPoints[ target ] );
                }
                    
                if( targetTeam == CS_TEAM_CT ) {

                    set_hudmessage( 0, 255, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
                }

                else if( targetTeam == CS_TEAM_T ) {

                    set_hudmessage( 127, 0, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
                }    
                
                show_hudmessage( id, "%s",  sMessage );
            }
        }
    }
    
    return FMRES_IGNORED;
}

public event_DeathMsg( ) {

    new iKiller = read_data( 1 );
    new iVictim = read_data( 2 );
    new iHeadshot = read_data( 3 );
    
    if( !is_user_connected( iKiller ) || !is_user_connected( iVictim ) ) {

        return;
    }
    
    if( iKiller == iVictim ) {

        return;
    }
    
    if( iHeadshot ) {

        g_iUserPoints[ iKiller ] += get_pcvar_num( g_iCvar[ PointsPerHS ] );
        set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 1, 6.0, 7.0 );
        show_hudmessage( iKiller, "+%i points", get_pcvar_num( g_iCvar[ PointsPerHS ] ) );
    }

    else {

        g_iUserPoints[ iKiller ]++;
        set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 0, 6.0, 7.0 );
        show_hudmessage( iKiller, "+1 point" );
    }
}

public Ham_PlayerSpawned_Post( id ) {

    if( is_user_connected( id ) && is_user_alive( id ) ) {

        set_task( 1.0, "ShowHud", id, _, _, "b" );
    }
}

public Ham_PlayerKilled( iVictim, iAttacker, iShouldgib ) {

    if( get_pcvar_num( g_iCvar[ EnableRespawn ] ) == 0 || !is_user_connected( iVictim ) )
        return PLUGIN_CONTINUE;

    new iPoints = get_pcvar_num( g_iCvar[ PointsForRespawn ] );
    new iChance = random_num( 1, 100 );
    new iAccepted = get_pcvar_num( g_iCvar[ PointsForRespawnChance ] );

    if( g_iUserPoints[ iVictim ] == iPoints ) {

        if( iChance <= iAccepted ) {

            ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai fost inviat pentru ca ai avut^x03 %i^x01 sanse !", g_szTag, iChance );
        }

        if( iChance >= iAccepted ) {

            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Poate runda viitoare vei avea^x03 %i^x01 sanse pentru a putea reinvia !", g_szTag, iChance );
        }
    }

    return PLUGIN_CONTINUE;
}

public ShowHud( id ) {

    switch( get_pcvar_num( g_iCvar[ ShowType ] ) ) {

        case 0: {
    
            if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.23, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "HP: %d^nPoints: %d", get_user_health( id ), g_iUserPoints[ id ] );
            }

            else {

                new idSpec;
                new iPlayerName[ 32 ];

                idSpec = pev( id, PEV_SPEC_TARGET );
                get_user_name( idSpec, iPlayerName, 31 );

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.22, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPuncte: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
            }
        }

        case 1: {
    
            if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

                set_hudmessage( 0, 0, 254, 0.01, 0.91, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "HP: %d | AP: %d | Puncte: %d", get_user_health( id ), get_user_armor( id ), g_iUserPoints[ id ] );
            }

            else {

                new idSpec;
                new iPlayerName[ 32 ];

                idSpec = pev( id, PEV_SPEC_TARGET );
                get_user_name( idSpec, iPlayerName, 31 );

                set_hudmessage( random( 250 ), random( 250 ), random( 250 ), -1.0, 0.7, 0, 0.5, 15.0, 2.0, 2.0, -1 );
                ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPuncte: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
            }
        }
    }
}

public ClCmdSayBuyPoint( id ) {

    if( is_user_connected( id ) )
    {
        new g_iUserMoney = cs_get_user_money( id );
        new iNeededMoney = get_pcvar_num( g_iCvar[ CostOnePoint ] );
 
        if( g_iUserMoney < iNeededMoney )
 
        ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Mai ai nevoie de^x03 %d $^x01 pentru a cumpara^x03 1 punct^x01 !", g_szTag, iNeededMoney - g_iUserMoney );
 
        else {
 
            g_iUserPoints[ id ] += 1;
            cs_set_user_money( id, g_iUserMoney - iNeededMoney );
            ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai cumparat^x03 1 punct^x01 pentru^x03 %d $ !", g_szTag, iNeededMoney );
        }
    }
}

public ClCmdSayShowAllPoints( id ) {

    new iPlayers[ 32 ], iPlayersNum, szName[ 40 ], szMotd[ 1024 ], len;

    len = formatex( szMotd, charsmax( szMotd ), "<html> ");
    get_players( iPlayers, iPlayersNum );

    for( new i = 0 ; i < iPlayersNum ; i++ ) {

        get_user_name( iPlayers[ i ], szName, charsmax( szName ) );
        len += formatex( szMotd[ len ], charsmax( szMotd ) - len, "<br> <center> <font color=#008000>Name:</font> <font color=#8A2BE2>%s</font> | <font color=#008000>Points:</font> <font color=#8A2BE2>%i</font> </center> <br>", szName, g_iUserPoints[ iPlayers[ i ] ] );
    }

    formatex( szMotd[ len ], charsmax( szMotd ) - len, </html>
Si vezi ca nu ai include-ul CC_ColorChat
Bro ce i-ai dat tu aici n are nici macar o treaba cu ce vrea el..
MIX-CORE Apasa aici
floringold01
Membru, skill +1
Membru, skill +1
Posts: 205
Joined: 02 Jan 2017, 03:01
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: DA
SteamID: NU
Fond eXtream: 0
Contact:

01 Aug 2022, 02:27

Tot nu merge am pus si CC_ColorChat si tot nu merge
Image
floringold01
Membru, skill +1
Membru, skill +1
Posts: 205
Joined: 02 Jan 2017, 03:01
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: DA
SteamID: NU
Fond eXtream: 0
Contact:

04 Aug 2022, 23:20

Up.
Image
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2493
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 20 times
Been thanked: 53 times
Contact:

05 Aug 2022, 06:23

floringold01 wrote:
01 Aug 2022, 02:27
Tot nu merge am pus si CC_ColorChat si tot nu merge
Vezi ca sunt 2 pluginurile in acel cod dat ... deasta iti da eroare cu colorchat ... ai shop-ul si un sistem de puncte

#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < CC_ColorChat >
#include < csx >
#include < cstrike >
no...
User avatar
d e a l e r -
eXtream Mod
eXtream Mod
Posts: 2211
Joined: 13 Feb 2016, 16:52
Detinator Steam: Da
CS Status: Connection lost
Reputatie: eXtream Mod
Nume anterior: # DeaLeR., DEALER.eXe
Fost Membru Club eXtreamCS ( o lună )
Fond eXtream: 0
Location: Mediaş, Sibiu, România
Has thanked: 21 times
Been thanked: 45 times
Contact:

13 Aug 2022, 16:49

Coș, respectă modelul de postare.
Discord: D E A L E R -#3474
Locked

Return to “Cos de reciclare”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests