Raised This Month: $2 Target: $400
 0% 

Solved Add items


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AlexandruODT
Member
Join Date: May 2020
Old 05-31-2020 , 15:32   Add items
Reply With Quote #1

Can anyone help me add this menu item to this plugin?

This menu (items) :


PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>


#define PLUGIN "Shop"
#define VERSION "1.1"
#define AUTHOR "Darksmith"

#pragma semicolon 1

new g_iMenugmsgBlinkAcctg_iMaxPlayers;

enum _:playerTasks ( += 33 )
{
    
TASK_PLAYER_REMOVE_GODMODE,
    
TASK_PLAYER_REMOVE_INVIS,
    
TASK_PLAYER_REMOVE_NOCLIP
}

enum Datas
{
    
m_szName[32],
    
m_iCost
}

new const 
g_mItems[][Datas] = 
{
    {
"No Clip         \r30 Seconds"4000},
    {
"Godmode         \r20 Seconds"3500},
    {
"Invisibility    \r40 Seconds"6000},
    {
"500 Health and Armor  \r1 Round"5000},
    {
"Speed and Gravity     \r1 Round"3000}
};

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("say /lm""shop");
    
register_clcmd("say /shop""shop");
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
        
    
    
CreateMenu();

    
gmsgBlinkAcct get_user_msgid("BlinkAcct");
}

public 
Event_HLTV_New_Round()
{
    for(new 
id 1id<=g_iMaxPlayersid++)
    {
        
remove_taskid TASK_PLAYER_REMOVE_GODMODE );
        
remove_taskid TASK_PLAYER_REMOVE_INVIS );
        
remove_taskid TASK_PLAYER_REMOVE_NOCLIP );
        
Task_Remove_Noclipid );
        
Task_Remove_GodModeid );
        
Task_Remove_Invisid );
    }
}

CreateMenu()
{
    
g_iMenu menu_create"\wShop Menu \R\y$""ShopMenuHandler" );

    new 
szItem[64];
    for(new 
ii<sizeof(g_mItems); i++)
    {
        
formatex(szItemcharsmax(szItem), "%s\R\y%d"g_mItems[i][m_szName], g_mItems[i][m_iCost]);
        
menu_additem(g_iMenuszItem);
    }
}
public 
shop(id)
{
    if(
is_user_alive(id))
    {
        
menu_display(idg_iMenu);
    }
}

public 
ShopMenuHandler(idmenuitem )
{
    if(
item >=&& is_user_alive(id))
    {
        new 
newMoney cs_get_user_money(id) - g_mItems[item][m_iCost];
        if( 
newMoney <= )
        {
            
client_print(idprint_chat"Sorry ,You Don't have Enught Money");
            
            
message_begin(MSG_ONEgmsgBlinkAcct_id);
            {
                
write_byte(2);
            }
            
message_end();
            return;
        }
        
cs_set_user_money(idnewMoney);

        switch(
item)
        {
            case 
0:
            {
                
set_user_noclip(id1);
                
set_task(30.0"Task_Remove_Noclip"id TASK_PLAYER_REMOVE_NOCLIP);
                
client_print(idprint_chat"You Have Bought No Clip for 30 Seconds");
            }
            case 
1:
            {
                
set_user_godmode(id1);
                
set_task(20.0"Task_Remove_GodMode"id TASK_PLAYER_REMOVE_GODMODE);
                
client_print(idprint_chat"You Have Bought Godmode for 20 Seconds");
            }
            case 
2:
            {
                
set_user_rendering(idkRenderFxNone000kRenderTransAlpha);
                
set_task(40.0"Task_Remove_Invis"id TASK_PLAYER_REMOVE_INVIS);
                
client_print(idprint_chat"You Have Bought Invisibilty for 40 Seconds");
            }
            case 
3:
            {
                
set_user_health(id500);
                
cs_set_user_armor(id500CS_ARMOR_VESTHELM);
                
client_print(idprint_chat"You Have Buy 500 Armor + Health");
            }
            case 
4:
            {
                
set_user_maxspeed(id500.0);
                
set_user_gravity(id0.2);
                
client_print(idprint_chat"You Have Buy Speed and Gravity");
            }
        }
    }
}

public 
Task_Remove_Noclipid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_noclip(id0);
    }
}

public 
Task_Remove_GodModeid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_godmode(id0);
    }
}

public 
Task_Remove_Invisid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_rendering(id_000_0);
    }
}



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/ 
To this one:

PHP Code:
#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < amxmisc >
#include < hamsandwich >
#include < fun >
//#include < fcs >
//#include < CC_ColorChat >

#define PLUGIN "FCS Credits Shop"
#define VERSION "1.0.2"

/*
* Returns a players credits
*
* @param        client - The player index to get points of
*
* @return        The credits client
*
*/

native fcs_get_user_credits(client);

/*
* Sets <credits> to client
*
* @param        client - The player index to set points to
* @param        credits - The amount of credits to set to client
*
* @return        The credits of client
*
*/

native fcs_set_user_credits(clientcredits);

/*
* Adds <credits> points to client
*
* @param        client - The player index to add points to
* @param        credits - The amount of credits to set to client
*
* @return        The credits of client
*
*/

stock fcs_add_user_credits(clientcredits)
{
    return 
fcs_set_user_credits(clientfcs_get_user_credits(client) + credits);
}

/*
* Subtracts <credits>  from client
*
* @param        client - The player index to subtract points from
* @param        credits - The amount of credits to set to client
*
* @return        The credits of client
*
*/

stock fcs_sub_user_credits(clientcredits)
{
    return 
fcs_set_user_credits(clientfcs_get_user_credits(client) - credits);
}

enum Color {
    
NORMAL 1,         // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
    
GREEN,             // Culoare Verde.
    
TEAM_COLOR,         // Culoare Rosu, Albastru, Gri.
    
GREY,             // Culoarea Gri.
    
RED,             // Culoarea Rosu.
    
BLUE,             // Culoarea Albastru.
}

new 
TeamName[  ][  ] = {
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

new const 
g_szTag[ ] = "[ERAZER SHOP]";
new 
g_szMenuName[ ] = "\rERAZER\y SHOP";

enum _:iCvars {
    
ENABLE,
    
    
NADES_PRICE,
    
NADES_TO,
    
    
HP_PRICE,
    
HP_AMOUNT,
    
HP_TO,
    
    
AP_PRICE,
    
AP_AMOUNT,
    
AP_TO,
    
    
DEAGLE_PRICE,
    
DEAGLE_BACKPACK_AMMO,
    
DEAGLE_TO,
    
    
SPEED_PRICE,
    
SPEED_AMOUNT,
    
SPEED_DURATION,
    
SPEED_TO,
    
    
GRAVITY_PRICE,
    
GRAVITY_AMOUNT,
    
GRAVITY_DURATION,
    
GRAVITY_TO
    
    
}

enum _:WhatUserHas {
    
SPEED,
    
GRAVITY,
}

new 
g_iCvariCvars ];
new 
bool:g_bUserHas33 ][ WhatUserHas ];

// Do not modify this.
new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame;

public 
plugin_init( )
{
    
register_pluginPLUGINVERSION"Askhanar" );
    
register_cvar"fcs_shop_version"VERSIONFCVAR_SERVER FCVAR_SPONLY );
    
    
g_iCvarENABLE ] = register_cvar"fcsshop_enable""1" );
    
    
g_iCvarNADES_PRICE ] = register_cvar"fcsshop_nades_price""25" );
    
g_iCvarNADES_TO ] = register_cvar"fcsshop_nades_team""1" );
    
    
g_iCvarHP_PRICE ] = register_cvar"fcsshop_hp_price""60" );
    
g_iCvarHP_AMOUNT ] = register_cvar"fcsshop_hp_amount""300" );
    
g_iCvarHP_TO ] = register_cvar"fcsshop_hp_team""3" );
    
    
g_iCvarAP_PRICE ] = register_cvar"fcsshop_ap_price""55" );
    
g_iCvarAP_AMOUNT ] = register_cvar"fcsshop_ap_amount""500" );
    
g_iCvarAP_TO ] = register_cvar"fcsshop_ap_team""3" );
    
    
g_iCvarDEAGLE_PRICE ] = register_cvar"fcsshop_deagle_price""80" );
    
g_iCvarDEAGLE_BACKPACK_AMMO ] = register_cvar"fcsshop_deagle_ammo""21" );
    
g_iCvarDEAGLE_TO ] = register_cvar"fcsshop_deagle_team""1" );
    
    
g_iCvarSPEED_PRICE ] = register_cvar"fcsshop_speed_price""75" );
    
g_iCvarSPEED_AMOUNT ] = register_cvar"fcsshop_speed_amount""500" );
    
g_iCvarSPEED_DURATION ] = register_cvar"fcsshop_speed_duration""1" );
    
g_iCvarSPEED_TO ] = register_cvar"fcsshop_speed_team""2" );
    
    
g_iCvarGRAVITY_PRICE ] = register_cvar"fcsshop_gravity_price""80" );
    
g_iCvarGRAVITY_AMOUNT ] = register_cvar"fcsshop_gravity_amount""300" );
    
g_iCvarGRAVITY_DURATION ] = register_cvar"fcsshop_gravity_duration""1" );
    
g_iCvarGRAVITY_TO ] = register_cvar"fcsshop_gravity_team""2" );
    
    
register_clcmd"say shop""ClCmdSayShop" );
    
register_clcmd"say_team shop""ClCmdSayShop" );
    
register_clcmd"say /shop""ClCmdSayShop" );
    
register_clcmd"say_team /shop""ClCmdSayShop" );
    
    
RegisterHamHam_Spawn"player""ham_PlayerSpawnPre"true );
    
RegisterHamHam_Killed"player""ham_PlayerKilledPre",true );
    
RegisterHamHam_Player_ResetMaxSpeed"player""ham_PlayerResetMaxSpeedPre"true );
    
    
// Add your code here...
}

public 
client_putinserverid )
{
    if( 
is_user_botid ) || is_user_hltvid ) )
        return;
    
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
    
}

public 
client_disconnectid )
{
    if( 
is_user_botid ) || is_user_hltvid ) )
        return;
    
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
    
}

public 
ClCmdSayShopid )
{
    
    
    if( 
get_pcvar_numg_iCvarENABLE ] ) == )
    {
        
ColorChatidRED"^x04%s^x03 Comanda dezactivata de catre server!"g_szTag );
        return 
PLUGIN_HANDLED;
    }
    
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if( !
has_flagid"y" ) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
ShopMenuid );
    return 
PLUGIN_HANDLED;
    
}

public 
ShopMenuid )
{
    new 
szMenuName64 ];
    
formatexszMenuNamesizeof szMenuName ) -1"%s^n\yCredite: \r%i"g_szMenuNamefcs_get_user_creditsid ) );
    new 
iMenu menu_createszMenuName"ShopMenuHandler" );
    new 
iCallBack  =  menu_makecallback"CallBackShop" );
    
    new 
szBuffer][ 64 ], szBufferKey], iBufferKey 1;
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \yFULL\r ] \wGrenades\y       [\r %i Credite\y ]"get_pcvar_numg_iCvarNADES_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wHP\y                [\r %i Credite\y ]"get_pcvar_numg_iCvarHP_AMOUNT ] ), get_pcvar_numg_iCvarHP_PRICE ] ) )
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wAP\y                  [\r %i Credite\y ]"get_pcvar_numg_iCvarAP_AMOUNT ] ), get_pcvar_numg_iCvarAP_PRICE ] ) )
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i AMMO\r ] \wDeagle\y    [\r %i Credite\y ]"get_pcvar_numg_iCvarDEAGLE_BACKPACK_AMMO ] ), get_pcvar_numg_iCvarDEAGLE_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%.1f\r ] \wSpeed\y          [\r %i Credite\y ]"floatget_pcvar_numg_iCvarSPEED_AMOUNT ] ) ), get_pcvar_numg_iCvarSPEED_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wGravity\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarGRAVITY_AMOUNT ] ), get_pcvar_numg_iCvarGRAVITY_PRICE ] ) );
    
    for( new 
06i++ )
    {
        
formatexszBufferKeysizeof szBufferKey ) -1"%i"iBufferKey );
        
