Raised This Month: $12 Target: $400
 3% 

[HELP] - DrShop (Add buy lives and remove LJ).


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lisandro_Oviedoo
Member
Join Date: Aug 2012
Location: Venezuela
Old 07-06-2014 , 12:59   [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #1

You see, I'm using this plugin will.

I all goes well ...

I just need to know how to disable some menu items and add new one.

I do not have the .sma of plugin.

I need to disable the "Long Jump" and add an option to buy and cost lives.

That's all, I hope you can help me.

Plugin:https://forums.alliedmods.net/showpo...46&postcount=2
Lisandro_Oviedoo is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 07-06-2014 , 13:37   Re: [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #2

You need The .SMA
__________________
Eagle07 is offline
goosemanakareal
BANNED
Join Date: Jan 2014
Old 07-07-2014 , 03:34   Re: [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #3

Sma
goosemanakareal is offline
goosemanakareal
BANNED
Join Date: Jan 2014
Old 07-07-2014 , 03:46   Re: [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #4

Removed LongJump (LJ)
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <nvault>
#include <hamsandwich>
#include <fakemeta>


/* --| Let's force the semicolon on every endline */
#pragma semicolon 1

/* --| Some defines :) */
#define PICKUP_SND        "items/gunpickup2.wav"
#define HEALTH_SOUND        "items/smallmedkit1.wav"
#define ARMOR_SOUND        "items/ammopickup2.wav"
#define CLOACK_SOUND        "hornet/ag_buzz1.wav"
#define SOUND_NVGOFF        "items/nvg_off.wav"
#define ADMIN_ACCESS_CMD    ADMIN_KICK    
#define HAS_NVGS        (1<<0)
#define USES_NVGS        (1<<8)
#define get_user_nvg(%1)        (get_pdata_int(%1,m_iNvg) & HAS_NVGS)

/* --| Plugin informations */
new const PLUGIN[]     = "Deathrun Shop";
new const 
VERSION[]     = "4.0";
new const 
AUTHOR[]     = "tuty";
 
/* --| Zomg lot of globals :) */
new gDrShopOn;
new 
gHeCost;
new 
gBothGrenadesCost;
new 
gSilentCost;
new 
gHealthCost;
new 
gArmorCost;
new 
gSpeedCost;
new 
gGravityCost;
new 
gInvisCost;
new 
gSpeedCvar;
new 
gGravityCvar;
new 
gAdvertiseCvar;
new 
gHealthPointCvar;
new 
gArmorPointCvar;
new 
gAdvertiseTimeCvar;
new 
gInvisPercent;
new 
gKillerPointsCvar;
new 
gSuiciderPointsCvar;
new 
gSavePlayerPoints;
new 
gNoclipCost;
new 
gVault;
new 
gNoclipTime;
new 
gJetSprite;
new 
gJetPackCost;
new 
gJetTime;
new 
gDeagleCost;
new 
gGlowCost;
new 
gNvgCost;
new 
gMessageNVG;

/* --| Item variables */
new HasHe33 ];
new 
HasBothGren33 ];
new 
HasSilent33 ];
new 
HasHealth33 ];
new 
HasArmor33 ];
new 
HasSpeed33 ];
new 
HasGravity33 ];
new 
HasInvis33 ];
new 
HasNoclip33 ];
new 
HasJet33 ];
new 
HasDeagle33 ];
new 
HasGlow33 ];
new 
HasNVG33 ];
new 
gName32 char ];
new 
gSteamID32 ];
new 
vKey64 ];
new 
vData64 ];

/* --| Player points, need this to save points, load points, etc */
new gKillerPoints33 ];

/* --| Offsets for nvg */
const m_iNvg 129;
const 
m_iLinuxDiff 5;

/* --| So, let's get started */
public plugin_init()
{
    
/* --| Registering the plugin to show when you type amx_plugins.. */
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
/* --| Registering a little cvar to see wich servers using this plugin */
    
register_cvar"drshop_version"VERSIONFCVAR_SERVER FCVAR_SPONLY );

    
/* --| Register some usefull events */
    
register_logevent"logevent_round_start"2"1=Round_Start" );
    
register_event"DeathMsg""Hook_Deathmessage""a" );
    
register_event"CurWeapon""HookCurWeapon""be""1=1" );
    
    
/* --| Called when a player is performing a jump */
    
RegisterHamHam_Player_Jump"player""bacon_playerJumping" );
    
    
/* --| We need this forward to find if player has suicided with kill in console */
    /* --| We can't do that on deathmsg because player die in traps by suicide,.. trigger_hurt or world.. etc */
    
register_forwardFM_ClientKill"forward_kill" );
    
    
/* --| Command for setting points to player/@all */
    
register_concmd"deathrun_set_points""cmdSetPoints"ADMIN_ACCESS_CMD"<name/@all> <points> - set points to a player" );
    
    
/* --| Command for reseting points to palyer/@all */
    
register_concmd"deathrun_reset_points""cmdResetPoints"ADMIN_ACCESS_CMD"<name/@all> - reset player points" );
    
    
/* --| Command for opening the menu */
    
register_clcmd"say /drshop""DeathrunShop" );
    
register_clcmd"say_team /drshop""DeathrunShop" );
    
    
/* --| Command to see our points :) */
    
register_clcmd"say /mypoints""ShowPoints" );
    
register_clcmd"say_team /mypoints""ShowPoints" );

    
    
/* --| Let's register the cvars, a lot of cvars but huh.. stf :) */
    
gDrShopOn register_cvar"deathrun_shop""1" );
    
gHeCost register_cvar"deathrun_he_cost""10" ); 
    
gBothGrenadesCost register_cvar"deathrun_bothgrenades_cost""20" );
    
gSilentCost register_cvar"deathrun_silent_cost""24" );
    
gHealthCost register_cvar"deathrun_health_cost""30" );
    
gArmorCost register_cvar"deathrun_armor_cost""15" );
    
gSpeedCost register_cvar"deathrun_speed_cost""39" );
    
gGravityCost register_cvar"deathrun_gravity_cost""41" );
    
gNoclipCost register_cvar"deathrun_noclip_cost""50" );
    
gJetPackCost register_cvar"deathrun_jetpack_cost""60" );
    
gInvisCost register_cvar"deathrun_invisibility_cost""69" );
    
gSpeedCvar register_cvar"deathrun_speed_power""400.0" );
    
gNoclipTime register_cvar"deathrun_noclip_duration""2" );
    
gJetTime register_cvar"deathrun_jetpack_duration""10" );
    
gDeagleCost register_cvar"deathrun_deagle_cost""31" );
    
gGravityCvar register_cvar"deathrun_gravity_power""0.7" );
    
gAdvertiseCvar register_cvar"deathrun_advertise_message""1" );
    
gHealthPointCvar register_cvar"deathrun_health_points""255" );
    
gArmorPointCvar register_cvar"deathrun_armor_points""400" );
    
gAdvertiseTimeCvar register_cvar"deathrun_advertise_time""7.0" );
    
gInvisPercent register_cvar"deathrun_invisibility_percentage""111" );
    
gKillerPointsCvar register_cvar"deathrun_killer_bonuspoints""5" );
    
gSuiciderPointsCvar register_cvar"deathrun_suicider_loose_points""3" );
    
gSavePlayerPoints register_cvar"deathrun_save_points""1" );
    
gGlowCost register_cvar"deathrun_glow_cost""8" );
    
gNvgCost register_cvar"deathrun_nvg_cost""33" );

    
/* --| Let's find/do some stuff here */
    
gMessageNVG get_user_msgid"NVGToggle" );
    
    
/* --| Register the multilingual file */
    
register_dictionary"DeathrunShopLang.txt" );
}

/* --| Precache stuff */
public plugin_precache()
{
    
gJetSprite precache_model"sprites/explode1.spr" );
    