menu_additemiMenuszBuffer], szBufferKey_iCallBack );
        
        
iBufferKey++;
    }
    
    
menu_setpropiMenuMPROP_EXITNAME"\wIesire" );
    
    
menu_displayidiMenu);
    
}

/*=======================================================================================s=P=u=f=?*/

public ShopMenuHandleridiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {
        
menu_destroyiMenu );
        return 
1PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ];
    new 
iaccesscallback;
    
    
menu_item_getinfoiMenuiItemiaccessdata5iName63callback );
    
    new 
key str_to_numdata );
    
//new page = floatround( str_to_float( data ) / 7.0001, floatround_floor );
    
    
menu_destroyiMenu );
    switch( 
key )
    {
        case 
1:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarNADES_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            if( 
bUserHasAnyNadeid ) )
            {
                
ColorChatidRED"^x04%s^x03 Ai cel putin o grenada in mana, nu poti cumpara altele!"g_szTag );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 FULL Grenades^x01 pentru^x03 %i credit^x01 !"g_szTagiNeededCredits );
            
            
give_itemid"weapon_hegrenade" );
            
give_itemid"weapon_flashbang" );
            
give_itemid"weapon_flashbang" );
            
give_itemid"weapon_smokegrenade" );
            
        }
        
        case 
2:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarHP_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iHP get_pcvar_numg_iCvarHP_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i HP^x01 pentru^x03 %i credite^x01 !"g_szTagiHPiNeededCredits );
            
            
set_user_healthidget_user_healthid ) + iHP );
            
        }
        
        case 
3:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarAP_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iAP get_pcvar_numg_iCvarAP_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i AP^x01 pentru^x03 %i credite^x01 !"g_szTagiAPiNeededCredits );
            
            
set_user_armoridget_user_armorid ) + iAP );
            
        }
        
        case 
4:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarDEAGLE_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iAMMO get_pcvar_numg_iCvarDEAGLE_BACKPACK_AMMO ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i AMMO Deagle^x01 pentru^x03 %i credite^x01 !"g_szTagiAMMOiNeededCredits );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLEiAMMO );
            
        }
        
        case 
5:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarSPEED_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iSpeed get_pcvar_numg_iCvarSPEED_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %.1f Speed^x01 pentru^x03 %i credite^x01 !"g_szTagfloatiSpeed ), iNeededCredits );
            
            
g_bUserHasid ][ SPEED ] = true;
            
engfuncEngFunc_SetClientMaxspeedidfloatiSpeed )  );
            
set_pevid,  pev_maxspeedfloatiSpeed ) );
            
            
/*    SlowHack o_O
            client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
            */
        
}
        
        case 
6:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarGRAVITY_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iGravity get_pcvar_numg_iCvarGRAVITY_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Gravity^x01 pentru^x03 %i credite^x01 !"g_szTagiGravityiNeededCredits );
            
            
set_user_gravityidfloatiGravity ) * 0.00125 );
            
g_bUserHasid ][ GRAVITY ] = true;
        }
        
    }
    
    return 
PLUGIN_CONTINUE;
    
}

public 
CallBackShopidiMenuiItem  )
{
    static 
_accessszInfo],  callback;
    
menu_item_getinfoiMenuiItem_accessszInfosizeof szInfo ) -1__callback );
    
    
//if( szInfo[ 0 ] == '0' )    return ITEM_ENABLED;
    
    
if( szInfo] == '1' )
    {
        if( 
get_pcvar_numg_iCvarNADES_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarNADES_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '2' )
    {
        if( 
get_pcvar_numg_iCvarHP_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarHP_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '3' )
    {
        if( 
get_pcvar_numg_iCvarAP_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarAP_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '4' )
    {
        if( 
get_pcvar_numg_iCvarDEAGLE_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarDEAGLE_TO] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '5' )
    {
        if( 
get_pcvar_numg_iCvarSPEED_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarSPEED_TO ] ) )
            return 
ITEM_ENABLED;
    }
    
    else if( 
szInfo] == '6' )
    {
        if( 
get_pcvar_numg_iCvarGRAVITY_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarGRAVITY_TO ] ) )
            return 
ITEM_ENABLED;
    }
    
    return 
ITEM_DISABLED;
}

public 
ham_PlayerSpawnPre(  id  )
{
    
    if( 
is_user_aliveid ) )
    {
        
        if( 
get_pcvar_numg_iCvarSPEED_DURATION ] ) == )
        {
            if( 
g_bUserHasid ][ SPEED ] )
            {
                new 
iSpeed get_pcvar_numg_iCvarSPEED_AMOUNT ] );
                
engfuncEngFunc_SetClientMaxspeedidfloatiSpeed )  );
                
set_pevid,  pev_maxspeedfloatiSpeed ) );
                
                
/*    SlowHack o_O
                client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
                */
            
}
        }
        else
            
g_bUserHasid ][ SPEED ] = false;
        
        if( 
get_pcvar_numg_iCvarGRAVITY_DURATION ] ) == )
        {
            if( 
g_bUserHasid ][ GRAVITY ] )
                
set_user_gravityidfloatget_pcvar_numg_iCvarGRAVITY_AMOUNT ] ) ) * 0.00125 );
        }
        else
            
g_bUserHasid ][ GRAVITY ] = false;
        
        
    }
}


/*======================================= -  Askhanar  - =======================================*/

public ham_PlayerKilledPre(  id  )
{
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
}

public 
ham_PlayerResetMaxSpeedPreid )
{
    
    if( 
is_user_aliveid )  /*&&  get_user_maxspeed(  id  )  !=  1.0*/  )
    {
        
        if( 
g_bUserHasid ][ SPEED ] )
        {
            
            static 
Float:flMaxSpeed;
            
flMaxSpeed floatget_pcvar_numg_iCvarSPEED_AMOUNT ] ) );
            
            
engfuncEngFunc_SetClientMaxspeedidflMaxSpeed  );
            
set_pevidpev_maxspeedflMaxSpeed  );
            
        }
        
        
        
/*    SlowHack o_O
        client_cmd(  id,  "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", flMaxSpeed, flMaxSpeed, flMaxSpeed );
        */
    
}
}

stock bool:bUserHasAnyNadeid )
{
    
    if( 
user_has_weaponidCSW_HEGRENADE ) || user_has_weaponidCSW_FLASHBANG )
    || 
user_has_weaponidCSW_SMOKEGRENADE ) )
    return 
true;
    
    return 
false;
    
}

stock fcs_get_user_teamid )
{
    new 
iTeam = -1;
    if( 
cs_get_user_teamid ) == CS_TEAM_T )    iTeam 1;
    else if( 
cs_get_user_teamid ) == CS_TEAM_CT )    iTeam 2;
        
    return 
iTeam;
}

ColorChat(  idColor:iType, const msg[  ], { FloatSqlResult_}:...  ){
    
    
// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
    
if( !get_playersnum( ) ) return;
    new 
szMessage256 ];
    
    switch( 
iType )
    {
        
// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
        
case NORMAL:    szMessage] = 0x01;
            
        
// Culoare Verde.
        
case GREEN:    szMessage] = 0x04;
            
        
// Alb, Rosu, Albastru.
        
default:     szMessage] = 0x03;
    }
    
    
vformat(  szMessage], 251msg4  );
    
    
// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
    
szMessage192 ] = '^0';
    
    
    new 
iTeamiColorChangeiPlayerIndexMSG_Type;
    
    if( 
id )
    {
        
MSG_Type  =  MSG_ONE_UNRELIABLE;
        
iPlayerIndex  =  id;
    }
    else
    {
        
iPlayerIndex  =  CC_FindPlayer(  );
        
MSG_Type MSG_ALL;
    }
    
    
iTeam  =  get_user_teamiPlayerIndex );
    
iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_TypeiType);
    
    
CC_ShowColorMessage(  iPlayerIndexMSG_TypeszMessage  );
    
    if(  
iColorChange  )    CC_Team_Info(  iPlayerIndexMSG_Type,  TeamNameiTeam ]  );
    
}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  ) {
    
    static 
bool:bSayTextUsed;
    static 
iMsgSayText;
    
    if(  !
bSayTextUsed  )
    {
        
iMsgSayText  =  get_user_msgid"SayText" );
        
bSayTextUsed  =  true;
    }
    
    
message_beginiTypeiMsgSayText_id  );
    
write_byte(  id  )
    
write_string(  szMessage  );
    
message_end(  );
}

CC_Team_Infoid, const iType, const szTeam[  ] ) {
    static 
bool:bTeamInfoUsed;
    static 
iMsgTeamInfo;
    if(  !
bTeamInfoUsed  )
    {
        
iMsgTeamInfo  =  get_user_msgid"TeamInfo" );
        
bTeamInfoUsed  =  true;
    }
    
    
message_beginiTypeiMsgTeamInfo_id  );
    
write_byte(  id  );
    
write_string(  szTeam  );
    
message_end(  );
    
    return 
1;
}

CC_ColorSelection(  id, const iTypeColor:iColorType) {
    switch(  
iColorType  )
    {
        
        case 
RED:    return CC_Team_Info(  idiTypeTeamName]  );
            case 
BLUE:    return CC_Team_Info(  idiTypeTeamName]  );
            case 
GREY:    return CC_Team_Info(  idiTypeTeamName]  );
            
    }
    
    return 
0;
}

CC_FindPlayer(  ) {
    new 
iMaxPlayers  =  get_maxplayers(  );
    
    for( new 
1<= iMaxPlayersi++ )
        if(  
is_user_connected)  )
        return 
i;
    
    return -
1;


Last edited by AlexandruODT; 06-04-2020 at 02:56.
AlexandruODT is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 05-31-2020 , 22:09   Re: Add items
Reply With Quote #2

Quote:
Originally Posted by AlexandruODT View Post
Can anyone help me add this menu item to this plugin?

This menu (items) :


PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>


#define PLUGIN "Shop"
#define VERSION "1.1"
#define AUTHOR "Darksmith"

#pragma semicolon 1

new g_iMenugmsgBlinkAcctg_iMaxPlayers;

enum _:playerTasks ( += 33 )
{
    
TASK_PLAYER_REMOVE_GODMODE,
    
TASK_PLAYER_REMOVE_INVIS,
    
TASK_PLAYER_REMOVE_NOCLIP
}

enum Datas
{
    
m_szName[32],
    
m_iCost
}

new const 
g_mItems[][Datas] = 
{
    {
"No Clip         \r30 Seconds"4000},
    {
"Godmode         \r20 Seconds"3500},
    {
"Invisibility    \r40 Seconds"6000},
    {
"500 Health and Armor  \r1 Round"5000},
    {
"Speed and Gravity     \r1 Round"3000}
};

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("say /lm""shop");
    
register_clcmd("say /shop""shop");
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
        
    
    
CreateMenu();

    
gmsgBlinkAcct get_user_msgid("BlinkAcct");
}

public 
Event_HLTV_New_Round()
{
    for(new 
id 1id<=g_iMaxPlayersid++)
    {
        
remove_taskid TASK_PLAYER_REMOVE_GODMODE );
        
remove_taskid TASK_PLAYER_REMOVE_INVIS );
        
remove_taskid TASK_PLAYER_REMOVE_NOCLIP );
        
Task_Remove_Noclipid );
        
Task_Remove_GodModeid );
        
Task_Remove_Invisid );
    }
}