precache_soundPICKUP_SND );
    
precache_soundHEALTH_SOUND );
    
precache_soundARMOR_SOUND );
    
precache_soundCLOACK_SOUND );
}

/* --| Plugin cfg, here we do some ugly shit ever -.- */
public plugin_cfg()
{
    new 
iCfgDir32 ], iFile192 ];
    
    
/* --| We need to find the configs directory, and to add the configuration file */
    
get_configsdiriCfgDircharsmaxiCfgDir ) );
    
formatexiFilecharsmaxiFile ), "%s/DeathrunShop_Cfg.cfg"iCfgDir );
        
    
/* --| If file not exists, let's create one but empty */
    
if( !file_existsiFile ) )
    {
        
server_print"[DrShop] %L"LANG_SERVER"DRSHOP_SVPRINT"iFile );
        
write_fileiFile" ", -);
    }
    
    
/* --| Else, let's load the cvars from cfg */
    
else
    {        
        
server_print"[DrShop] %L"LANG_SERVER"DRSHOP_SVPRINT_DONE"iFile );
        
server_cmd"exec %s"iFile );
    }
    
    
/* --| Set the server maxspeed to a high value, need it for speed item */
    
server_cmd"sv_maxspeed 99999999.0" );
}

/* --| When client is connecting, let's reset stuff and load client's points */
public client_connectid )
{
    
HasHeid ] = false;
    
HasBothGrenid ] = false;
    
HasSilentid ] = false;
    
HasHealthid ] = false;
    
HasArmorid] = false;
    
HasSpeedid ] = false;
    
HasGravityid ] = false;
    
HasInvisid ] = false;
    
HasNoclipid ] = false;
    
HasJetid ] = false;
    
HasDeagleid ] = false;
    
HasGlowid ] = false;
    
HasNVGid ] = false;
    
    
/* --| Load client points */
    
load_client_pointsid );
}

/* --| When client has disconnected let's reset stuff and save points */
public client_disconnectid )
{
    
HasHeid ] = false;
    
HasBothGrenid ] = false;
    
HasSilentid ] = false;
    
HasHealthid ] = false;
    
HasArmorid] = false;
    
HasSpeedid ] = false;
    
HasGravityid ] = false;
    
HasInvisid ] = false;
    
HasNoclipid ] = false;
    
HasJetid ] = false;
    
HasDeagleid ] = false;
    
HasGlowid ] = false;
    
HasNVGid ] = false;
    
    
/* --| If player is not a bot, let's save the points */
    
if( get_pcvar_numgSavePlayerPoints ) != && !is_user_botid ) )
    {
        
/* --| Save player points is cvar is 1 */
        
save_client_pointsid );
    }
}

/* --| When client has entered on sv, need to show him a hudmessage :) */
public client_putinserverid )
{
    if( 
get_pcvar_numgAdvertiseCvar ) != )
    {
        
/* --| Need to set task, 7 default because need to wait for player choosing a team or something */
        
set_taskget_pcvar_floatgAdvertiseTimeCvar ), "ShowPlayerInfo"id );
    }
}

/* --| Deathrun shop menu with items ^^ */
public DeathrunShopid )
{
    
/* --| If cvar is set to 0, player can't open the shop */
    
if( get_pcvar_numgDrShopOn ) != )
    {
        
client_printidprint_chat"[DrShop] %L"id"DRSHOP_DISABLED" );
        return 
PLUGIN_HANDLED;
    }
    
    
/* --| If player is dead, cant buy items :) */
    
if( !is_user_aliveid ) )
    {
        
client_printidprint_chat"[DrShop] %L"id"DRSHOP_ONLY_ALIVE" );
        return 
PLUGIN_HANDLED;
    }
    
    
/* --| Menu stuff */
    
new szText555 char ];
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_MENU_TITLE"VERSIONgKillerPointsid ] );
    
    new 
menu menu_createszText"shop_handler" );

    
/* --| Menu item 1 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_1"get_pcvar_numgHeCost ) );
    
menu_additemmenuszText"1");
    
    
/* --| Menu item 2 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_2"get_pcvar_numgBothGrenadesCost ) );
    
menu_additemmenuszText"2");
    
    
/* --| Menu item 3 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_3"get_pcvar_numgSilentCost ) );
    
menu_additemmenuszText"3");
    
    
/* --| Menu item 4 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_4"get_pcvar_numgHealthPointCvar ), get_pcvar_numgHealthCost ) );
    
menu_additemmenuszText"4");
    
    
/* --| Menu item 5 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_5"get_pcvar_numgArmorPointCvar ), get_pcvar_numgArmorCost ) );
    
menu_additemmenuszText"5");
    
    
/* --| Menu item 6 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_6"get_pcvar_numgSpeedCost ) );
    
menu_additemmenuszText"6");
    
    
/* --| Menu item 7 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_7"get_pcvar_numgGravityCost ) );
    
menu_additemmenuszText"7");
    
    
/* --| Menu item 8 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_8"get_pcvar_numgInvisPercent ), get_pcvar_numgInvisCost ) );
    
menu_additemmenuszText"8");
    
    
/* --| Menu item 9 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_9"get_pcvar_numgNoclipTime ), get_pcvar_numgNoclipCost ) );
    
menu_additemmenuszText"9");
    
    
/* --| Menu item 10 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_10"get_pcvar_numgJetTime ), get_pcvar_numgJetPackCost ) );
    
menu_additemmenuszText"10");
    
    
/* --| Menu item 11 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_11"get_pcvar_numgDeagleCost ) );
    
menu_additemmenuszText"11");
    
    
/* --| Menu item 12 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_13"get_pcvar_numgGlowCost ) );
    
menu_additemmenuszText"12");
    
    
/* --| Menu item 13 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_14"get_pcvar_numgNvgCost ) );
    
menu_additemmenuszText"13");
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
/* --| Show the menu, with current page 0 */
    
menu_displayidmenu);

    return 
PLUGIN_CONTINUE;
}

/* --| Menu commands */
public shop_handleridmenuitem )
{
    
/* --| If key is 0, let's close the menu */
    
if( item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    
/* --| Getting the menu information */
    
new data], iName64 ], accesscallback;
    
menu_item_getinfomenuitemaccessdatacharsmaxdata ), iNamecharsmaxiName ), callback );

    
/* --| Get menu keys */
    
new key str_to_numdata );
    
    
/* --| Here we find the player points */
    
new points gKillerPointsid ];
    
    switch( 
key )
    {
        
/* --| Menu item 1 */
        
case 1:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasHeid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgHeCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */
            
give_itemid"weapon_hegrenade" );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_GRENADE_ITEM" );
            
HasHeid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgHeCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 2 */
        
case 2:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasBothGrenid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgBothGrenadesCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */
            
give_itemid"weapon_hegrenade" );
            
give_itemid"weapon_flashbang" );
            
give_itemid"weapon_flashbang" );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_BOTHGREN_ITEM" );
            
HasBothGrenid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgBothGrenadesCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 3 */
        
case 3:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasSilentid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgSilentCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }    
            
            
/* --| Let's give the item, and do some stuff */
            
set_user_footstepsid);
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_SILENTWALK_ITEM" );
            
HasSilentid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgSilentCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 4 */
        
case 4:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasHealthid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgHealthCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_healthidget_user_healthid ) + get_pcvar_numgHealthPointCvar ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_HEALTH_ITEM"get_pcvar_numgHealthPointCvar ) );
            
HasHealthid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgHealthCost );
            
emit_soundidCHAN_ITEMHEALTH_SOUNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 5 */
        
case 5:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasArmorid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgArmorCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_armoridget_user_armorid ) + get_pcvar_numgArmorPointCvar ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_ARMOR_ITEM"get_pcvar_numgArmorPointCvar ) );    
            
HasArmorid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgArmorCost );
            
emit_soundidCHAN_ITEMARMOR_SOUNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 6 */
        
case 6:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasSpeedid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgSpeedCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_maxspeedidget_pcvar_floatgSpeedCvar ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_SPEED_ITEM" );
            
HasSpeedid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgSpeedCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 7 */
        
case 7:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasGravityid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgGravityCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_gravityidget_pcvar_floatgGravityCvar ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_GRAVITY_ITEM" );
            
HasGravityid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgGravityCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 8 */
        
case 8:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasInvisid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgInvisCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_renderingidkRenderFxNone000kRenderTransAlphaget_pcvar_numgInvisPercent ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_INVISIBILITY_ITEM" );
            
HasInvisid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgInvisCost );
            
emit_soundidCHAN_ITEMCLOACK_SOUNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 9 */
        
case 9:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasNoclipid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgNoclipCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_taskfloatget_pcvar_numgNoclipTime ) ), "remove_noclip"id );
            
set_user_noclipid);
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_NOCLIP_ITEM" );
            
HasNoclipid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgNoclipCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 10 */
        
case 10:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasJetid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgJetPackCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_taskfloatget_pcvar_numgJetTime ) ), "remove_jetpack"id );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_JETPACK_ITEM" );
            
HasJetid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgJetPackCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 11 */
        
case 11:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasDeagleid ] || user_has_weaponidCSW_DEAGLE ) )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgDeagleCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
strip_user_weaponsid );
            
give_itemid"weapon_knife" );
            
give_itemid"weapon_deagle" );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_DEAGLE_ITEM" );
            
HasDeagleid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgDeagleCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 12 */
        
case 12:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasGlowid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgGlowCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_renderingidkRenderFxGlowShellrandom256 ), random256 ), random256 ), kRenderNormalrandom256 ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_GLOW_ITEM" );
            
HasGlowid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgGlowCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 13 */
        
case 13:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasNVGid ] || get_user_nvgid ) )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgNvgCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_nvgid);
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_NVG_ITEM" );
            
HasNVGid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgNvgCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
    }
    
    return 
PLUGIN_HANDLED;
}

/* --| Command for setting points | admin only ;/ */
public cmdSetPointsidlevelcid )
{
    
/* --| If user doesn't have acces to command, return */
    
if( !cmd_accessidlevelcid) || !get_pcvar_numgDrShopOn ) )
    {
        return 
PLUGIN_HANDLED
    }
    
    
/* --| Need to read the first argument */
    
new argument32 ];
       
read_argv1argumentcharsmaxargument ) );

    
/* --| Need to read second argument */
    
new give_points];
    
read_argv2give_pointscharsmaxgive_points ) );

    
/* --| We are getting the gift from second argument */
    
new gift str_to_numgive_points );
    
    new 
iPlayer32 ], iNumall;
    
get_playersiPlayeriNum"c" );

    
/* --| Lets see if argument 1 is @all */
    
if( equalargument"@all" ) )
    {
        for( new 
iiNumi++ )
        {
            
/* --| Find the index :) */
            
all iPlayer];
            
            
/* --| Set points to all */
            
gKillerPointsall ] = gKillerPointsall ] + gift;
            
            
/* --| Show a print in chat */
            
get_user_nameidgNamecharsmaxgName ) );
            
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOW_ALLCMD"gNamegift );
        }
    }
            
    else
    {
        
/* --| Now, we find the target */
        
new player cmd_targetidargument10 );

        
/* --| If is not a valid target, return */
        
if( !player 
        {
               return 
PLUGIN_HANDLED;
        }
    

        
/* --| Get admin, and target name */
        
new TargetName32 char ];
        
get_user_nameplayerTargetNamecharsmaxTargetName ) );
        
get_user_nameidgNamecharsmaxgName ) );    
    
        
/* --| Setting target points */
        
gKillerPointsplayer ] = gKillerPointsplayer ] + gift;
        
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOW_CMD"gNamegiftTargetName );
    }

    return 
PLUGIN_HANDLED;
}

/* --| Command for reseting points | admin only ;/ */
public cmdResetPointsidlevelcid )
{
    
/* --| If user doesn't have acces to command, return */
    
if( !cmd_accessidlevelcid) || !get_pcvar_numgDrShopOn ) )
    {
        return 
PLUGIN_HANDLED
    }
    
    
/* --| Need to read the first argument */
    
new argument32 ];
       
read_argv1argumentcharsmaxargument ) );
    
    new 
iPlayer32 ], iNumall;
    
get_playersiPlayeriNum"c" );

    
/* --| Lets see if argument 1 is @all */
    
if( equalargument"@all" ) )
    {
        for( new 
iiNumi++ )
        {
            
/* --| Find the index :) */
            
all iPlayer];
            
            
/* --| Set points to all */
            
gKillerPointsall ] = 0;
            
            
/* --| Show a print in chat */
            
get_user_nameidgNamecharsmaxgName ) );
            
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOWRESET_ALLCMD"gName );
        }
    }
            
    else
    {
        
/* --| Now, we find the target */
        
new player cmd_targetidargument10 );

        
/* --| If is not a valid target, return */
        
if( !player 
        {
               return 
PLUGIN_HANDLED;
        }
    

        
/* --| Get admin, and target name */
        
new TargetName32 char ];
        
get_user_nameplayerTargetNamecharsmaxTargetName ) );
        
get_user_nameidgNamecharsmaxgName ) );    
    
        
/* --| Setting target points */
        
gKillerPointsplayer ] = 0;
        
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOWRESET_CMD"gNameTargetName );
    }

    return 
PLUGIN_HANDLED;
}
    
/* --| We need to find if player has performed a jump, and set some velocity */
public bacon_playerJumpingid )
{
    
/* --| If plugin is on, and user has jetpack item */
    
if( get_pcvar_numgDrShopOn ) != && HasJetid ] )
    {
        
/* --| Get user origins from feet */
        
new iOrigin];
        
get_user_originidiOrigin);
        
        
/* --| Modify origin a bit */
        
iOrigin] -= 20;
        
        
/* --| Get player velocity */
        
new Float:fVelocity];
        
pevidpev_velocityfVelocity );

        
/* --| Modify velocity a bit */
        
fVelocity] += 93;
        
        
/* --| Set the player velocity and add a flame effect, jetpack style */
        
set_pevidpev_velocityfVelocity );
        
create_flameiOrigin );
    }
}    

/* --| We need to check is player has changed his weapon */
public HookCurWeaponid )
{
    
/* --| If plugin is on, and user has speed item, let's set the speed again */
    
if( get_pcvar_numgDrShopOn ) != && HasSpeedid ] )
    {
        
set_user_maxspeedidget_pcvar_floatgSpeedCvar ) );
    }
}

/* --| Command for show points */    
public ShowPointsid )
{
    
/* --| Set a hud message */
    
set_hudmessage255422120.030.8626.05.0 );
    
    
/* --| We show player points on hud */
    
show_hudmessageid"[DrShop] %L"id"DRSHOP_POINTS_INFO"gKillerPointsid ] );
    
    
/* --| We show player points on chat */
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_POINTS_INFO"gKillerPointsid ] );
    
    return 
PLUGIN_CONTINUE;
}

/* --| Here we show player hud information about this god damn shop */
public ShowPlayerInfoid )
{
    
/* --| Set a hud message */
    
set_hudmessage00255, -1.00.8206.012.0 );
    
    
/* --| Now we show the info message in hud channel */
    
show_hudmessageid"%L"id"DRSHOP_HUD_INFO" );
}

/* --| If player has suicided by console */
public forward_killid )
{
    
/* --| Check if plugin is on, and user is alive */
    
if( get_pcvar_numgDrShopOn ) == && is_user_aliveid ) )
    {
        
/* --| Set player points with suicide cvar */
        
client_printidprint_chat"[DrShop] %L"id"DRSHOP_SHOW_LOOSER"get_pcvar_numgSuiciderPointsCvar ) );
        