CreateMenu()
{
    
g_iMenu menu_create"\wShop Menu \R\y$""ShopMenuHandler" );

    new 
szItem[64];
    for(new 
ii<sizeof(g_mItems); i++)
    {
        
formatex(szItemcharsmax(szItem), "%s\R\y%d"g_mItems[i][m_szName], g_mItems[i][m_iCost]);
        
menu_additem(g_iMenuszItem);
    }
}
public 
shop(id)
{
    if(
is_user_alive(id))
    {
        
menu_display(idg_iMenu);
    }
}

public 
ShopMenuHandler(idmenuitem )
{
    if(
item >=&& is_user_alive(id))
    {
        new 
newMoney cs_get_user_money(id) - g_mItems[item][m_iCost];
        if( 
newMoney <= )
        {
            
client_print(idprint_chat"Sorry ,You Don't have Enught Money");
            
            
message_begin(MSG_ONEgmsgBlinkAcct_id);
            {
                
write_byte(2);
            }
            
message_end();
            return;
        }
        
cs_set_user_money(idnewMoney);

        switch(
item)
        {
            case 
0:
            {
                
set_user_noclip(id1);
                
set_task(30.0"Task_Remove_Noclip"id TASK_PLAYER_REMOVE_NOCLIP);
                
client_print(idprint_chat"You Have Bought No Clip for 30 Seconds");
            }
            case 
1:
            {
                
set_user_godmode(id1);
                
set_task(20.0"Task_Remove_GodMode"id TASK_PLAYER_REMOVE_GODMODE);
                
client_print(idprint_chat"You Have Bought Godmode for 20 Seconds");
            }
            case 
2:
            {
                
set_user_rendering(idkRenderFxNone000kRenderTransAlpha);
                
set_task(40.0"Task_Remove_Invis"id TASK_PLAYER_REMOVE_INVIS);
                
client_print(idprint_chat"You Have Bought Invisibilty for 40 Seconds");
            }
            case 
3:
            {
                
set_user_health(id500);
                
cs_set_user_armor(id500CS_ARMOR_VESTHELM);
                
client_print(idprint_chat"You Have Buy 500 Armor + Health");
            }
            case 
4:
            {
                
set_user_maxspeed(id500.0);
                
set_user_gravity(id0.2);
                
client_print(idprint_chat"You Have Buy Speed and Gravity");
            }
        }
    }
}

public 
Task_Remove_Noclipid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_noclip(id0);
    }
}

public 
Task_Remove_GodModeid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_godmode(id0);
    }
}

public 
Task_Remove_Invisid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_rendering(id_000_0);
    }
}



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/ 
To this one:

PHP Code:
#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < amxmisc >
#include < hamsandwich >
#include < fun >
//#include < fcs >
//#include < CC_ColorChat >

#define PLUGIN "FCS Credits Shop"
#define VERSION "1.0.2"

/*
* Returns a players credits
*
* @param        client - The player index to get points of
*
* @return        The credits client
*
*/

native fcs_get_user_credits(client);

/*
* Sets <credits> to client
*
* @param        client - The player index to set points to
* @param        credits - The amount of credits to set to client
*
* @return        The credits of client
*
*/

native fcs_set_user_credits(clientcredits);

/*
* Adds <credits> points to client
*
* @param        client - The player index to add points to
* @param        credits - The amount of credits to set to client
*
* @return        The credits of client
*
*/

stock fcs_add_user_credits(clientcredits)
{
    return 
fcs_set_user_credits(clientfcs_get_user_credits(client) + credits);
}

/*
* Subtracts <credits>  from client
*
* @param        client - The player index to subtract points from
* @param        credits - The amount of credits to set to client
*
* @return        The credits of client
*
*/

stock fcs_sub_user_credits(clientcredits)
{
    return 
fcs_set_user_credits(clientfcs_get_user_credits(client) - credits);
}

enum Color {
    
NORMAL 1,         // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
    
GREEN,             // Culoare Verde.
    
TEAM_COLOR,         // Culoare Rosu, Albastru, Gri.
    
GREY,             // Culoarea Gri.
    
RED,             // Culoarea Rosu.
    
BLUE,             // Culoarea Albastru.
}

new 
TeamName[  ][  ] = {
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

new const 
g_szTag[ ] = "[ERAZER SHOP]";
new 
g_szMenuName[ ] = "\rERAZER\y SHOP";

enum _:iCvars {
    
ENABLE,
    
    
NADES_PRICE,
    
NADES_TO,
    
    
HP_PRICE,
    
HP_AMOUNT,
    
HP_TO,
    
    
AP_PRICE,
    
AP_AMOUNT,
    
AP_TO,
    
    
DEAGLE_PRICE,
    
DEAGLE_BACKPACK_AMMO,
    
DEAGLE_TO,
    
    
SPEED_PRICE,
    
SPEED_AMOUNT,
    
SPEED_DURATION,
    
SPEED_TO,
    
    
GRAVITY_PRICE,
    
GRAVITY_AMOUNT,
    
GRAVITY_DURATION,
    
GRAVITY_TO
    
    
}

enum _:WhatUserHas {
    
SPEED,
    
GRAVITY,
}

new 
g_iCvariCvars ];
new 
bool:g_bUserHas33 ][ WhatUserHas ];

// Do not modify this.
new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame;

public 
plugin_init( )
{
    
register_pluginPLUGINVERSION"Askhanar" );
    
register_cvar"fcs_shop_version"VERSIONFCVAR_SERVER FCVAR_SPONLY );
    
    
g_iCvarENABLE ] = register_cvar"fcsshop_enable""1" );
    
    
g_iCvarNADES_PRICE ] = register_cvar"fcsshop_nades_price""25" );
    
g_iCvarNADES_TO ] = register_cvar"fcsshop_nades_team""1" );
    
    
g_iCvarHP_PRICE ] = register_cvar"fcsshop_hp_price""60" );
    
g_iCvarHP_AMOUNT ] = register_cvar"fcsshop_hp_amount""300" );
    
g_iCvarHP_TO ] = register_cvar"fcsshop_hp_team""3" );
    
    
g_iCvarAP_PRICE ] = register_cvar"fcsshop_ap_price""55" );
    
g_iCvarAP_AMOUNT ] = register_cvar"fcsshop_ap_amount""500" );
    
g_iCvarAP_TO ] = register_cvar"fcsshop_ap_team""3" );
    
    
g_iCvarDEAGLE_PRICE ] = register_cvar"fcsshop_deagle_price""80" );
    
g_iCvarDEAGLE_BACKPACK_AMMO ] = register_cvar"fcsshop_deagle_ammo""21" );
    
g_iCvarDEAGLE_TO ] = register_cvar"fcsshop_deagle_team""1" );
    
    
g_iCvarSPEED_PRICE ] = register_cvar"fcsshop_speed_price""75" );
    
g_iCvarSPEED_AMOUNT ] = register_cvar"fcsshop_speed_amount""500" );
    
g_iCvarSPEED_DURATION ] = register_cvar"fcsshop_speed_duration""1" );
    
g_iCvarSPEED_TO ] = register_cvar"fcsshop_speed_team""2" );
    
    
g_iCvarGRAVITY_PRICE ] = register_cvar"fcsshop_gravity_price""80" );
    
g_iCvarGRAVITY_AMOUNT ] = register_cvar"fcsshop_gravity_amount""300" );
    
g_iCvarGRAVITY_DURATION ] = register_cvar"fcsshop_gravity_duration""1" );
    
g_iCvarGRAVITY_TO ] = register_cvar"fcsshop_gravity_team""2" );
    
    
register_clcmd"say shop""ClCmdSayShop" );
    
register_clcmd"say_team shop""ClCmdSayShop" );
    
register_clcmd"say /shop""ClCmdSayShop" );
    
register_clcmd"say_team /shop""ClCmdSayShop" );
    
    
RegisterHamHam_Spawn"player""ham_PlayerSpawnPre"true );
    
RegisterHamHam_Killed"player""ham_PlayerKilledPre",true );
    
RegisterHamHam_Player_ResetMaxSpeed"player""ham_PlayerResetMaxSpeedPre"true );
    
    
// Add your code here...
}

public 
client_putinserverid )
{
    if( 
is_user_botid ) || is_user_hltvid ) )
        return;
    
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
    
}

public 
client_disconnectid )
{
    if( 
is_user_botid ) || is_user_hltvid ) )
        return;
    
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
    
}

public 
ClCmdSayShopid )
{
    
    
    if( 
get_pcvar_numg_iCvarENABLE ] ) == )
    {
        
ColorChatidRED"^x04%s^x03 Comanda dezactivata de catre server!"g_szTag );
        return 
PLUGIN_HANDLED;
    }
    
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if( !
has_flagid"y" ) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
ShopMenuid );
    return 
PLUGIN_HANDLED;
    
}

public 
ShopMenuid )
{
    new 
szMenuName64 ];
    
formatexszMenuNamesizeof szMenuName ) -1"%s^n\yCredite: \r%i"g_szMenuNamefcs_get_user_creditsid ) );
    new 
iMenu menu_createszMenuName"ShopMenuHandler" );
    new 
iCallBack  =  menu_makecallback"CallBackShop" );
    
    new 
szBuffer][ 64 ], szBufferKey], iBufferKey 1;
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \yFULL\r ] \wGrenades\y       [\r %i Credite\y ]"get_pcvar_numg_iCvarNADES_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wHP\y                [\r %i Credite\y ]"get_pcvar_numg_iCvarHP_AMOUNT ] ), get_pcvar_numg_iCvarHP_PRICE ] ) )
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wAP\y                  [\r %i Credite\y ]"get_pcvar_numg_iCvarAP_AMOUNT ] ), get_pcvar_numg_iCvarAP_PRICE ] ) )
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i AMMO\r ] \wDeagle\y    [\r %i Credite\y ]"get_pcvar_numg_iCvarDEAGLE_BACKPACK_AMMO ] ), get_pcvar_numg_iCvarDEAGLE_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%.1f\r ] \wSpeed\y          [\r %i Credite\y ]"floatget_pcvar_numg_iCvarSPEED_AMOUNT ] ) ), get_pcvar_numg_iCvarSPEED_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wGravity\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarGRAVITY_AMOUNT ] ), get_pcvar_numg_iCvarGRAVITY_PRICE ] ) );
    
    for( new 
06i++ )
    {
        
formatexszBufferKeysizeof szBufferKey ) -1"%i"iBufferKey );
        
menu_additemiMenuszBuffer], szBufferKey_iCallBack );
        
        
iBufferKey++;
    }
    
    
menu_setpropiMenuMPROP_EXITNAME"\wIesire" );
    
    
menu_displayidiMenu);
    
}

/*=======================================================================================s=P=u=f=?*/

public ShopMenuHandleridiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {
        
menu_destroyiMenu );
        return 
1PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ];
    new 
iaccesscallback;
    
    
menu_item_getinfoiMenuiItemiaccessdata5iName63callback );
    
    new 
key str_to_numdata );
    
//new page = floatround( str_to_float( data ) / 7.0001, floatround_floor );
    
    
menu_destroyiMenu );
    switch( 
key )
    {
        case 
1:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarNADES_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            if( 
bUserHasAnyNadeid ) )
            {
                
ColorChatidRED"^x04%s^x03 Ai cel putin o grenada in mana, nu poti cumpara altele!"g_szTag );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 FULL Grenades^x01 pentru^x03 %i credit^x01 !"g_szTagiNeededCredits );
            
            
give_itemid"weapon_hegrenade" );
            
give_itemid"weapon_flashbang" );
            
give_itemid"weapon_flashbang" );
            
give_itemid"weapon_smokegrenade" );
            
        }
        
        case 
2:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarHP_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iHP get_pcvar_numg_iCvarHP_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i HP^x01 pentru^x03 %i credite^x01 !"g_szTagiHPiNeededCredits );
            
            
set_user_healthidget_user_healthid ) + iHP );
            
        }
        
        case 
3:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarAP_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iAP get_pcvar_numg_iCvarAP_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i AP^x01 pentru^x03 %i credite^x01 !"g_szTagiAPiNeededCredits );
            
            
set_user_armoridget_user_armorid ) + iAP );
            
        }
        
        case 
4:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarDEAGLE_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iAMMO get_pcvar_numg_iCvarDEAGLE_BACKPACK_AMMO ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i AMMO Deagle^x01 pentru^x03 %i credite^x01 !"g_szTagiAMMOiNeededCredits );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLEiAMMO );
            
        }
        
        case 
5:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarSPEED_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iSpeed get_pcvar_numg_iCvarSPEED_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %.1f Speed^x01 pentru^x03 %i credite^x01 !"g_szTagfloatiSpeed ), iNeededCredits );
            
            
g_bUserHasid ][ SPEED ] = true;
            
engfuncEngFunc_SetClientMaxspeedidfloatiSpeed )  );
            
set_pevid,  pev_maxspeedfloatiSpeed ) );
            
            
/*    SlowHack o_O
            client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
            */
        
}
        
        case 
6:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarGRAVITY_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iGravity get_pcvar_numg_iCvarGRAVITY_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Gravity^x01 pentru^x03 %i credite^x01 !"g_szTagiGravityiNeededCredits );
            
            
set_user_gravityidfloatiGravity ) * 0.00125 );
            
g_bUserHasid ][ GRAVITY ] = true;
        }
        
    }
    
    return 
PLUGIN_CONTINUE;
    
}

public 
CallBackShopidiMenuiItem  )
{
    static 
_accessszInfo],  callback;
    
menu_item_getinfoiMenuiItem_accessszInfosizeof szInfo ) -1__callback );
    
    
//if( szInfo[ 0 ] == '0' )    return ITEM_ENABLED;
    
    
if( szInfo] == '1' )
    {
        if( 
get_pcvar_numg_iCvarNADES_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarNADES_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '2' )
    {
        if( 
get_pcvar_numg_iCvarHP_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarHP_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '3' )
    {
        if( 
get_pcvar_numg_iCvarAP_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarAP_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '4' )
    {
        if( 
get_pcvar_numg_iCvarDEAGLE_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarDEAGLE_TO] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '5' )
    {
        if( 
get_pcvar_numg_iCvarSPEED_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarSPEED_TO ] ) )
            return 
ITEM_ENABLED;
    }
    
    else if( 
szInfo] == '6' )
    {
        if( 
get_pcvar_numg_iCvarGRAVITY_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarGRAVITY_TO ] ) )
            return 
ITEM_ENABLED;
    }
    
    return 
ITEM_DISABLED;
}

public 
ham_PlayerSpawnPre(  id  )
{
    
    if( 
is_user_aliveid ) )
    {
        
        if( 
get_pcvar_numg_iCvarSPEED_DURATION ] ) == )
        {
            if( 
g_bUserHasid ][ SPEED ] )
            {
                new 
iSpeed get_pcvar_numg_iCvarSPEED_AMOUNT ] );
                
engfuncEngFunc_SetClientMaxspeedidfloatiSpeed )  );
                
set_pevid,  pev_maxspeedfloatiSpeed ) );
                
                
/*    SlowHack o_O
                client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
                */
            
}
        }
        else
            
g_bUserHasid ][ SPEED ] = false;
        
        if( 
get_pcvar_numg_iCvarGRAVITY_DURATION ] ) == )
        {
            if( 
g_bUserHasid ][ GRAVITY ] )
                
set_user_gravityidfloatget_pcvar_numg_iCvarGRAVITY_AMOUNT ] ) ) * 0.00125 );
        }
        else
            
g_bUserHasid ][ GRAVITY ] = false;
        
        
    }
}


/*======================================= -  Askhanar  - =======================================*/

public ham_PlayerKilledPre(  id  )
{
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
}

public 
ham_PlayerResetMaxSpeedPreid )
{
    
    if( 
is_user_aliveid )  /*&&  get_user_maxspeed(  id  )  !=  1.0*/  )
    {
        
        if( 
g_bUserHasid ][ SPEED ] )
        {
            
            static 
Float:flMaxSpeed;
            
flMaxSpeed floatget_pcvar_numg_iCvarSPEED_AMOUNT ] ) );
            
            
engfuncEngFunc_SetClientMaxspeedidflMaxSpeed  );
            
set_pevidpev_maxspeedflMaxSpeed  );
            
        }
        
        
        
/*    SlowHack o_O
        client_cmd(  id,  "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", flMaxSpeed, flMaxSpeed, flMaxSpeed );
        */
    
}
}

stock bool:bUserHasAnyNadeid )
{
    
    if( 
user_has_weaponidCSW_HEGRENADE ) || user_has_weaponidCSW_FLASHBANG )
    || 
user_has_weaponidCSW_SMOKEGRENADE ) )
    return 
true;
    
    return 
false;
    
}

stock fcs_get_user_teamid )
{
    new 
iTeam = -1;
    if( 
cs_get_user_teamid ) == CS_TEAM_T )    iTeam 1;
    else if( 
cs_get_user_teamid ) == CS_TEAM_CT )    iTeam 2;
        
    return 
iTeam;
}

ColorChat(  idColor:iType, const msg[  ], { FloatSqlResult_}:...  ){
    
    
// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
    
if( !get_playersnum( ) ) return;
    new 
szMessage256 ];
    
    switch( 
iType )
    {
        
// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
        
case NORMAL:    szMessage] = 0x01;
            
        
// Culoare Verde.
        
case GREEN:    szMessage] = 0x04;
            
        
// Alb, Rosu, Albastru.
        
default:     szMessage] = 0x03;
    }
    
    
vformat(  szMessage], 251msg4  );
    
    
// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
    
szMessage192 ] = '^0';
    
    
    new 
iTeamiColorChangeiPlayerIndexMSG_Type;
    
    if( 
id )
    {
        
MSG_Type  =  MSG_ONE_UNRELIABLE;
        
iPlayerIndex  =  id;
    }
    else
    {
        
iPlayerIndex  =  CC_FindPlayer(  );
        
MSG_Type MSG_ALL;
    }
    
    
iTeam  =  get_user_teamiPlayerIndex );
    
iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_TypeiType);
    
    
CC_ShowColorMessage(  iPlayerIndexMSG_TypeszMessage  );
    
    if(  
iColorChange  )    CC_Team_Info(  iPlayerIndexMSG_Type,  TeamNameiTeam ]  );
    
}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  ) {
    
    static 
bool:bSayTextUsed;
    static 
iMsgSayText;
    
    if(  !
bSayTextUsed  )
    {
        
iMsgSayText  =  get_user_msgid"SayText" );
        
bSayTextUsed  =  true;
    }
    
    
message_beginiTypeiMsgSayText_id  );
    
write_byte(  id  )
    
write_string(  szMessage  );
    
message_end(  );
}

CC_Team_Infoid, const iType, const szTeam[  ] ) {
    static 
bool:bTeamInfoUsed;
    static 
iMsgTeamInfo;
    if(  !
bTeamInfoUsed  )
    {
        
iMsgTeamInfo  =  get_user_msgid"TeamInfo" );
        
bTeamInfoUsed  =  true;
    }
    
    
message_beginiTypeiMsgTeamInfo_id  );
    
write_byte(  id  );
    
write_string(  szTeam  );
    
message_end(  );
    
    return 
1;
}

CC_ColorSelection(  id, const iTypeColor:iColorType) {
    switch(  
iColorType  )
    {
        
        case 
RED:    return CC_Team_Info(  idiTypeTeamName]  );
            case 
BLUE:    return CC_Team_Info(  idiTypeTeamName]  );
            case 
GREY:    return CC_Team_Info(  idiTypeTeamName]  );
            
    }
    
    return 
0;
}

CC_FindPlayer(  ) {
    new 
iMaxPlayers  =  get_maxplayers(  );
    
    for( new 
1<= iMaxPlayersi++ )
        if(  
is_user_connected)  )
        return 
i;
    
    return -
1;

I combined them but i added only NoClip, God Mode, Invisible because i saw health and speed and gravity are already added and i made include file for credit system to be better.
Ps: I didn't tested it yet.
Attached Files
File Type: sma Get Plugin or Get Source (CreditShop.sma - 10 views - 23.6 KB)
File Type: inc Credits.inc (1.1 KB, 4 views)

Last edited by Supremache; 05-31-2020 at 22:12.
Supremache is offline
AlexandruODT
Member
Join Date: May 2020
Old 06-01-2020 , 02:54   Re: Add items
Reply With Quote #3

The plugin is running but does not display all items...

I buy invisibility and it gave me gravity


Last edited by AlexandruODT; 06-01-2020 at 03:17.
AlexandruODT is offline
alferd
Senior Member
Join Date: Dec 2019
Old 06-01-2020 , 03:27   Re: Add items
Reply With Quote #4

Test
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < amxmisc >
#include < engine >
#include < fun >
#include < fakemeta >
#include < hamsandwich >
#include < Credits >
//#include < fcs >
//#include < CC_ColorChat >

#define PLUGIN "FCS Credits Shop"
#define VERSION "1.0.3"

enum Color {
    
NORMAL 1,         // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
    
GREEN,             // Culoare Verde.
    
TEAM_COLOR,         // Culoare Rosu, Albastru, Gri.
    
GREY,             // Culoarea Gri.
    
RED,             // Culoarea Rosu.
    
BLUE,             // Culoarea Albastru.
}

new 
TeamName[  ][  ] = {
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

new const 
g_szTag[ ] = "[ERAZER SHOP]";
new 
g_szMenuName[ ] = "\rERAZER\y SHOP";

enum _:iCvars {
    
ENABLE,
    
    
NADES_PRICE,
    
NADES_TO,
    
    
HP_PRICE,
    
HP_AMOUNT,
    
HP_TO,
    
    
AP_PRICE,
    
AP_AMOUNT,
    
AP_TO,
    
    
DEAGLE_PRICE,
    
DEAGLE_BACKPACK_AMMO,
    
DEAGLE_TO,
    
    
SPEED_PRICE,
    
SPEED_AMOUNT,
    
SPEED_DURATION,
    
SPEED_TO,
    
    
GRAVITY_PRICE,
    
GRAVITY_AMOUNT,
    
GRAVITY_DURATION,
    
GRAVITY_TO,
    
    
NoClip,
    
Godmode,
    
Invisibility
    
}

enum _:WhatUserHas {
    
SPEED,
    
GRAVITY,
}

enum _:playerTasks ( += 33 )
{
    
TASK_PLAYER_REMOVE_GODMODE,
    
TASK_PLAYER_REMOVE_INVIS,
    
TASK_PLAYER_REMOVE_NOCLIP
}


new 
g_iMaxPlayers;
new 
g_iCvariCvars ];
new 
bool:g_bUserHas33 ][ WhatUserHas ];

// Do not modify this.
new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame;

public 
plugin_init( )
{
    
register_pluginPLUGINVERSION"MrAbdoO") ;
    
register_cvar"fcs_shop_version"VERSIONFCVAR_SERVER FCVAR_SPONLY );
    
    
g_iCvarENABLE ] = register_cvar"fcsshop_enable""1" );
    
    
g_iCvarNADES_PRICE ] = register_cvar"fcsshop_nades_price""25" );
    
g_iCvarNADES_TO ] = register_cvar"fcsshop_nades_team""1" );
    
    
g_iCvarHP_PRICE ] = register_cvar"fcsshop_hp_price""60" );
    
g_iCvarHP_AMOUNT ] = register_cvar"fcsshop_hp_amount""300" );
    