gKillerPointsid ] -= get_pcvar_numgSuiciderPointsCvar );
    }
}

/* --| Event for round start */        
public logevent_round_start()
{
    
/* --| If plugin is on... */
    
if( get_pcvar_numgDrShopOn ) == )
    {
        
/* --| I used this native because with get_maxplayers will recieve a damn error with invalid player id.. */
        /* --| This is good because we can skip the damn bots */
        
new iPlayers32 ], iNumiid;
        
get_playersiPlayersiNum"c" );
        
        for( 
0iNumi++ )
        {
            
/* --| Find the index :) */
            
id iPlayers];
            
            
/* --| Reseting items */
            
HasHeid ] = false;
            
HasBothGrenid ] = false;
            
HasSilentid ] = false;
            
HasHealthid ] = false;
            
HasArmorid] = false;
            
HasSpeedid ] = false;
            
HasGravityid ] = false;
            
HasInvisid ] = false;
            
HasNoclipid ] = false;
            
HasJetid ] = false;
            
HasDeagleid ] = false;
            
HasGlowid ] = false;
            
HasNVGid ] = false;
            
            
set_user_gravityid1.0 );    
            
set_user_maxspeedid0.0 );
            
set_user_footstepsid);
            
set_user_noclipid);
            
set_user_renderingid );
            
set_user_nvgid);
            
remove_user_nvgid );
            
remove_taskid );
        }
    }
}

/* --| Event when player died */
public Hook_Deathmessage()
{
    
/* --| If plugin is on... */
    
if( get_pcvar_numgDrShopOn ) == )
    {
        
/* --| Get the killer and attacker */
        
new killer read_data);
        new 
victim read_data);

        
/* --| If player has died with world / trigger_hurt */
        
if( killer == victim )
        {
            return 
PLUGIN_HANDLED;
        }
        
        
/* --| Setting killer points when killed a enemy */
        
gKillerPointskiller ] += get_pcvar_numgKillerPointsCvar );
    
        
/* --| Reseting items */
        
HasHevictim ] = false;
        
HasBothGrenvictim ] = false;
        
HasSilentvictim ] = false;
        
HasHealthvictim ] = false;
        
HasArmorvictim ] = false;
        
HasSpeedvictim ] = false;
        
HasGravityvictim ] = false;
        
HasInvisvictim ] = false;
        
HasNoclipvictim ] = false;
        
HasJetvictim ] = false;
        
HasDeaglevictim ] = false;
        
HasGlowvictim ] = false;
        
HasNVGvictim ] = false;
        
        
set_user_gravityvictim1.0 );    
        
set_user_maxspeedvictim0.0 );
        
set_user_footstepsvictim);
        
set_user_noclipvictim);
        
set_user_renderingvictim );
        
set_user_nvgvictim);
        
remove_user_nvgvictim );
        
remove_taskvictim );
    }
    
    return 
PLUGIN_CONTINUE;
}

/* --| Now we need to remove the noclip */
public remove_noclipid )
{
    
HasNoclipid ] = false;
    
set_user_noclipid);
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_NOCLIP_OFF"get_pcvar_numgNoclipTime ) );
}

/* --| Now we need to remove the jetpack */    
public remove_jetpackid )
{
    
HasJetid ] = false;
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_JETPACK_OFF"get_pcvar_numgJetTime ) );
}

/* --| Usefull stocks on this plugin */
/* --| Display a message in chat if player already have the item */
stock allready_haveid )
{
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_ALLREADY_HAVE" );
}    

/* --| Display a message in chat if player don't have enough points */
stock dont_haveid )
{
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_DONTHAVE_POINTS" );
}    

/* --| Saving player points */
stock save_client_pointsindex )
{
    
/* --| Open the vault file */
    
gVault nvault_open"DeathrunShop_SavedPoints" );
    
    
/* --| If vault return -1, lets stop this shit */
    
if( gVault == INVALID_HANDLE )
    {
        
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
    }
    
    
/* --| Get the player steamid */
    
get_user_authidindexgSteamIDcharsmaxgSteamID ) );
    
    
/* --| Setting stuff on vault file, and close the file */
    
formatexvKeycharsmaxvKey ), "%sPOINTS"gSteamID );
    
formatexvDatacharsmaxvData ), "%d"gKillerPointsindex ] );
    
nvault_setgVaultvKeyvData );
    
nvault_closegVault );
}

/* --| Loading client points */
stock load_client_pointsindex )
{
    
/* --| Open the vault file */
    
gVault nvault_open"DeathrunShop_SavedPoints" );
    
    
/* --| If vault return -1, lets stop this shit */
    
if( gVault == INVALID_HANDLE )
    {
        
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
    }
    
    
/* --| Get the player steamid */
    
get_user_authidindexgSteamIDcharsmaxgSteamID ) );
    
    
/* --| Get the player points, then, close the nvault vile */
    
formatexvKeycharsmaxvKey ), "%sPOINTS"gSteamID );
    
gKillerPointsindex ] = nvault_getgVaultvKey );
    
nvault_closegVault );
}

/* --| Flame jetpack effect stock */
stock create_flameorigin] )
{
    
message_beginMSG_PVSSVC_TEMPENTITYorigin );
    
write_byteTE_SPRITE );
    
write_coordorigin] );
    
write_coordorigin] );
    
write_coordorigin] );
    
write_shortgJetSprite );
    
write_byte);
    
write_byte99 );
    
message_end();
}

/* --| Stock for setting user nightvision */
/* --| This stock is more good than cstrike native( give errors ) */
stock set_user_nvgindexnvgoggles )
{
    if( 
nvgoggles )
    {
        
set_pdata_intindexm_iNvgget_pdata_intindexm_iNvg ) | HAS_NVGS );
    }

    else
    {
        
set_pdata_intindexm_iNvgget_pdata_intindexm_iNvg ) & ~HAS_NVGS );
    }
}

/* --| Stock for removing turned on nightvision from players. Let's call, force remove nvg :) */ 
stock remove_user_nvgindex )
{
    new 
iNvgs get_pdata_intindexm_iNvgm_iLinuxDiff );

    if( !
iNvgs )
    {
        return;
    }

    if( 
iNvgs USES_NVGS )
    {
        
emit_soundindexCHAN_ITEMSOUND_NVGOFFVOL_NORMATTN_NORM0PITCH_NORM );

        
emessage_beginMSG_ONE_UNRELIABLEgMessageNVG_index );
        
ewrite_byte);
        
emessage_end();
    }

    
set_pdata_intindexm_iNvg0m_iLinuxDiff );

Attached Files
File Type: txt DeathrunShopLang.txt (2.4 KB, 56 views)
File Type: cfg DeathrunShop_Cfg.cfg (1.4 KB, 43 views)