g_iCvarHP_TO ] = register_cvar"fcsshop_hp_team""3" );
    
    
g_iCvarAP_PRICE ] = register_cvar"fcsshop_ap_price""55" );
    
g_iCvarAP_AMOUNT ] = register_cvar"fcsshop_ap_amount""500" );
    
g_iCvarAP_TO ] = register_cvar"fcsshop_ap_team""3" );
    
    
g_iCvarDEAGLE_PRICE ] = register_cvar"fcsshop_deagle_price""80" );
    
g_iCvarDEAGLE_BACKPACK_AMMO ] = register_cvar"fcsshop_deagle_ammo""21" );
    
g_iCvarDEAGLE_TO ] = register_cvar"fcsshop_deagle_team""1" );
    
    
g_iCvarSPEED_PRICE ] = register_cvar"fcsshop_speed_price""75" );
    
g_iCvarSPEED_AMOUNT ] = register_cvar"fcsshop_speed_amount""500" );
    
g_iCvarSPEED_DURATION ] = register_cvar"fcsshop_speed_duration""1" );
    
g_iCvarSPEED_TO ] = register_cvar"fcsshop_speed_team""2" );
    
    
g_iCvarGRAVITY_PRICE ] = register_cvar"fcsshop_gravity_price""80" );
    
g_iCvarGRAVITY_AMOUNT ] = register_cvar"fcsshop_gravity_amount""300" );
    
g_iCvarGRAVITY_DURATION ] = register_cvar"fcsshop_gravity_duration""1" );
    
g_iCvarGRAVITY_TO ] = register_cvar"fcsshop_gravity_team""2" );
    
    
g_iCvarNoClip ] = register_cvar"fcsshop_noclip_team""20" );
    
g_iCvarGodmode ] = register_cvar"fcsshop_godmode_team""30" );
    
g_iCvarInvisibility ] = register_cvar"fcsshop_invisibility_team""40" );
    
    
register_clcmd"say shop""ClCmdSayShop" );
    
register_clcmd"say_team shop""ClCmdSayShop" );
    
register_clcmd"say /shop""ClCmdSayShop" );
    
register_clcmd"say_team /shop""ClCmdSayShop" );
    
    
RegisterHamHam_Spawn"player""ham_PlayerSpawnPre"true );
    
RegisterHamHam_Killed"player""ham_PlayerKilledPre",true );
    
RegisterHamHam_Player_ResetMaxSpeed"player""ham_PlayerResetMaxSpeedPre"true );
    
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");

    
// Add your code here...
}

public 
Event_HLTV_New_Round()
{
    for(new 
id 1id<=g_iMaxPlayersid++)
    {
        
remove_taskid TASK_PLAYER_REMOVE_GODMODE );
        
remove_taskid TASK_PLAYER_REMOVE_INVIS );
        
remove_taskid TASK_PLAYER_REMOVE_NOCLIP );
        
Task_Remove_Noclipid );
        
Task_Remove_GodModeid );
        
Task_Remove_Invisid );
    }
}
public 
client_putinserverid )
{
    if( 
is_user_botid ) || is_user_hltvid ) )
        return;
    
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
    
}

public 
client_disconnectid )
{
    if( 
is_user_botid ) || is_user_hltvid ) )
        return;
    
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
    
}

public 
ClCmdSayShopid )
{
    
    
    if( 
get_pcvar_numg_iCvarENABLE ] ) == )
    {
        
ColorChatidRED"^x04%s^x03 Comanda dezactivata de catre server!"g_szTag );
        return 
PLUGIN_HANDLED;
    }
    
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if( !
has_flagid"y" ) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
ShopMenuid );
    return 
PLUGIN_HANDLED;
    
}

public 
ShopMenuid )
{
    new 
szMenuName64 ];
    
formatexszMenuNamesizeof szMenuName ) -1"%s^n\yCredite: \r%i"g_szMenuNamefcs_get_user_creditsid ) );
    new 
iMenu menu_createszMenuName"ShopMenuHandler" );
    new 
iCallBack  =  menu_makecallback"CallBackShop" );
    
    new 
szBuffer][ 512 ], szBufferKey], iBufferKey 1;
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \yFULL\r ] \wGrenades\y       [\r %i Credite\y ]"get_pcvar_numg_iCvarNADES_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wHP\y                [\r %i Credite\y ]"get_pcvar_numg_iCvarHP_AMOUNT ] ), get_pcvar_numg_iCvarHP_PRICE ] ) )
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wAP\y                  [\r %i Credite\y ]"get_pcvar_numg_iCvarAP_AMOUNT ] ), get_pcvar_numg_iCvarAP_PRICE ] ) )
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i AMMO\r ] \wDeagle\y    [\r %i Credite\y ]"get_pcvar_numg_iCvarDEAGLE_BACKPACK_AMMO ] ), get_pcvar_numg_iCvarDEAGLE_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%.1f\r ] \wSpeed\y          [\r %i Credite\y ]"floatget_pcvar_numg_iCvarSPEED_AMOUNT ] ) ), get_pcvar_numg_iCvarSPEED_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wGravity\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarGRAVITY_AMOUNT ] ), get_pcvar_numg_iCvarGRAVITY_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y30 Seconds\r ] \wNoClip\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarNoClip ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y20 Seconds\r ] \wGodmode\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarGodmode ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y40 Seconds\r ] \wInvisibility\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarInvisibility ] ) );

    
    for( new 
06i++ )
    {
        
formatexszBufferKeysizeof szBufferKey ) -1"%i"iBufferKey );
        
menu_additemiMenuszBuffer], szBufferKey_iCallBack );
        
        
iBufferKey++;
    }
    
    
menu_setpropiMenuMPROP_EXITNAME"\wIesire" );
    
    
menu_displayidiMenu);
    
}

/*=======================================================================================s=P=u=f=?*/

public ShopMenuHandleridiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {
        
menu_destroyiMenu );
        return 
1PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ];
    new 
iaccesscallback;
    
    
menu_item_getinfoiMenuiItemiaccessdata5iName63callback );
    
    new 
key str_to_numdata );
    
//new page = floatround( str_to_float( data ) / 7.0001, floatround_floor );
    
    
menu_destroyiMenu );
    switch( 
key )
    {
        case 
1:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarNADES_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            if( 
bUserHasAnyNadeid ) )
            {
                
ColorChatidRED"^x04%s^x03 Ai cel putin o grenada in mana, nu poti cumpara altele!"g_szTag );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 FULL Grenades^x01 pentru^x03 %i credit^x01 !"g_szTagiNeededCredits );
            
            
give_itemid"weapon_hegrenade" );
            
give_itemid"weapon_flashbang" );
            
give_itemid"weapon_flashbang" );
            
give_itemid"weapon_smokegrenade" );
            
        }
        
        case 
2:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarHP_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iHP get_pcvar_numg_iCvarHP_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i HP^x01 pentru^x03 %i credite^x01 !"g_szTagiHPiNeededCredits );
            
            
set_user_healthidget_user_healthid ) + iHP );
            
        }
        
        case 
3:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarAP_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iAP get_pcvar_numg_iCvarAP_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i AP^x01 pentru^x03 %i credite^x01 !"g_szTagiAPiNeededCredits );
            
            
set_user_armoridget_user_armorid ) + iAP );
            
        }
        
        case 
4:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarDEAGLE_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iAMMO get_pcvar_numg_iCvarDEAGLE_BACKPACK_AMMO ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i AMMO Deagle^x01 pentru^x03 %i credite^x01 !"g_szTagiAMMOiNeededCredits );
            
            
give_itemid"weapon_deagle" );
            
cs_set_user_bpammoidCSW_DEAGLEiAMMO );
            
        }
        
        case 
5:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarSPEED_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iSpeed get_pcvar_numg_iCvarSPEED_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %.1f Speed^x01 pentru^x03 %i credite^x01 !"g_szTagfloatiSpeed ), iNeededCredits );
            
            
g_bUserHasid ][ SPEED ] = true;
            
engfuncEngFunc_SetClientMaxspeedidfloatiSpeed )  );
            
set_pevid,  pev_maxspeedfloatiSpeed ) );
            
            
/*    SlowHack o_O
            client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
            */
        
}
        
        case 
6:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarGRAVITY_PRICE ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            
            new 
iGravity get_pcvar_numg_iCvarGRAVITY_AMOUNT ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Gravity^x01 pentru^x03 %i credite^x01 !"g_szTagiGravityiNeededCredits );
            
            
set_user_gravityidfloatiGravity ) * 0.00125 );
            
g_bUserHasid ][ GRAVITY ] = true;
        }
        case 
7:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarNoClip ] );
            
            if( 
iCredits iNeededCredits  )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
        new 
iNoClip get_pcvar_numg_iCvarNoClip ] );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Noclip^x01 pentru^x03 %i credite^x01 !"g_szTagiNoClipiNeededCredits );
        
            
set_user_noclip(id1);
            
set_task(30.0"Task_Remove_Noclip"id TASK_PLAYER_REMOVE_NOCLIP);
        }
        case 
8:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarGodmode ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
        
            new 
iGodmode get_pcvar_numg_iCvarGodmode ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Godmode^x01 pentru^x03 %i credite^x01 !"g_szTagiGodmodeiNeededCredits );
            
set_user_godmode(id1);
            
set_task(20.0"Task_Remove_GodMode"id TASK_PLAYER_REMOVE_GODMODE);
        }
        case 
9:
        {
            new 
iCreditsiNeededCredits;
            
iCredits fcs_get_user_creditsid );
            
iNeededCredits get_pcvar_numg_iCvarInvisibility ] );
            
            if( 
iCredits iNeededCredits )
            {
                
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
                return 
PLUGIN_HANDLED;
            }
            
            
fcs_sub_user_creditsidiNeededCredits );
            new 
iInvisibility get_pcvar_numg_iCvarInvisibility ] );
            
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Invisibility^x01 pentru^x03 %i credite^x01 !"g_szTagiInvisibilityiNeededCredits );
            
set_user_rendering(idkRenderFxNone000kRenderTransAlpha);
            
set_task(40.0"Task_Remove_Invis"id TASK_PLAYER_REMOVE_INVIS);
        }
        
    }
    
    return 
PLUGIN_CONTINUE;
    
}

public 
CallBackShopidiMenuiItem  )
{
    static 
_accessszInfo],  callback;
    
menu_item_getinfoiMenuiItem_accessszInfosizeof szInfo ) -1__callback );
    
    
//if( szInfo[ 0 ] == '0' )    return ITEM_ENABLED;
    
    
if( szInfo] == '1' )
    {
        if( 
get_pcvar_numg_iCvarNADES_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarNADES_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '2' )
    {
        if( 
get_pcvar_numg_iCvarHP_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarHP_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '3' )
    {
        if( 
get_pcvar_numg_iCvarAP_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarAP_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '4' )
    {
        if( 
get_pcvar_numg_iCvarDEAGLE_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarDEAGLE_TO] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '5' )
    {
        if( 
get_pcvar_numg_iCvarSPEED_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarSPEED_TO ] ) )
            return 
ITEM_ENABLED;
    }
    
    else if( 
szInfo] == '6' )
    {
        if( 
get_pcvar_numg_iCvarGRAVITY_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarGRAVITY_TO ] ) )
            return 
ITEM_ENABLED;
    }
    
    return 
ITEM_DISABLED;
}

public 
ham_PlayerSpawnPre(  id  )
{
    
    if( 
is_user_aliveid ) )
    {
        
        if( 
get_pcvar_numg_iCvarSPEED_DURATION ] ) == )
        {
            if( 
g_bUserHasid ][ SPEED ] )
            {
                new 
iSpeed get_pcvar_numg_iCvarSPEED_AMOUNT ] );
                
engfuncEngFunc_SetClientMaxspeedidfloatiSpeed )  );
                
set_pevid,  pev_maxspeedfloatiSpeed ) );
                
                
/*    SlowHack o_O
                client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
                */
            
}
        }
        else
            
g_bUserHasid ][ SPEED ] = false;
        
        if( 
get_pcvar_numg_iCvarGRAVITY_DURATION ] ) == )
        {
            if( 
g_bUserHasid ][ GRAVITY ] )
                
set_user_gravityidfloatget_pcvar_numg_iCvarGRAVITY_AMOUNT ] ) ) * 0.00125 );
        }
        else
            
g_bUserHasid ][ GRAVITY ] = false;
        
        
    }
}


/*======================================= -  Askhanar  - =======================================*/

public ham_PlayerKilledPre(  id  )
{
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
}

public 
ham_PlayerResetMaxSpeedPreid )
{
    
    if( 
is_user_aliveid )  /*&&  get_user_maxspeed(  id  )  !=  1.0*/  )
    {
        
        if( 
g_bUserHasid ][ SPEED ] )
        {
            
            static 
Float:flMaxSpeed;
            
flMaxSpeed floatget_pcvar_numg_iCvarSPEED_AMOUNT ] ) );
            
            
engfuncEngFunc_SetClientMaxspeedidflMaxSpeed  );
            
set_pevidpev_maxspeedflMaxSpeed  );
            
        }
        
        
        
/*    SlowHack o_O
        client_cmd(  id,  "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", flMaxSpeed, flMaxSpeed, flMaxSpeed );
        */
    
}
}

public 
Task_Remove_Noclipid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_noclip(id0);
    }
}

public 
Task_Remove_GodModeid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_godmode(id0);
    }
}

public 
Task_Remove_Invisid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_rendering(id_000_0);
    }
}

stock bool:bUserHasAnyNadeid )
{
    
    if( 
user_has_weaponidCSW_HEGRENADE ) || user_has_weaponidCSW_FLASHBANG )
    || 
user_has_weaponidCSW_SMOKEGRENADE ) )
    return 
true;
    
    return 
false;
    
}

stock fcs_get_user_teamid )
{
    new 
iTeam = -1;
    if( 
cs_get_user_teamid ) == CS_TEAM_T )    iTeam 1;
    else if( 
cs_get_user_teamid ) == CS_TEAM_CT )    iTeam 2;
        
    return 
iTeam;
}

ColorChat(  idColor:iType, const msg[  ], { FloatSqlResult_}:...  ){
    
    
// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
    
if( !get_playersnum( ) ) return;
    new 
szMessage256 ];
    
    switch( 
iType )
    {
        
// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
        
case NORMAL:    szMessage] = 0x01;
            
        
// Culoare Verde.
        
case GREEN:    szMessage] = 0x04;
            
        
// Alb, Rosu, Albastru.
        
default:     szMessage] = 0x03;
    }
    
    
vformat(  szMessage], 251msg4  );
    
    
// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
    
szMessage192 ] = '^0';
    
    
    new 
iTeamiColorChangeiPlayerIndexMSG_Type;
    
    if( 
id )
    {
        
MSG_Type  =  MSG_ONE_UNRELIABLE;
        
iPlayerIndex  =  id;
    }
    else
    {
        
iPlayerIndex  =  CC_FindPlayer(  );
        
MSG_Type MSG_ALL;
    }
    
    
iTeam  =  get_user_teamiPlayerIndex );
    
iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_TypeiType);
    
    
CC_ShowColorMessage(  iPlayerIndexMSG_TypeszMessage  );
    
    if(  
iColorChange  )    CC_Team_Info(  iPlayerIndexMSG_Type,  TeamNameiTeam ]  );
    
}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  ) {
    
    static 
bool:bSayTextUsed;
    static 
iMsgSayText;
    
    if(  !
bSayTextUsed  )
    {
        
iMsgSayText  =  get_user_msgid"SayText" );
        
bSayTextUsed  =  true;
    }
    
    
message_beginiTypeiMsgSayText_id  );
    
write_byte(  id  )
    
write_string(  szMessage  );
    
message_end(  );
}

CC_Team_Infoid, const iType, const szTeam[  ] ) {
    static 
bool:bTeamInfoUsed;
    static 
iMsgTeamInfo;
    if(  !
bTeamInfoUsed  )
    {
        
iMsgTeamInfo  =  get_user_msgid"TeamInfo" );
        
bTeamInfoUsed  =  true;
    }
    
    
message_beginiTypeiMsgTeamInfo_id  );
    
write_byte(  id  );
    
write_string(  szTeam  );
    
message_end(  );
    
    return 
1;
}

CC_ColorSelection(  id, const iTypeColor:iColorType) {
    switch(  
iColorType  )
    {
        
        case 
RED:    return CC_Team_Info(  idiTypeTeamName]  );
            case 
BLUE:    return CC_Team_Info(  idiTypeTeamName]  );
            case 
GREY:    return CC_Team_Info(  idiTypeTeamName]  );
            
    }
    
    return 
0;
}

CC_FindPlayer(  ) {
    new 
iMaxPlayers  =  get_maxplayers(  );
    
    for( new 
1<= iMaxPlayersi++ )
        if(  
is_user_connected)  )
        return 
i;
    
    return -
1;


Last edited by alferd; 06-01-2020 at 03:29.
alferd is offline
AlexandruODT
Member
Join Date: May 2020
Old 06-01-2020 , 06:54   Re: Add items
Reply With Quote #5

it works but it doesn't show all the items and when I buy nothing happens

CreditShop.sma(400) : warning 217: loose indentation
CreditShop.sma(403) : warning 217: loose indentation

Last edited by AlexandruODT; 06-01-2020 at 06:56.
AlexandruODT is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 06-01-2020 , 08:56   Re: Add items
Reply With Quote #6

Quote:
Originally Posted by AlexandruODT View Post
it works but it doesn't show all the items and when I buy nothing happens

CreditShop.sma(400) : warning 217: loose indentation
CreditShop.sma(403) : warning 217: loose indentation
Try it now , fixed

PHP Code:
#include < amxmodx >
#include < cstrike >
#include < amxmisc >
#include < engine >
#include < fun >
#include < fakemeta >
#include < hamsandwich >
#include < Credits >
//#include < fcs >
//#include < CC_ColorChat >

#define PLUGIN "FCS Credits Shop"
#define VERSION "1.0.3"

enum Color {
    
NORMAL 1,         // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
    
GREEN,             // Culoare Verde.
    
TEAM_COLOR,         // Culoare Rosu, Albastru, Gri.
    
GREY,             // Culoarea Gri.
    
RED,             // Culoarea Rosu.
    
BLUE,             // Culoarea Albastru.
}

new 
TeamName[  ][  ] = {
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

new const 
g_szTag[ ] = "[ERAZER SHOP]";
new 
g_szMenuName[ ] = "\rERAZER\y SHOP";

enum _:iCvars {
    
ENABLE,
    
    
NADES_PRICE,
    
NADES_TO,
    
    
HP_PRICE,
    
HP_AMOUNT,
    
HP_TO,
    
    
AP_PRICE,
    
AP_AMOUNT,
    
AP_TO,
    
    
DEAGLE_PRICE,
    
DEAGLE_BACKPACK_AMMO,
    
DEAGLE_TO,
    
    
SPEED_PRICE,
    
SPEED_AMOUNT,
    
SPEED_DURATION,
    
SPEED_TO,
    
    
GRAVITY_PRICE,
    
GRAVITY_AMOUNT,
    
GRAVITY_DURATION,
    
GRAVITY_TO,
    
    
NoClip,
    
Godmode,
    
Invisibility
    
}

enum _:WhatUserHas {
    
SPEED,
    
GRAVITY,
}

enum _:playerTasks ( += 33 )
{
    
TASK_PLAYER_REMOVE_GODMODE,
    
TASK_PLAYER_REMOVE_INVIS,
    
TASK_PLAYER_REMOVE_NOCLIP
}


new 
g_iMaxPlayers;
new 
g_iCvariCvars ];
new 
bool:g_bUserHas33 ][ WhatUserHas ];

// Do not modify this.
new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame;

public 
plugin_init( )
{
    
register_pluginPLUGINVERSION"MrAbdoO");
    
register_cvar"fcs_shop_version"VERSIONFCVAR_SERVER FCVAR_SPONLY );
    
    
g_iCvarENABLE ] = register_cvar"fcsshop_enable""1");
    
    
g_iCvarNADES_PRICE ] = register_cvar"fcsshop_nades_price""25" );
    
g_iCvarNADES_TO ] = register_cvar"fcsshop_nades_team""1" );
    
    
g_iCvarHP_PRICE ] = register_cvar"fcsshop_hp_price""60" );
    
g_iCvarHP_AMOUNT ] = register_cvar"fcsshop_hp_amount""300" );
    
g_iCvarHP_TO ] = register_cvar"fcsshop_hp_team""3" );
    
    
g_iCvarAP_PRICE ] = register_cvar"fcsshop_ap_price""55" );
    
g_iCvarAP_AMOUNT ] = register_cvar"fcsshop_ap_amount""500" );
    
g_iCvarAP_TO ] = register_cvar"fcsshop_ap_team""3" );
    
    
g_iCvarDEAGLE_PRICE ] = register_cvar"fcsshop_deagle_price""80" );
    
g_iCvarDEAGLE_BACKPACK_AMMO ] = register_cvar"fcsshop_deagle_ammo""21" );
    
g_iCvarDEAGLE_TO ] = register_cvar"fcsshop_deagle_team""1" );
    
    
g_iCvarSPEED_PRICE ] = register_cvar"fcsshop_speed_price""75" );
    
g_iCvarSPEED_AMOUNT ] = register_cvar"fcsshop_speed_amount""500" );
    
g_iCvarSPEED_DURATION ] = register_cvar"fcsshop_speed_duration""1" );
    
g_iCvarSPEED_TO ] = register_cvar"fcsshop_speed_team""2" );
    
    
g_iCvarGRAVITY_PRICE ] = register_cvar"fcsshop_gravity_price""80" );
    
g_iCvarGRAVITY_AMOUNT ] = register_cvar"fcsshop_gravity_amount""300" );
    
g_iCvarGRAVITY_DURATION ] = register_cvar"fcsshop_gravity_duration""1" );
    
g_iCvarGRAVITY_TO ] = register_cvar"fcsshop_gravity_team""2" );
    
    
g_iCvarNoClip ] = register_cvar"fcsshop_noclip_team""20" );
    
g_iCvarGodmode ] = register_cvar"fcsshop_godmode_team""30" );
    
g_iCvarInvisibility ] = register_cvar"fcsshop_invisibility_team""40" );
    
    
register_clcmd"say shop""ClCmdSayShop" );
    
register_clcmd"say_team shop""ClCmdSayShop" );
    
register_clcmd"say /shop""ClCmdSayShop" );
    
register_clcmd"say_team /shop""ClCmdSayShop" );
    
    
RegisterHamHam_Spawn"player""ham_PlayerSpawnPre"true );
    
RegisterHamHam_Killed"player""ham_PlayerKilledPre",true );
    
RegisterHamHam_Player_ResetMaxSpeed"player""ham_PlayerResetMaxSpeedPre"true );
    
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");

    
// Add your code here...
}

public 
Event_HLTV_New_Round()
{
    for(new 
id 1id<=g_iMaxPlayersid++)
    {
        
remove_taskid TASK_PLAYER_REMOVE_GODMODE );
        
remove_taskid TASK_PLAYER_REMOVE_INVIS );
        
remove_taskid TASK_PLAYER_REMOVE_NOCLIP );
        
Task_Remove_Noclipid );
        
Task_Remove_GodModeid );
        