Last edited by goosemanakareal; 07-07-2014 at 03:54.
goosemanakareal is offline
Lisandro_Oviedoo
Member
Join Date: Aug 2012
Location: Venezuela
Old 07-07-2014 , 13:20   Re: [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #5

Quote:
Originally Posted by goosemanakareal View Post
Removed LongJump (LJ)
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <nvault>
#include <hamsandwich>
#include <fakemeta>


/* --| Let's force the semicolon on every endline */
#pragma semicolon 1

/* --| Some defines :) */
#define PICKUP_SND        "items/gunpickup2.wav"
#define HEALTH_SOUND        "items/smallmedkit1.wav"
#define ARMOR_SOUND        "items/ammopickup2.wav"
#define CLOACK_SOUND        "hornet/ag_buzz1.wav"
#define SOUND_NVGOFF        "items/nvg_off.wav"
#define ADMIN_ACCESS_CMD    ADMIN_KICK    
#define HAS_NVGS        (1<<0)
#define USES_NVGS        (1<<8)
#define get_user_nvg(%1)        (get_pdata_int(%1,m_iNvg) & HAS_NVGS)

/* --| Plugin informations */
new const PLUGIN[]     = "Deathrun Shop";
new const 
VERSION[]     = "4.0";
new const 
AUTHOR[]     = "tuty";
 
/* --| Zomg lot of globals :) */
new gDrShopOn;
new 
gHeCost;
new 
gBothGrenadesCost;
new 
gSilentCost;
new 
gHealthCost;
new 
gArmorCost;
new 
gSpeedCost;
new 
gGravityCost;
new 
gInvisCost;
new 
gSpeedCvar;
new 
gGravityCvar;
new 
gAdvertiseCvar;
new 
gHealthPointCvar;
new 
gArmorPointCvar;
new 
gAdvertiseTimeCvar;
new 
gInvisPercent;
new 
gKillerPointsCvar;
new 
gSuiciderPointsCvar;
new 
gSavePlayerPoints;
new 
gNoclipCost;
new 
gVault;
new 
gNoclipTime;
new 
gJetSprite;
new 
gJetPackCost;
new 
gJetTime;
new 
gDeagleCost;
new 
gGlowCost;
new 
gNvgCost;
new 
gMessageNVG;

/* --| Item variables */
new HasHe33 ];
new 
HasBothGren33 ];
new 
HasSilent33 ];
new 
HasHealth33 ];
new 
HasArmor33 ];
new 
HasSpeed33 ];
new 
HasGravity33 ];
new 
HasInvis33 ];
new 
HasNoclip33 ];
new 
HasJet33 ];
new 
HasDeagle33 ];
new 
HasGlow33 ];
new 
HasNVG33 ];
new 
gName32 char ];
new 
gSteamID32 ];
new 
vKey64 ];
new 
vData64 ];

/* --| Player points, need this to save points, load points, etc */
new gKillerPoints33 ];

/* --| Offsets for nvg */
const m_iNvg 129;
const 
m_iLinuxDiff 5;

/* --| So, let's get started */
public plugin_init()
{
    
/* --| Registering the plugin to show when you type amx_plugins.. */
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
/* --| Registering a little cvar to see wich servers using this plugin */
    
register_cvar"drshop_version"VERSIONFCVAR_SERVER FCVAR_SPONLY );

    
/* --| Register some usefull events */
    
register_logevent"logevent_round_start"2"1=Round_Start" );
    
register_event"DeathMsg""Hook_Deathmessage""a" );
    
register_event"CurWeapon""HookCurWeapon""be""1=1" );
    
    
/* --| Called when a player is performing a jump */
    
RegisterHamHam_Player_Jump"player""bacon_playerJumping" );
    
    
/* --| We need this forward to find if player has suicided with kill in console */
    /* --| We can't do that on deathmsg because player die in traps by suicide,.. trigger_hurt or world.. etc */
    
register_forwardFM_ClientKill"forward_kill" );
    
    
/* --| Command for setting points to player/@all */
    
register_concmd"deathrun_set_points""cmdSetPoints"ADMIN_ACCESS_CMD"<name/@all> <points> - set points to a player" );
    
    
/* --| Command for reseting points to palyer/@all */
    
register_concmd"deathrun_reset_points""cmdResetPoints"ADMIN_ACCESS_CMD"<name/@all> - reset player points" );
    
    
/* --| Command for opening the menu */
    
register_clcmd"say /drshop""DeathrunShop" );
    
register_clcmd"say_team /drshop""DeathrunShop" );
    
    
/* --| Command to see our points :) */
    
register_clcmd"say /mypoints""ShowPoints" );
    
register_clcmd"say_team /mypoints""ShowPoints" );

    
    
/* --| Let's register the cvars, a lot of cvars but huh.. stf :) */
    
gDrShopOn register_cvar"deathrun_shop""1" );
    
gHeCost register_cvar"deathrun_he_cost""10" ); 
    
gBothGrenadesCost register_cvar"deathrun_bothgrenades_cost""20" );
    
gSilentCost register_cvar"deathrun_silent_cost""24" );
    
gHealthCost register_cvar"deathrun_health_cost""30" );
    
gArmorCost register_cvar"deathrun_armor_cost""15" );
    
gSpeedCost register_cvar"deathrun_speed_cost""39" );
    
gGravityCost register_cvar"deathrun_gravity_cost""41" );
    
gNoclipCost register_cvar"deathrun_noclip_cost""50" );
    
gJetPackCost register_cvar"deathrun_jetpack_cost""60" );
    
gInvisCost register_cvar"deathrun_invisibility_cost""69" );
    
gSpeedCvar register_cvar"deathrun_speed_power""400.0" );
    
gNoclipTime register_cvar"deathrun_noclip_duration""2" );
    
gJetTime register_cvar"deathrun_jetpack_duration""10" );
    
gDeagleCost register_cvar"deathrun_deagle_cost""31" );
    
gGravityCvar register_cvar"deathrun_gravity_power""0.7" );
    
gAdvertiseCvar register_cvar"deathrun_advertise_message""1" );
    
gHealthPointCvar register_cvar"deathrun_health_points""255" );
    
gArmorPointCvar register_cvar"deathrun_armor_points""400" );
    
gAdvertiseTimeCvar register_cvar"deathrun_advertise_time""7.0" );
    
gInvisPercent register_cvar"deathrun_invisibility_percentage""111" );
    
gKillerPointsCvar register_cvar"deathrun_killer_bonuspoints""5" );
    
gSuiciderPointsCvar register_cvar"deathrun_suicider_loose_points""3" );
    
gSavePlayerPoints register_cvar"deathrun_save_points""1" );
    
gGlowCost register_cvar"deathrun_glow_cost""8" );
    
gNvgCost register_cvar"deathrun_nvg_cost""33" );

    
/* --| Let's find/do some stuff here */
    
gMessageNVG get_user_msgid"NVGToggle" );
    
    
/* --| Register the multilingual file */
    
register_dictionary"DeathrunShopLang.txt" );
}

/* --| Precache stuff */
public plugin_precache()
{
    
gJetSprite precache_model"sprites/explode1.spr" );
    
precache_soundPICKUP_SND );
    
precache_soundHEALTH_SOUND );
    
precache_soundARMOR_SOUND );
    
precache_soundCLOACK_SOUND );
}

/* --| Plugin cfg, here we do some ugly shit ever -.- */
public plugin_cfg()
{
    new 
iCfgDir32 ], iFile192 ];
    
    
/* --| We need to find the configs directory, and to add the configuration file */
    
get_configsdiriCfgDircharsmaxiCfgDir ) );
    
formatexiFilecharsmaxiFile ), "%s/DeathrunShop_Cfg.cfg"iCfgDir );
        
    
/* --| If file not exists, let's create one but empty */
    
if( !file_existsiFile ) )
    {
        
server_print"[DrShop] %L"LANG_SERVER"DRSHOP_SVPRINT"iFile );
        
write_fileiFile" ", -);
    }
    
    
/* --| Else, let's load the cvars from cfg */
    
else
    {        
        
server_print"[DrShop] %L"LANG_SERVER"DRSHOP_SVPRINT_DONE"iFile );
        
server_cmd"exec %s"iFile );
    }
    
    
/* --| Set the server maxspeed to a high value, need it for speed item */
    
server_cmd"sv_maxspeed 99999999.0" );
}

/* --| When client is connecting, let's reset stuff and load client's points */
public client_connectid )
{
    
HasHeid ] = false;
    
HasBothGrenid ] = false;
    
HasSilentid ] = false;
    
HasHealthid ] = false;
    
HasArmorid] = false;
    
HasSpeedid ] = false;
    
HasGravityid ] = false;
    
HasInvisid ] = false;
    
HasNoclipid ] = false;
    
HasJetid ] = false;
    
HasDeagleid ] = false;
    
HasGlowid ] = false;
    
HasNVGid ] = false;
    
    
/* --| Load client points */
    
load_client_pointsid );
}

/* --| When client has disconnected let's reset stuff and save points */
public client_disconnectid )
{
    
HasHeid ] = false;
    
HasBothGrenid ] = false;
    
HasSilentid ] = false;
    
HasHealthid ] = false;
    
HasArmorid] = false;
    
HasSpeedid ] = false;
    
HasGravityid ] = false;
    
HasInvisid ] = false;
    
HasNoclipid ] = false;
    
HasJetid ] = false;
    
HasDeagleid ] = false;
    
HasGlowid ] = false;
    
HasNVGid ] = false;
    
    
/* --| If player is not a bot, let's save the points */
    
if( get_pcvar_numgSavePlayerPoints ) != && !is_user_botid ) )
    {
        
/* --| Save player points is cvar is 1 */
        
save_client_pointsid );
    }
}

/* --| When client has entered on sv, need to show him a hudmessage :) */
public client_putinserverid )
{
    if( 
get_pcvar_numgAdvertiseCvar ) != )
    {
        
/* --| Need to set task, 7 default because need to wait for player choosing a team or something */
        
set_taskget_pcvar_floatgAdvertiseTimeCvar ), "ShowPlayerInfo"id );
    }
}

/* --| Deathrun shop menu with items ^^ */
public DeathrunShopid )
{
    
/* --| If cvar is set to 0, player can't open the shop */
    
if( get_pcvar_numgDrShopOn ) != )
    {
        
client_printidprint_chat"[DrShop] %L"id"DRSHOP_DISABLED" );
        return 
PLUGIN_HANDLED;
    }
    
    
/* --| If player is dead, cant buy items :) */
    
if( !is_user_aliveid ) )
    {
        
client_printidprint_chat"[DrShop] %L"id"DRSHOP_ONLY_ALIVE" );
        return 
PLUGIN_HANDLED;
    }
    
    
/* --| Menu stuff */
    
new szText555 char ];
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_MENU_TITLE"VERSIONgKillerPointsid ] );
    
    new 
menu menu_createszText"shop_handler" );

    
/* --| Menu item 1 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_1"get_pcvar_numgHeCost ) );
    
menu_additemmenuszText"1");
    
    
/* --| Menu item 2 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_2"get_pcvar_numgBothGrenadesCost ) );
    
menu_additemmenuszText"2");
    
    
/* --| Menu item 3 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_3"get_pcvar_numgSilentCost ) );
    
menu_additemmenuszText"3");
    
    
/* --| Menu item 4 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_4"get_pcvar_numgHealthPointCvar ), get_pcvar_numgHealthCost ) );
    
menu_additemmenuszText"4");
    
    
/* --| Menu item 5 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_5"get_pcvar_numgArmorPointCvar ), get_pcvar_numgArmorCost ) );
    
menu_additemmenuszText"5");
    
    
/* --| Menu item 6 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_6"get_pcvar_numgSpeedCost ) );
    
menu_additemmenuszText"6");
    
    
/* --| Menu item 7 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_7"get_pcvar_numgGravityCost ) );
    
menu_additemmenuszText"7");
    
    
/* --| Menu item 8 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_8"get_pcvar_numgInvisPercent ), get_pcvar_numgInvisCost ) );
    
menu_additemmenuszText"8");
    
    
/* --| Menu item 9 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_9"get_pcvar_numgNoclipTime ), get_pcvar_numgNoclipCost ) );
    
menu_additemmenuszText"9");
    
    
/* --| Menu item 10 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_10"get_pcvar_numgJetTime ), get_pcvar_numgJetPackCost ) );
    
menu_additemmenuszText"10");
    
    
/* --| Menu item 11 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_11"get_pcvar_numgDeagleCost ) );
    
menu_additemmenuszText"11");
    
    
/* --| Menu item 12 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_13"get_pcvar_numgGlowCost ) );
    
menu_additemmenuszText"12");
    
    
/* --| Menu item 13 */
    
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_14"get_pcvar_numgNvgCost ) );
    
menu_additemmenuszText"13");
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
/* --| Show the menu, with current page 0 */
    
menu_displayidmenu);

    return 
PLUGIN_CONTINUE;
}

/* --| Menu commands */
public shop_handleridmenuitem )
{
    
/* --| If key is 0, let's close the menu */
    
if( item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    
/* --| Getting the menu information */
    
new data], iName64 ], accesscallback;
    
menu_item_getinfomenuitemaccessdatacharsmaxdata ), iNamecharsmaxiName ), callback );

    
/* --| Get menu keys */
    
new key str_to_numdata );
    
    
/* --| Here we find the player points */
    
new points gKillerPointsid ];
    
    switch( 
key )
    {
        
/* --| Menu item 1 */
        
case 1:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasHeid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgHeCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */
            
give_itemid"weapon_hegrenade" );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_GRENADE_ITEM" );
            
HasHeid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgHeCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 2 */
        
case 2:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasBothGrenid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgBothGrenadesCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */
            
give_itemid"weapon_hegrenade" );
            
give_itemid"weapon_flashbang" );
            
give_itemid"weapon_flashbang" );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_BOTHGREN_ITEM" );
            
HasBothGrenid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgBothGrenadesCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 3 */
        
case 3:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasSilentid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgSilentCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }    
            
            
/* --| Let's give the item, and do some stuff */
            
set_user_footstepsid);
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_SILENTWALK_ITEM" );
            
HasSilentid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgSilentCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 4 */
        
case 4:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasHealthid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgHealthCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_healthidget_user_healthid ) + get_pcvar_numgHealthPointCvar ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_HEALTH_ITEM"get_pcvar_numgHealthPointCvar ) );
            
HasHealthid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgHealthCost );
            
emit_soundidCHAN_ITEMHEALTH_SOUNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 5 */
        
case 5:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasArmorid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgArmorCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_armoridget_user_armorid ) + get_pcvar_numgArmorPointCvar ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_ARMOR_ITEM"get_pcvar_numgArmorPointCvar ) );    
            
HasArmorid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgArmorCost );
            
emit_soundidCHAN_ITEMARMOR_SOUNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 6 */
        
case 6:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasSpeedid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgSpeedCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_maxspeedidget_pcvar_floatgSpeedCvar ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_SPEED_ITEM" );
            
HasSpeedid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgSpeedCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 7 */
        
case 7:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasGravityid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgGravityCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_gravityidget_pcvar_floatgGravityCvar ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_GRAVITY_ITEM" );
            
HasGravityid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgGravityCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 8 */
        
case 8:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasInvisid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgInvisCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_renderingidkRenderFxNone000kRenderTransAlphaget_pcvar_numgInvisPercent ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_INVISIBILITY_ITEM" );
            
HasInvisid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgInvisCost );
            
emit_soundidCHAN_ITEMCLOACK_SOUNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 9 */
        
case 9:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasNoclipid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgNoclipCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_taskfloatget_pcvar_numgNoclipTime ) ), "remove_noclip"id );
            
set_user_noclipid);
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_NOCLIP_ITEM" );
            
HasNoclipid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgNoclipCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 10 */
        
case 10:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasJetid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgJetPackCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_taskfloatget_pcvar_numgJetTime ) ), "remove_jetpack"id );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_JETPACK_ITEM" );
            
HasJetid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgJetPackCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 11 */
        
case 11:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasDeagleid ] || user_has_weaponidCSW_DEAGLE ) )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgDeagleCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
strip_user_weaponsid );
            
give_itemid"weapon_knife" );
            
give_itemid"weapon_deagle" );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_DEAGLE_ITEM" );
            
HasDeagleid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgDeagleCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 12 */
        
case 12:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasGlowid ] )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgGlowCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_renderingidkRenderFxGlowShellrandom256 ), random256 ), random256 ), kRenderNormalrandom256 ) );
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_GLOW_ITEM" );
            