Task_Remove_Invisid );
    }
}
public 
client_putinserverid )
{
    if( 
is_user_botid ) || is_user_hltvid ) )
        return;
    
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
    
}

public 
client_disconnectid )
{
    if( 
is_user_botid ) || is_user_hltvid ) )
        return;
    
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
    
}

public 
ClCmdSayShopid )
{
    
    
    if( 
get_pcvar_numg_iCvarENABLE ] ) == )
    {
        
ColorChatidRED"^x04%s^x03 Comanda dezactivata de catre server!"g_szTag );
        return 
PLUGIN_HANDLED;
    }
    
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if( !
has_flagid"y" ) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
ShopMenuid );
    return 
PLUGIN_HANDLED;
    
}

public 
ShopMenuid )
{
    new 
szMenuName128 ];
    
formatexszMenuNamesizeof szMenuName ) -1"%s^n\yCredite: \r%i"g_szMenuNamefcs_get_user_creditsid ) );
    new 
iMenu menu_createszMenuName"ShopMenuHandler" );
    new 
iCallBack  =  menu_makecallback"CallBackShop" );
    
    new 
szBuffer][ 512 ], szBufferKey], iBufferKey 1;
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \yFULL\r ] \wGrenades\y       [\r %i Credite\y ]"get_pcvar_numg_iCvarNADES_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wHP\y                [\r %i Credite\y ]"get_pcvar_numg_iCvarHP_AMOUNT ] ), get_pcvar_numg_iCvarHP_PRICE ] ) )
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wAP\y                  [\r %i Credite\y ]"get_pcvar_numg_iCvarAP_AMOUNT ] ), get_pcvar_numg_iCvarAP_PRICE ] ) )
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i AMMO\r ] \wDeagle\y    [\r %i Credite\y ]"get_pcvar_numg_iCvarDEAGLE_BACKPACK_AMMO ] ), get_pcvar_numg_iCvarDEAGLE_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%.1f\r ] \wSpeed\y          [\r %i Credite\y ]"floatget_pcvar_numg_iCvarSPEED_AMOUNT ] ) ), get_pcvar_numg_iCvarSPEED_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y%i\r ] \wGravity\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarGRAVITY_AMOUNT ] ), get_pcvar_numg_iCvarGRAVITY_PRICE ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y30 Seconds\r ] \wNoClip\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarNoClip ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y20 Seconds\r ] \wGodmode\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarGodmode ] ) );
    
formatexszBuffer], sizeof szBuffer[ ] ) -1"\r[ \y40 Seconds\r ] \wInvisibility\y            [\r %i Credite\y ]"get_pcvar_numg_iCvarInvisibility ] ) );

    
    for( new 
06i++ )
    {
        
formatexszBufferKeysizeof szBufferKey ) -1"%i"iBufferKey );
        
menu_additemiMenuszBuffer], szBufferKey_iCallBack );
        
        
iBufferKey++;
    }
    
    
menu_setpropiMenuMPROP_EXITNAME"\wIesire" );
    
    
menu_displayidiMenu);
    
}

/*=======================================================================================s=P=u=f=?*/

public ShopMenuHandleridiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {
        
menu_destroyiMenu );
        return 
1PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ];
    new 
iaccesscallback;
    
    
menu_item_getinfoiMenuiItemiaccessdata5iName63callback );
    
    new 
key str_to_numdata );
    
//new page = floatround( str_to_float( data ) / 7.0001, floatround_floor );
    
    
menu_destroyiMenu );
    switch( 
key )
    {
        case 
1:
        {
        new 
iCreditsiNeededCredits;
        
iCredits fcs_get_user_creditsid );
        
iNeededCredits get_pcvar_numg_iCvarNADES_PRICE ] );
        
        if( 
iCredits iNeededCredits )
        {
            
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
            return 
PLUGIN_HANDLED;
        }
        if( 
bUserHasAnyNadeid ) )
        {
            
ColorChatidRED"^x04%s^x03 Ai cel putin o grenada in mana, nu poti cumpara altele!"g_szTag );
            return 
PLUGIN_HANDLED;
        }
        
        
fcs_sub_user_creditsidiNeededCredits );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 FULL Grenades^x01 pentru^x03 %i credit^x01 !"g_szTagiNeededCredits );
        
give_itemid"weapon_hegrenade" );
        
give_itemid"weapon_flashbang" );
        
give_itemid"weapon_flashbang" );
        
give_itemid"weapon_smokegrenade" );  
        }
        
        case 
2:
        {
        new 
iCreditsiNeededCredits;
        
iCredits fcs_get_user_creditsid );
        
iNeededCredits get_pcvar_numg_iCvarHP_PRICE ] );
        
        if( 
iCredits iNeededCredits )
        {
            
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
            return 
PLUGIN_HANDLED;
        }
        
        
fcs_sub_user_creditsidiNeededCredits );
        new 
iHP get_pcvar_numg_iCvarHP_AMOUNT ] );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i HP^x01 pentru^x03 %i credite^x01 !"g_szTagiHPiNeededCredits );
        
set_user_healthidget_user_healthid ) + iHP );  
        }
        
        case 
3:
        {
        new 
iCreditsiNeededCredits;
        
iCredits fcs_get_user_creditsid );
        
iNeededCredits get_pcvar_numg_iCvarAP_PRICE ] );
        if( 
iCredits iNeededCredits )
        {
            
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
            return 
PLUGIN_HANDLED;
        }
        
fcs_sub_user_creditsidiNeededCredits );
        new 
iAP get_pcvar_numg_iCvarAP_AMOUNT ] );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i AP^x01 pentru^x03 %i credite^x01 !"g_szTagiAPiNeededCredits );
        
set_user_armoridget_user_armorid ) + iAP );          
        }
        
        case 
4:
        {
        new 
iCreditsiNeededCredits;
        
iCredits fcs_get_user_creditsid );
        
iNeededCredits get_pcvar_numg_iCvarDEAGLE_PRICE ] );
        
        if( 
iCredits iNeededCredits )
        {
            
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
            return 
PLUGIN_HANDLED;
        }
        
        
fcs_sub_user_creditsidiNeededCredits );
        new 
iAMMO get_pcvar_numg_iCvarDEAGLE_BACKPACK_AMMO ] );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i AMMO Deagle^x01 pentru^x03 %i credite^x01 !"g_szTagiAMMOiNeededCredits );
        
give_itemid"weapon_deagle" );
        
cs_set_user_bpammoidCSW_DEAGLEiAMMO );     
        }
        
        case 
5:
        {
        new 
iCreditsiNeededCredits;
        
iCredits fcs_get_user_creditsid );
        
iNeededCredits get_pcvar_numg_iCvarSPEED_PRICE ] );
        
        if( 
iCredits iNeededCredits )
        {
            
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
            return 
PLUGIN_HANDLED;
        }
        
        
fcs_sub_user_creditsidiNeededCredits );
        new 
iSpeed get_pcvar_numg_iCvarSPEED_AMOUNT ] );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %.1f Speed^x01 pentru^x03 %i credite^x01 !"g_szTagfloatiSpeed ), iNeededCredits );
        
g_bUserHasid ][ SPEED ] = true;
        
engfuncEngFunc_SetClientMaxspeedidfloatiSpeed )  );
        
set_pevid,  pev_maxspeedfloatiSpeed ) );
        
        
/*    SlowHack o_O
            client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
            */
        
}
        
        case 
6:
        {
        new 
iCreditsiNeededCredits;
        
iCredits fcs_get_user_creditsid );
        
iNeededCredits get_pcvar_numg_iCvarGRAVITY_PRICE ] );
        
        if( 
iCredits iNeededCredits )
        {
            
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
            return 
PLUGIN_HANDLED;
        }
        
        
fcs_sub_user_creditsidiNeededCredits );
        new 
iGravity get_pcvar_numg_iCvarGRAVITY_AMOUNT ] );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Gravity^x01 pentru^x03 %i credite^x01 !"g_szTagiGravityiNeededCredits );
        
set_user_gravityidfloatiGravity ) * 0.00125 );
        
g_bUserHasid ][ GRAVITY ] = true;
        }
        case 
7:
        {
        new 
iCreditsiNeededCredits;
        
iCredits fcs_get_user_creditsid );
        
iNeededCredits get_pcvar_numg_iCvarNoClip ] );
        
        if( 
iCredits iNeededCredits )
        {
            
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
            return 
PLUGIN_HANDLED;
        }
        
        
fcs_sub_user_creditsidiNeededCredits )
        new 
iNoClip get_pcvar_numg_iCvarNoClip ] );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Noclip^x01 pentru^x03 %i credite^x01 !"g_szTagiNoClipiNeededCredits );
        
set_user_noclip(id1);
        
set_task(30.0"Task_Remove_Noclip"id TASK_PLAYER_REMOVE_NOCLIP);
        }
        case 
8:
        {
        new 
iCreditsiNeededCredits;
        
iCredits fcs_get_user_creditsid );
        
iNeededCredits get_pcvar_numg_iCvarGodmode ] );
        
        if( 
iCredits iNeededCredits )
        {
            
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
            return 
PLUGIN_HANDLED;
        }
        
fcs_sub_user_creditsidiNeededCredits );
        new 
iGodmode get_pcvar_numg_iCvarGodmode ] );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Godmode^x01 pentru^x03 %i credite^x01 !"g_szTagiGodmodeiNeededCredits );
        
set_user_godmode(id1);
        
set_task(20.0"Task_Remove_GodMode"id TASK_PLAYER_REMOVE_GODMODE);
        }
        case 
9:
        {
        new 
iCreditsiNeededCredits;
        
iCredits fcs_get_user_creditsid );
        
iNeededCredits get_pcvar_numg_iCvarInvisibility ] );
        
        if( 
iCredits iNeededCredits )
        {
            
ColorChatidRED"^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !"g_szTagiNeededCredits iCredits );
            return 
PLUGIN_HANDLED;
        }
        
        
fcs_sub_user_creditsidiNeededCredits );
        new 
iInvisibility get_pcvar_numg_iCvarInvisibility ] );
        
ColorChatidRED"^x04%s^x01 Ai cumparat^x03 %i Invisibility^x01 pentru^x03 %i credite^x01 !"g_szTagiInvisibilityiNeededCredits );
        
set_user_rendering(idkRenderFxNone000kRenderTransAlpha);
        
set_task(40.0"Task_Remove_Invis"id TASK_PLAYER_REMOVE_INVIS);
        }
        
    }
    
    return 
PLUGIN_CONTINUE;
    
}

public 
CallBackShopidiMenuiItem  )
{
    static 
_accessszInfo],  callback;
    
menu_item_getinfoiMenuiItem_accessszInfosizeof szInfo ) -1__callback );
    
    
//if( szInfo[ 0 ] == '0' )    return ITEM_ENABLED;
    
    
if( szInfo] == '1' )
    {
        if( 
get_pcvar_numg_iCvarNADES_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarNADES_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '2' )
    {
        if( 
get_pcvar_numg_iCvarHP_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarHP_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '3' )
    {
        if( 
get_pcvar_numg_iCvarAP_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarAP_TO ] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '4' )
    {
        if( 
get_pcvar_numg_iCvarDEAGLE_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarDEAGLE_TO] ) )
            return 
ITEM_ENABLED;
    }
    else if( 
szInfo] == '5' )
    {
        if( 
get_pcvar_numg_iCvarSPEED_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarSPEED_TO ] ) )
            return 
ITEM_ENABLED;
    }
    
    else if( 
szInfo] == '6' )
    {
        if( 
get_pcvar_numg_iCvarGRAVITY_TO ] ) == || fcs_get_user_teamid ) == get_pcvar_numg_iCvarGRAVITY_TO ] ) )
            return 
ITEM_ENABLED;
    }
    
    return 
ITEM_DISABLED;
}