HasGlowid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgGlowCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
        
        
/* --| Menu item 13 */
        
case 13:
        {
            
/* --| If already has item, show a damn print and return */
            
if( HasNVGid ] || get_user_nvgid ) )
            {
                
allready_haveid );
                return 
PLUGIN_HANDLED;
            }
        
            
/* --| If player does not have enough points, show a print and return */
            
if( points get_pcvar_numgNvgCost ) )
            {
                
dont_haveid );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Let's give the item, and do some stuff */ 
            
set_user_nvgid);
            
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_NVG_ITEM" );
            
HasNVGid ] = true;
            
            
gKillerPointsid ] -= get_pcvar_numgNvgCost );
            
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
            
menu_displayidmenu);
        }
    }
    
    return 
PLUGIN_HANDLED;
}

/* --| Command for setting points | admin only ;/ */
public cmdSetPointsidlevelcid )
{
    
/* --| If user doesn't have acces to command, return */
    
if( !cmd_accessidlevelcid) || !get_pcvar_numgDrShopOn ) )
    {
        return 
PLUGIN_HANDLED
    }
    
    
/* --| Need to read the first argument */
    
new argument32 ];
       
read_argv1argumentcharsmaxargument ) );

    
/* --| Need to read second argument */
    
new give_points];
    
read_argv2give_pointscharsmaxgive_points ) );

    
/* --| We are getting the gift from second argument */
    
new gift str_to_numgive_points );
    
    new 
iPlayer32 ], iNumall;
    
get_playersiPlayeriNum"c" );

    
/* --| Lets see if argument 1 is @all */
    
if( equalargument"@all" ) )
    {
        for( new 
iiNumi++ )
        {
            
/* --| Find the index :) */
            
all iPlayer];
            
            
/* --| Set points to all */
            
gKillerPointsall ] = gKillerPointsall ] + gift;
            
            
/* --| Show a print in chat */
            
get_user_nameidgNamecharsmaxgName ) );
            
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOW_ALLCMD"gNamegift );
        }
    }
            
    else
    {
        
/* --| Now, we find the target */
        
new player cmd_targetidargument10 );

        
/* --| If is not a valid target, return */
        
if( !player 
        {
               return 
PLUGIN_HANDLED;
        }
    

        
/* --| Get admin, and target name */
        
new TargetName32 char ];
        
get_user_nameplayerTargetNamecharsmaxTargetName ) );
        
get_user_nameidgNamecharsmaxgName ) );    
    
        
/* --| Setting target points */
        
gKillerPointsplayer ] = gKillerPointsplayer ] + gift;
        
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOW_CMD"gNamegiftTargetName );
    }

    return 
PLUGIN_HANDLED;
}

/* --| Command for reseting points | admin only ;/ */
public cmdResetPointsidlevelcid )
{
    
/* --| If user doesn't have acces to command, return */
    
if( !cmd_accessidlevelcid) || !get_pcvar_numgDrShopOn ) )
    {
        return 
PLUGIN_HANDLED
    }
    
    
/* --| Need to read the first argument */
    
new argument32 ];
       
read_argv1argumentcharsmaxargument ) );
    
    new 
iPlayer32 ], iNumall;
    
get_playersiPlayeriNum"c" );

    
/* --| Lets see if argument 1 is @all */
    
if( equalargument"@all" ) )
    {
        for( new 
iiNumi++ )
        {
            
/* --| Find the index :) */
            
all iPlayer];
            
            
/* --| Set points to all */
            
gKillerPointsall ] = 0;
            
            
/* --| Show a print in chat */
            
get_user_nameidgNamecharsmaxgName ) );
            
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOWRESET_ALLCMD"gName );
        }
    }
            
    else
    {
        
/* --| Now, we find the target */
        
new player cmd_targetidargument10 );

        
/* --| If is not a valid target, return */
        
if( !player 
        {
               return 
PLUGIN_HANDLED;
        }
    

        
/* --| Get admin, and target name */
        
new TargetName32 char ];
        
get_user_nameplayerTargetNamecharsmaxTargetName ) );
        
get_user_nameidgNamecharsmaxgName ) );    
    
        
/* --| Setting target points */
        
gKillerPointsplayer ] = 0;
        
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOWRESET_CMD"gNameTargetName );
    }

    return 
PLUGIN_HANDLED;
}
    
/* --| We need to find if player has performed a jump, and set some velocity */
public bacon_playerJumpingid )
{
    
/* --| If plugin is on, and user has jetpack item */
    
if( get_pcvar_numgDrShopOn ) != && HasJetid ] )
    {
        
/* --| Get user origins from feet */
        
new iOrigin];
        
get_user_originidiOrigin);
        
        
/* --| Modify origin a bit */
        
iOrigin] -= 20;
        
        
/* --| Get player velocity */
        
new Float:fVelocity];
        
pevidpev_velocityfVelocity );

        
/* --| Modify velocity a bit */
        
fVelocity] += 93;
        
        
/* --| Set the player velocity and add a flame effect, jetpack style */
        
set_pevidpev_velocityfVelocity );
        
create_flameiOrigin );
    }
}    

/* --| We need to check is player has changed his weapon */
public HookCurWeaponid )
{
    
/* --| If plugin is on, and user has speed item, let's set the speed again */
    
if( get_pcvar_numgDrShopOn ) != && HasSpeedid ] )
    {
        
set_user_maxspeedidget_pcvar_floatgSpeedCvar ) );
    }
}

/* --| Command for show points */    
public ShowPointsid )
{
    
/* --| Set a hud message */
    
set_hudmessage255422120.030.8626.05.0 );
    
    
/* --| We show player points on hud */
    
show_hudmessageid"[DrShop] %L"id"DRSHOP_POINTS_INFO"gKillerPointsid ] );
    
    
/* --| We show player points on chat */
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_POINTS_INFO"gKillerPointsid ] );
    
    return 
PLUGIN_CONTINUE;
}

/* --| Here we show player hud information about this god damn shop */
public ShowPlayerInfoid )
{
    
/* --| Set a hud message */
    
set_hudmessage00255, -1.00.8206.012.0 );
    
    
/* --| Now we show the info message in hud channel */
    
show_hudmessageid"%L"id"DRSHOP_HUD_INFO" );
}

/* --| If player has suicided by console */
public forward_killid )
{
    
/* --| Check if plugin is on, and user is alive */
    
if( get_pcvar_numgDrShopOn ) == && is_user_aliveid ) )
    {
        
/* --| Set player points with suicide cvar */
        
client_printidprint_chat"[DrShop] %L"id"DRSHOP_SHOW_LOOSER"get_pcvar_numgSuiciderPointsCvar ) );
        
gKillerPointsid ] -= get_pcvar_numgSuiciderPointsCvar );
    }
}

/* --| Event for round start */        
public logevent_round_start()
{
    
/* --| If plugin is on... */
    
if( get_pcvar_numgDrShopOn ) == )
    {
        
/* --| I used this native because with get_maxplayers will recieve a damn error with invalid player id.. */
        /* --| This is good because we can skip the damn bots */
        
new iPlayers32 ], iNumiid;
        
get_playersiPlayersiNum"c" );
        
        for( 
0iNumi++ )
        {
            
/* --| Find the index :) */
            
id iPlayers];
            
            
/* --| Reseting items */
            
HasHeid ] = false;
            
HasBothGrenid ] = false;
            
HasSilentid ] = false;
            
HasHealthid ] = false;
            
HasArmorid] = false;
            
HasSpeedid ] = false;
            
HasGravityid ] = false;
            
HasInvisid ] = false;
            
HasNoclipid ] = false;
            
HasJetid ] = false;
            
HasDeagleid ] = false;
            
HasGlowid ] = false;
            
HasNVGid ] = false;
            
            
set_user_gravityid1.0 );    
            
set_user_maxspeedid0.0 );
            
set_user_footstepsid);
            
set_user_noclipid);
            
set_user_renderingid );
            
set_user_nvgid);
            
remove_user_nvgid );
            
remove_taskid );
        }
    }
}

/* --| Event when player died */
public Hook_Deathmessage()
{
    
/* --| If plugin is on... */
    
if( get_pcvar_numgDrShopOn ) == )
    {
        
/* --| Get the killer and attacker */
        
new killer read_data);
        new 
victim read_data);

        
/* --| If player has died with world / trigger_hurt */
        
if( killer == victim )
        {
            return 
PLUGIN_HANDLED;
        }
        
        
/* --| Setting killer points when killed a enemy */
        
gKillerPointskiller ] += get_pcvar_numgKillerPointsCvar );
    
        
/* --| Reseting items */
        
HasHevictim ] = false;
        
HasBothGrenvictim ] = false;
        
HasSilentvictim ] = false;
        
HasHealthvictim ] = false;
        
HasArmorvictim ] = false;
        
HasSpeedvictim ] = false;
        
HasGravityvictim ] = false;
        
HasInvisvictim ] = false;
        
HasNoclipvictim ] = false;
        
HasJetvictim ] = false;
        
HasDeaglevictim ] = false;
        
HasGlowvictim ] = false;
        
HasNVGvictim ] = false;
        
        
set_user_gravityvictim1.0 );    
        
set_user_maxspeedvictim0.0 );
        
set_user_footstepsvictim);
        
set_user_noclipvictim);
        
set_user_renderingvictim );
        
set_user_nvgvictim);
        
remove_user_nvgvictim );
        
remove_taskvictim );
    }
    
    return 
PLUGIN_CONTINUE;
}

/* --| Now we need to remove the noclip */
public remove_noclipid )
{
    
HasNoclipid ] = false;
    
set_user_noclipid);
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_NOCLIP_OFF"get_pcvar_numgNoclipTime ) );
}

/* --| Now we need to remove the jetpack */    
public remove_jetpackid )
{
    
HasJetid ] = false;
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_JETPACK_OFF"get_pcvar_numgJetTime ) );
}

/* --| Usefull stocks on this plugin */
/* --| Display a message in chat if player already have the item */
stock allready_haveid )
{
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_ALLREADY_HAVE" );
}    

/* --| Display a message in chat if player don't have enough points */
stock dont_haveid )
{
    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_DONTHAVE_POINTS" );
}    

/* --| Saving player points */
stock save_client_pointsindex )
{
    
/* --| Open the vault file */
    
gVault nvault_open"DeathrunShop_SavedPoints" );
    
    
/* --| If vault return -1, lets stop this shit */
    
if( gVault == INVALID_HANDLE )
    {
        
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
    }
    
    
/* --| Get the player steamid */
    
get_user_authidindexgSteamIDcharsmaxgSteamID ) );
    
    
/* --| Setting stuff on vault file, and close the file */
    
formatexvKeycharsmaxvKey ), "%sPOINTS"gSteamID );
    
formatexvDatacharsmaxvData ), "%d"gKillerPointsindex ] );
    
nvault_setgVaultvKeyvData );
    
nvault_closegVault );
}

/* --| Loading client points */
stock load_client_pointsindex )
{
    
/* --| Open the vault file */
    
gVault nvault_open"DeathrunShop_SavedPoints" );
    
    
/* --| If vault return -1, lets stop this shit */
    
if( gVault == INVALID_HANDLE )
    {
        
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
    }
    
    
/* --| Get the player steamid */
    
get_user_authidindexgSteamIDcharsmaxgSteamID ) );
    
    
/* --| Get the player points, then, close the nvault vile */
    
formatexvKeycharsmaxvKey ), "%sPOINTS"gSteamID );
    
gKillerPointsindex ] = nvault_getgVaultvKey );
    
nvault_closegVault );
}

/* --| Flame jetpack effect stock */
stock create_flameorigin] )
{
    
message_beginMSG_PVSSVC_TEMPENTITYorigin );
    
write_byteTE_SPRITE );
    
write_coordorigin] );
    
write_coordorigin] );
    
write_coordorigin] );
    
write_shortgJetSprite );
    
write_byte);
    
write_byte99 );
    
message_end();
}

/* --| Stock for setting user nightvision */
/* --| This stock is more good than cstrike native( give errors ) */
stock set_user_nvgindexnvgoggles )
{
    if( 
nvgoggles )
    {
        
set_pdata_intindexm_iNvgget_pdata_intindexm_iNvg ) | HAS_NVGS );
    }

    else
    {
        
set_pdata_intindexm_iNvgget_pdata_intindexm_iNvg ) & ~HAS_NVGS );
    }
}

/* --| Stock for removing turned on nightvision from players. Let's call, force remove nvg :) */ 
stock remove_user_nvgindex )
{
    new 
iNvgs get_pdata_intindexm_iNvgm_iLinuxDiff );

    if( !
iNvgs )
    {
        return;
    }

    if( 
iNvgs USES_NVGS )
    {
        
emit_soundindexCHAN_ITEMSOUND_NVGOFFVOL_NORMATTN_NORM0PITCH_NORM );

        
emessage_beginMSG_ONE_UNRELIABLEgMessageNVG_index );
        
ewrite_byte);
        
emessage_end();
    }

    
set_pdata_intindexm_iNvg0m_iLinuxDiff );






MUST UNDERSTAND
.

I use another store running with money. The owner of that plugin not posted the sma.

If I did not ask for help.

Is there any way of transforming a sma file plugin to see the codes?

I want to disable LongJump and add the option to purchase life to this store.

(The plugin is in the attachment).
Attached Files
File Type: txt DeathrunShopLang.txt (2.8 KB, 45 views)
File Type: cfg DeathrunShop_Cfg.cfg (1.5 KB, 40 views)

Last edited by YamiKaitou; 07-07-2014 at 19:53.
Lisandro_Oviedoo is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 07-07-2014 , 13:25   Re: [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #6

If you don't have the sma we can't edit the plugin. Ask the author for the sma as he is required to give the source code with a compiled plugin. Also remove the amxx file as you are not allowed to post them here.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
Lisandro_Oviedoo
Member
Join Date: Aug 2012
Location: Venezuela
Old 07-07-2014 , 15:10   Re: [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #7

Quote:
Originally Posted by joshknifer View Post
If you don't have the sma we can't edit the plugin. Ask the author for the sma as he is required to give the source code with a compiled plugin. Also remove the amxx file as you are not allowed to post them here.
If allowed I think, the author published it in this forum but in another post.
I have asked the sma file but has not responded.

Is there a way to convert the file in the sma to amxx view the code, edit it and compile it?
Or should I wait for the sma file?
Lisandro_Oviedoo is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 07-07-2014 , 15:48   Re: [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #8

It is easier to recreate a plugin from scratch than to decompile an already compiled plugin. Wait for the source, or if it is has already been posted here, just post a link to the code.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-07-2014 , 19:54   Re: [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #9

AMXX file removed, you are not allowed to distribute AMXX files on this site (plus, you are not allowed, per the GPL, to distribute them without the accompanying Source Code)
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Lisandro_Oviedoo
Member
Join Date: Aug 2012
Location: Venezuela
Old 07-08-2014 , 10:31   Re: [HELP] - DrShop (Add buy lives and remove LJ).
Reply With Quote #10

Quote:
Originally Posted by joshknifer View Post
It is easier to recreate a plugin from scratch than to decompile an already compiled plugin. Wait for the source, or if it is has already been posted here, just post a link to the code.

Okay, I understand.

Do you know how to buy money in this store?
Eliminating the purchase method with points

So, instead of buying this store points, bought with money.

Shop (Plugin): https://forums.alliedmods.net/showthread.php?t=87536
Lisandro_Oviedoo is offline
Reply



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 11:29.


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