public 
ham_PlayerSpawnPre(  id  )
{
    
    if( 
is_user_aliveid ) )
    {
        
        if( 
get_pcvar_numg_iCvarSPEED_DURATION ] ) == )
        {
            if( 
g_bUserHasid ][ SPEED ] )
            {
                new 
iSpeed get_pcvar_numg_iCvarSPEED_AMOUNT ] );
                
engfuncEngFunc_SetClientMaxspeedidfloatiSpeed )  );
                
set_pevid,  pev_maxspeedfloatiSpeed ) );
                
                
/*    SlowHack o_O
                client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
                */
            
}
        }
        else
            
g_bUserHasid ][ SPEED ] = false;
        
        if( 
get_pcvar_numg_iCvarGRAVITY_DURATION ] ) == )
        {
            if( 
g_bUserHasid ][ GRAVITY ] )
                
set_user_gravityidfloatget_pcvar_numg_iCvarGRAVITY_AMOUNT ] ) ) * 0.00125 );
        }
        else
            
g_bUserHasid ][ GRAVITY ] = false;
        
        
    }
}


/*======================================= -  Askhanar  - =======================================*/

public ham_PlayerKilledPre(  id  )
{
    
g_bUserHasid ][ SPEED ] = false;
    
g_bUserHasid ][ GRAVITY ] = false;
}

public 
ham_PlayerResetMaxSpeedPreid )
{
    
    if( 
is_user_aliveid )  /*&&  get_user_maxspeed(  id  )  !=  1.0*/  )
    {
        
        if( 
g_bUserHasid ][ SPEED ] )
        {
            
            static 
Float:flMaxSpeed;
            
flMaxSpeed floatget_pcvar_numg_iCvarSPEED_AMOUNT ] ) );
            
            
engfuncEngFunc_SetClientMaxspeedidflMaxSpeed  );
            
set_pevidpev_maxspeedflMaxSpeed  );
            
        }
        
        
        
/*    SlowHack o_O
        client_cmd(  id,  "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", flMaxSpeed, flMaxSpeed, flMaxSpeed );
        */
    
}
}

public 
Task_Remove_Noclipid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_noclip(id0);
    }
}

public 
Task_Remove_GodModeid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_godmode(id0);
    }
}

public 
Task_Remove_Invisid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_rendering(id_000_0);
    }
}

stock bool:bUserHasAnyNadeid )
{
    
    if( 
user_has_weaponidCSW_HEGRENADE ) || user_has_weaponidCSW_FLASHBANG )
    || 
user_has_weaponidCSW_SMOKEGRENADE ) )
    return 
true;
    
    return 
false;
    
}

stock fcs_get_user_teamid )
{
    new 
iTeam = -1;
    if( 
cs_get_user_teamid ) == CS_TEAM_T )    iTeam 1;
    else if( 
cs_get_user_teamid ) == CS_TEAM_CT )    iTeam 2;
        
    return 
iTeam;
}

ColorChat(  idColor:iType, const msg[  ], { FloatSqlResult_}:...  ){
    
    
// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
    
if( !get_playersnum( ) ) return;
    new 
szMessage256 ];
    
    switch( 
iType )
    {
        
// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
        
case NORMAL:    szMessage] = 0x01;
            
        
// Culoare Verde.
        
case GREEN:    szMessage] = 0x04;
            
        
// Alb, Rosu, Albastru.
        
default:     szMessage] = 0x03;
    }
    
    
vformat(  szMessage], 251msg4  );
    
    
// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
    
szMessage192 ] = '^0';
    
    
    new 
iTeamiColorChangeiPlayerIndexMSG_Type;
    
    if( 
id )
    {
        
MSG_Type  =  MSG_ONE_UNRELIABLE;
        
iPlayerIndex  =  id;
    }
    else
    {
        
iPlayerIndex  =  CC_FindPlayer(  );
        
MSG_Type MSG_ALL;
    }
    
    
iTeam  =  get_user_teamiPlayerIndex );
    
iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_TypeiType);
    
    
CC_ShowColorMessage(  iPlayerIndexMSG_TypeszMessage  );
    
    if(  
iColorChange  )    CC_Team_Info(  iPlayerIndexMSG_Type,  TeamNameiTeam ]  );
    
}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  ) {
    
    static 
bool:bSayTextUsed;
    static 
iMsgSayText;
    
    if(  !
bSayTextUsed  )
    {
        
iMsgSayText  =  get_user_msgid"SayText" );
        
bSayTextUsed  =  true;
    }
    
    
message_beginiTypeiMsgSayText_id  );
    
write_byte(  id  )
    
write_string(  szMessage  );
    
message_end(  );
}

CC_Team_Infoid, const iType, const szTeam[  ] ) {
    static 
bool:bTeamInfoUsed;
    static 
iMsgTeamInfo;
    if(  !
bTeamInfoUsed  )
    {
        
iMsgTeamInfo  =  get_user_msgid"TeamInfo" );
        
bTeamInfoUsed  =  true;
    }
    
    
message_beginiTypeiMsgTeamInfo_id  );
    
write_byte(  id  );
    
write_string(  szTeam  );
    
message_end(  );
    
    return 
1;
}

CC_ColorSelection(  id, const iTypeColor:iColorType) {
    switch(  
iColorType  )
    {
        
        case 
RED:    return CC_Team_Info(  idiTypeTeamName]  );
            case 
BLUE:    return CC_Team_Info(  idiTypeTeamName]  );
            case 
GREY:    return CC_Team_Info(  idiTypeTeamName]  );
            
    }
    
    return 
0;
}

CC_FindPlayer(  ) {
    new 
iMaxPlayers  =  get_maxplayers(  );
    
    for( new 
1<= iMaxPlayersi++ )
        if(  
is_user_connected)  )
        return 
i;
    
    return -
1;


Last edited by Supremache; 06-01-2020 at 09:55.
Supremache is offline
AlexandruODT
Member
Join Date: May 2020
Old 06-02-2020 , 02:29   Re: Add items
Reply With Quote #7

Watch that video, not all items appear and nothing happens when you buy

You can eliminate Deagle and Grenades

https://www.youtube.com/watch?v=6mrU...ature=youtu.be

Last edited by AlexandruODT; 06-02-2020 at 07:27.
AlexandruODT is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 06-02-2020 , 09:04   Re: Add items
Reply With Quote #8

Quote:
Originally Posted by AlexandruODT View Post
Watch that video, not all items appear and nothing happens when you buy

You can eliminate Deagle and Grenades

https://www.youtube.com/watch?v=6mrU...ature=youtu.be
I can fix it easily but Ithe problem is I can't test it, tell me which mod do you have.
Supremache is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 06-02-2020 , 09:27   Re: Add items
Reply With Quote #9

Quote:
Originally Posted by AlexandruODT View Post
Watch that video, not all items appear and nothing happens when you buy

You can eliminate Deagle and Grenades

https://www.youtube.com/watch?v=6mrU...ature=youtu.be
Try it now, there's was a small problem and i solved.
The problem was in the menu, It Can't enable more than 6 keys but i change it to 9, try it and tell me
Attached Files
File Type: sma Get Plugin or Get Source (CreditShop.sma - 5 views - 22.0 KB)
File Type: inc Credits.inc (1.1 KB, 4 views)
Supremache is offline
AlexandruODT
Member
Join Date: May 2020
Old 06-03-2020 , 02:48   Re: Add items
Reply With Quote #10

it doesn't work ... all the items appear but when you buy nothing happens ..maybe it's from cvars

the problem that not all the items in the menu appeared was from here

PHP Code:
for( new 08i++ )
    { 
i changed the number

can you make this menu work with credits?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>


#define PLUGIN "Shop"
#define VERSION "1.1"
#define AUTHOR "Darksmith"

#pragma semicolon 1

new g_iMenugmsgBlinkAcctg_iMaxPlayers;

enum _:playerTasks ( += 33 )
{
    
TASK_PLAYER_REMOVE_GODMODE,
    
TASK_PLAYER_REMOVE_INVIS,
    
TASK_PLAYER_REMOVE_NOCLIP
}

enum Datas
{
    
m_szName[32],
    
m_iCost
}

new const 
g_mItems[][Datas] = 
{
    {
"No Clip         \r30 Seconds"4000},
    {
"Godmode         \r20 Seconds"3500},
    {
"Invisibility    \r40 Seconds"6000},
    {
"500 Health and Armor  \r1 Round"5000},
    {
"Speed and Gravity     \r1 Round"3000}
};

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("say /lm""shop");
    
register_clcmd("say /shop""shop");
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
        
    
    
CreateMenu();

    
gmsgBlinkAcct get_user_msgid("BlinkAcct");
}

public 
Event_HLTV_New_Round()
{
    for(new 
id 1id<=g_iMaxPlayersid++)
    {
        
remove_taskid TASK_PLAYER_REMOVE_GODMODE );
        
remove_taskid TASK_PLAYER_REMOVE_INVIS );
        
remove_taskid TASK_PLAYER_REMOVE_NOCLIP );
        
Task_Remove_Noclipid );
        
Task_Remove_GodModeid );
        
Task_Remove_Invisid );
    }
}

CreateMenu()
{
    
g_iMenu menu_create"\wShop Menu \R\y$""ShopMenuHandler" );

    new 
szItem[64];
    for(new 
ii<sizeof(g_mItems); i++)
    {
        
formatex(szItemcharsmax(szItem), "%s\R\y%d"g_mItems[i][m_szName], g_mItems[i][m_iCost]);
        
menu_additem(g_iMenuszItem);
    }
}
public 
shop(id)
{
    if(
is_user_alive(id))
    {
        
menu_display(idg_iMenu);
    }
}

public 
ShopMenuHandler(idmenuitem )
{
    if(
item >=&& is_user_alive(id))
    {
        new 
newMoney cs_get_user_money(id) - g_mItems[item][m_iCost];
        if( 
newMoney <= )
        {
            
client_print(idprint_chat"Sorry ,You Don't have Enught Money");
            
            
message_begin(MSG_ONEgmsgBlinkAcct_id);
            {
                
write_byte(2);
            }
            
message_end();
            return;
        }
        
cs_set_user_money(idnewMoney);

        switch(
item)
        {
            case 
0:
            {
                
set_user_noclip(id1);
                
set_task(30.0"Task_Remove_Noclip"id TASK_PLAYER_REMOVE_NOCLIP);
                
client_print(idprint_chat"You Have Bought No Clip for 30 Seconds");
            }
            case 
1:
            {
                
set_user_godmode(id1);
                
set_task(20.0"Task_Remove_GodMode"id TASK_PLAYER_REMOVE_GODMODE);
                
client_print(idprint_chat"You Have Bought Godmode for 20 Seconds");
            }
            case 
2:
            {
                
set_user_rendering(idkRenderFxNone000kRenderTransAlpha);
                
set_task(40.0"Task_Remove_Invis"id TASK_PLAYER_REMOVE_INVIS);
                
client_print(idprint_chat"You Have Bought Invisibilty for 40 Seconds");
            }
            case 
3:
            {
                
set_user_health(id500);
                
cs_set_user_armor(id500CS_ARMOR_VESTHELM);
                
client_print(idprint_chat"You Have Buy 500 Armor + Health");
            }
            case 
4:
            {
                
set_user_maxspeed(id500.0);
                
set_user_gravity(id0.2);
                
client_print(idprint_chat"You Have Buy Speed and Gravity");
            }
        }
    }
}

public 
Task_Remove_Noclipid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_noclip(id0);
    }
}

public 
Task_Remove_GodModeid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_godmode(id0);
    }
}

public 
Task_Remove_Invisid )
{
    
id %= 33;
    if( 
is_user_connected(id) )
    {
        
set_user_rendering(id_000_0);
    }
}



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/ 
AlexandruODT is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:32.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode