| PepsiSexy |
08-12-2013 23:31 |
Shop Edit
1 Attachment(s)
Hello can someone edit this Shop for me a little bit?
First off you can change the Costs of each Item easily but the Price doenst show in game. So in game its just for example 25 Health, I want that the Price i put in the Plugin is also there.
What i also want is that it shows Chat Messages for every Item if you buy it.
Some Bugs i know:
If you have an AWP and buy Bullets for it it works great, but if you buy bullets again it says "You dont have an AWP" or something..
Another bug is on Power Menu if you buy for example Boots of Speed and Stealth the the Hud Messages of the time for each bugs. If you buy 1 it shows you timer for it, but if you buy both it shows both timers at same spot and the hud always changes.
Another Bug is if you buy No Fall Damage it doenst go away if you die. So if you buy it once you have it the whole map, i want that it only holds for 1 round or when you die.
Thats alot of changes but please can someone do it for me?
Thanks
PHP Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #include <fakemeta> #include <engine> #include <fun>
new const PLUGIN[ ] = "HideNSeek Shop"; new const VERSION[ ] = "1.0"; new const CLAN_TAG[ ] = "[HNSShop]"; // Your clan tag goes here
#define BOOTS_TIME 13.0 #define STEALTH_TIME 12.0 #define CAMO_TIME 12.0
#define BOOTS_COUNTDOWN 13 #define STEALTH_COUNTDOWN 12 #define CAMO_COUNTDOWN 12
native add_user_immune( id ); native remove_user_immune( id );
native hnsxp_get_user_xp( id ); native hnsxp_set_user_xp( id, xp );
stock hnsxp_add_user_xp( id, xp ) { return hnsxp_set_user_xp( id, hnsxp_get_user_xp( id ) + xp ); }
enum _:ItemStruct { Name[32], Cost };
new const g_HealthInfo[6][ItemStruct] = { { "25 Health", 5000 }, { "50 Health", 1 }, { "75 Health", 1 }, { "100 Health", 1 }, { "125 Health", 1 }, { "150 Health", 1 } };
new const g_ArmorInfo[6][ItemStruct] = { { "25 Armor", 1 }, { "50 Armor", 1 }, { "75 Armor", 1 }, { "100 Armor", 1 }, { "125 Armor", 1 }, { "150 Armor", 1 } };
new const g_XPInfo[6][ItemStruct] = { { "25 XP", 1 }, { "50 XP", 1 }, { "75 XP", 1 }, { "100 XP", 1 }, { "125 XP", 1 }, { "150 XP", 1 } };
new const g_WeaponInfo[5][ItemStruct] = { { "Awp", 1 }, { "Deagle", 1 }, { "HE Grenade", 1 }, { "Frost Nade", 1 }, { "Flashbang", 1 } };
new const g_AmmoInfo[4][ItemStruct] = { { "1 Awp Bullet", 1 }, { "2 Awp Bullets", 1 }, { "1 Deagle Bullet", 1 }, { "2 Deagle Bullets", 1 } };
new const g_PowerInfo[6][ItemStruct] = { { "Anti-Flash", 1 }, { "Anti-Frost", 1 }, { "No Fall Damage", 1 }, { "Boots of Speed", 1 }, { "Stealth", 1 }, { "Camouflage", 1 } };
new pCvar_enable;
new bool:g_bRespawnUsed[33]; new bool:g_bHasNoFrost[33], bool:g_bHasNoFall[33], bool:g_bHasNoFlash[33], bool:g_bHasBoots[33], bool:g_bHasStealth[33]; new bool:g_bHasCamo[33]; new bool:g_bHasAwp[33], bool:g_bHasDeagle[33]; new bool:g_bHas1Awp[33], bool:g_bHas2Awp[33], bool:g_bHas1Deagle[33], bool:g_bHas2Deagle[33]; new bool:g_bHasFlash[33], bool:g_bHasFrost[33], bool:g_bHasGrenade[33]; new bool:g_bHas25HP[33], bool:g_bHas50HP[33], bool:g_bHas75HP[33], bool:g_bHas100HP[33], bool:g_bHas125HP[33], bool:g_bHas150HP[33]; new bool:g_bHas25AM[33], bool:g_bHas50AM[33], bool:g_bHas75AM[33], bool:g_bHas100AM[33], bool:g_bHas125AM[33], bool:g_bHas150AM[33]; new bool:g_bHas25XP[33], bool:g_bHas50XP[33], bool:g_bHas75XP[33], bool:g_bHas100XP[33], bool:g_bHas125XP[33], bool:g_bHas150XP[33];
new g_iBootTime, g_iCamoTime, g_iStealthTime;
new bool:g_track_enemy; new bool:g_track[33]; new Float:g_gametime, g_owner; new Float:g_gametime2; new grenade[32], last; new g_sync_check_data;
new g_msgScreenFade; new g_HudSyncInfo;
public plugin_init( ) { register_plugin( PLUGIN, VERSION, "Kreation" ); register_cvar( "shop_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY ); pCvar_enable = register_cvar( "shop_enable", "1", FCVAR_SERVER ); register_clcmd( "say /shop", "CmdMainMenu" ); register_clcmd( "say shop", "CmdMainMenu" ); register_clcmd( "say_team /shop", "CmdMainMenu" ); register_clcmd( "say_team shop", "CmdMainMenu" ); register_event( "DeathMsg", "EventDeath", "a" ); register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199"); register_event("TextMsg", "fire_in_the_hole", "b", "2&#Game_radio", "4&#Fire_in_the_hole"); register_event("TextMsg", "fire_in_the_hole2", "b", "3&#Game_radio", "5&#Fire_in_the_hole"); register_event("99", "grenade_throw", "b"); register_forward( FM_EmitSound, "fw_emitsound" ); register_forward( FM_PlayerPreThink, "FwdPlayerPreThink", 0 ); register_logevent( "EventRoundStart", 2, "1=Round_Start" ); g_msgScreenFade = get_user_msgid( "ScreenFade" ); g_HudSyncInfo = CreateHudSyncObj( ); }
public plugin_natives( ) { register_library( "sc_shop" ); register_native( "get_user_antiflash", "_get_user_antiflash" ); }
public _get_user_antiflash( iPlugin, iParams ) { new iClient = get_param( 1 ); if( g_bHasNoFlash[iClient] ) return 1; else return 0; return -1; }
public client_connect( id ) { g_bHasNoFlash[id] = false; g_bHasNoFrost[id] = false; g_bHasNoFall[id] = false; g_bHasBoots[id] = false; g_bHasStealth[id] = false; g_bHasCamo[id] = false; g_bHasFlash[id] = false; g_bHasFrost[id] = false; g_bHasGrenade[id] = false; g_bHasAwp[id] = false; g_bHasDeagle[id] = false; g_bHas1Awp[id] = false; g_bHas2Awp[id] = false; g_bHas1Deagle[id] = false; g_bHas2Deagle[id] = false; g_bHas25HP[id] = false; g_bHas50HP[id] = false; g_bHas75HP[id] = false; g_bHas100HP[id] = false; g_bHas125HP[id] = false; g_bHas150HP[id] = false; g_bHas25AM[id] = false; g_bHas50AM[id] = false; g_bHas75AM[id] = false; g_bHas100AM[id] = false; g_bHas125AM[id] = false; g_bHas150AM[id] = false; g_bHas25XP[id] = false; g_bHas50XP[id] = false; g_bHas75XP[id] = false; g_bHas100XP[id] = false; g_bHas125XP[id] = false; g_bHas150XP[id] = false; remove_user_immune( id ); if( task_exists( 550 ) ) remove_task( 550 ); if( task_exists( 551 ) ) remove_task( 551 ); if( task_exists( 552 ) ) remove_task( 552 ); }
public FwdPlayerPreThink( id ) { if( is_user_alive( id ) && g_bHasNoFall[id] ) { set_pev( id, pev_watertype, -3 ); } else { set_pev( id, pev_watertype, -1 ); } }
public EventRoundStart( ) { new players[32], pnum, id; get_players( players, pnum ); for( new i = 0; i < pnum; i++ ) { id = players[i]; if( is_user_connected( id ) ) { g_bHasNoFlash[id] = false; g_bHasNoFrost[id] = false; g_bHasNoFall[id] = false; g_bHasBoots[id] = false; g_bHasStealth[id] = false; g_bHasCamo[id] = false; g_bHasFlash[id] = false; g_bHasFrost[id] = false; g_bHasGrenade[id] = false; g_bHasAwp[id] = false; g_bHasDeagle[id] = false; g_bHas1Awp[id] = false; g_bHas2Awp[id] = false; g_bHas1Deagle[id] = false; g_bHas2Deagle[id] = false; g_bHas25HP[id] = false; g_bHas50HP[id] = false; g_bHas75HP[id] = false; g_bHas100HP[id] = false; g_bHas125HP[id] = false; g_bHas150HP[id] = false; g_bHas25AM[id] = false; g_bHas50AM[id] = false; g_bHas75AM[id] = false; g_bHas100AM[id] = false; g_bHas125AM[id] = false; g_bHas150AM[id] = false; g_bHas25XP[id] = false; g_bHas50XP[id] = false; g_bHas75XP[id] = false; g_bHas100XP[id] = false; g_bHas125XP[id] = false; g_bHas150XP[id] = false; remove_user_immune( id ); } } }
public EventDeath( ) { new id = read_data( 2 ); g_bHasNoFlash[id] = false; g_bHasNoFrost[id] = false; g_bHasNoFall[id] = false; g_bHasBoots[id] = false; g_bHasStealth[id] = false; g_bHasCamo[id] = false; g_bHasFlash[id] = false; g_bHasFrost[id] = false; g_bHasGrenade[id] = false; g_bHasAwp[id] = false; g_bHasDeagle[id] = false; g_bHas1Awp[id] = false; g_bHas2Awp[id] = false; g_bHas1Deagle[id] = false; g_bHas2Deagle[id] = false; g_bHas25HP[id] = false; g_bHas50HP[id] = false; g_bHas75HP[id] = false; g_bHas100HP[id] = false; g_bHas125HP[id] = false; g_bHas150HP[id] = false; g_bHas25AM[id] = false; g_bHas50AM[id] = false; g_bHas75AM[id] = false; g_bHas100AM[id] = false; g_bHas125AM[id] = false; g_bHas150AM[id] = false; g_bHas25XP[id] = false; g_bHas50XP[id] = false; g_bHas75XP[id] = false; g_bHas100XP[id] = false; g_bHas125XP[id] = false; g_bHas150XP[id] = false; remove_user_immune( id ); }
public CmdMainMenu( id ) { if( !get_pcvar_num( pCvar_enable ) ) return PLUGIN_HANDLED; new main = menu_create( "HideNSeek Shop", "main_handler" ); menu_additem( main, "Health Menu", "1" ); menu_additem( main, "Armor Menu", "2" ); if( get_user_team( id ) == 1 ) menu_additem( main, "Weapon Menu", "3" ); menu_additem( main, "Ammo Menu", "4" ); menu_additem( main, "Power Menu", "5" ); menu_additem( main, "XP Menu", "6" ); new info[70]; formatex( info, sizeof( info ) - 1, "%sRespawn ( 1 Per Map )", g_bRespawnUsed[id] ? "\d" : "\w" ); menu_additem( main, info, "7" ); menu_setprop( main, MPROP_EXIT, MEXIT_ALL ); menu_display( id, main, 0 ); return PLUGIN_CONTINUE; }
public main_handler( id, main, item ) { if( item == MENU_EXIT ) { menu_destroy( main ); return PLUGIN_HANDLED; } new data[6], iName[64], access, callback; menu_item_getinfo( main, item, access, data, 5, iName, 63, callback ); new picked = str_to_num( data ); switch( picked ) { case 1: { CmdHealthMenu( id ); } case 2: { CmdArmorMenu( id ); } case 3: { CmdWeaponMenu( id ); } case 4: { CmdAmmoMenu( id ); } case 5: { CmdPowerMenu( id ); } case 6: { CmdXPMenu( id ); } case 7: { if( !g_bRespawnUsed[id] ) { if( !is_user_alive( id ) ) { ExecuteHamB( Ham_CS_RoundRespawn, id ); g_bRespawnUsed[id] = true; client_print( id, print_chat, "%s You have been respawned!", CLAN_TAG ); } else { client_print( id, print_chat, "%s You must be dead to respawn!", CLAN_TAG ); return PLUGIN_HANDLED; } } } } menu_destroy( main ); return PLUGIN_HANDLED; }
public CmdHealthMenu( id ) { new hmenu = menu_create( "Health Menu", "health_handler" ); menu_additem( hmenu, g_HealthInfo[0][Name], "1" ); menu_additem( hmenu, g_HealthInfo[1][Name], "2" ); menu_additem( hmenu, g_HealthInfo[2][Name], "3" ); menu_additem( hmenu, g_HealthInfo[3][Name], "4" ); menu_additem( hmenu, g_HealthInfo[4][Name], "5" ); menu_additem( hmenu, g_HealthInfo[5][Name], "6" ); menu_setprop( hmenu, MPROP_EXIT, MEXIT_ALL ); menu_setprop( hmenu, MPROP_EXITNAME, "\wBack" ); menu_display( id, hmenu, 0 ); }
public health_handler( id, hmenu, item ) { if( item == MENU_EXIT ) { menu_destroy( hmenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo( hmenu, item, access, data, 5, iName, 63, callback ); new picked = str_to_num( data ); new money = cs_get_user_money( id ); switch( picked ) { case 1: { if( money >= g_HealthInfo[0][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas25HP[id] ) { cs_set_user_money( id, money - g_HealthInfo[0][Cost] ); new health = get_user_health( id ) + 25; set_user_health( id, health ); g_bHas25HP[id] = true; client_cmd( id, "spk items/medshot4" ); } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 2: { if( money >= g_HealthInfo[1][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas50HP[id] ) { cs_set_user_money( id, money - g_HealthInfo[1][Cost] ); new health = get_user_health( id ) + 50; set_user_health( id, health ); g_bHas50HP[id] = true; client_cmd( id, "spk items/medshot4" ); } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 3: { if( money >= g_HealthInfo[2][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas75HP[id] ) { cs_set_user_money( id, money - g_HealthInfo[2][Cost] ) new health = get_user_health( id ) + 75; set_user_health( id, health ); g_bHas75HP[id] = true; client_cmd( id, "spk items/medshot4" ); } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 4: { if( money >= g_HealthInfo[3][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas100HP[id] ) { cs_set_user_money( id, money - g_HealthInfo[3][Cost] ); new health = get_user_health( id ) + 100; set_user_health( id, health ); g_bHas100HP[id] = true; client_cmd( id, "spk items/medshot4" ); } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 5: { if( money >= g_HealthInfo[4][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas125HP[id] ) { cs_set_user_money( id, money - g_HealthInfo[4][Cost] ); new health = get_user_health( id ) + 125; set_user_health( id, health ); g_bHas125HP[id] = true; client_cmd( id, "spk items/medshot4" ); } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 6: { if( money >= g_HealthInfo[5][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas150HP[id] ) { cs_set_user_money( id, money - g_HealthInfo[5][Cost] ); new health = get_user_health( id ) + 150; set_user_health( id, health ); g_bHas150HP[id] = true; client_cmd( id, "spk items/medshot4" ); } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } } menu_destroy( hmenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; }
public CmdArmorMenu( id ) { new amenu = menu_create( "Armor Menu", "armor_handler" ); menu_additem( amenu, g_ArmorInfo[0][Name], "1" ); menu_additem( amenu, g_ArmorInfo[1][Name], "2" ); menu_additem( amenu, g_ArmorInfo[2][Name], "3" ); menu_additem( amenu, g_ArmorInfo[3][Name], "4" ); menu_additem( amenu, g_ArmorInfo[4][Name], "5" ); menu_additem( amenu, g_ArmorInfo[5][Name], "6" ); menu_setprop( amenu, MPROP_EXIT, MEXIT_ALL ); menu_setprop( amenu, MPROP_EXITNAME, "\wBack" ); menu_display( id, amenu, 0 ); }
public armor_handler( id, amenu, item ) { if( item == MENU_EXIT ) { menu_destroy( amenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo( amenu, item, access, data, 5, iName, 63, callback ); new picked = str_to_num( data ); new money = cs_get_user_money( id ); switch( picked ) { case 1: { if( money >= g_ArmorInfo[0][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas25AM[id] ) { cs_set_user_money( id, money - g_ArmorInfo[0][Cost] ); new armor = get_user_armor( id ) + 25; set_user_armor( id, armor ); g_bHas25AM[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 2: { if( money >= g_ArmorInfo[1][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas50AM[id] ) { cs_set_user_money( id, money - g_ArmorInfo[1][Cost] ); new armor = get_user_armor( id ) + 50; set_user_armor( id, armor ); g_bHas50AM[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 3: { if( money >= g_ArmorInfo[2][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas75AM[id] ) { cs_set_user_money( id, money - g_ArmorInfo[2][Cost] ) new armor = get_user_armor( id ) + 75; set_user_armor( id, armor ); g_bHas75AM[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 4: { if( money >= g_ArmorInfo[3][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas100AM[id] ) { cs_set_user_money( id, money - g_ArmorInfo[3][Cost] ); new armor = get_user_armor( id ) + 100; set_user_armor( id, armor ); g_bHas100AM[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 5: { if( money >= g_ArmorInfo[4][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas125AM[id] ) { cs_set_user_money( id, money - g_ArmorInfo[4][Cost] ); new armor = get_user_armor( id ) + 125; set_user_armor( id, armor ); g_bHas125AM[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 6: { if( money >= g_ArmorInfo[5][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas150AM[id] ) { cs_set_user_money( id, money - g_ArmorInfo[5][Cost] ); new armor = get_user_armor( id ) + 150; set_user_armor( id, armor ); g_bHas150AM[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } } menu_destroy( amenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; }
public CmdWeaponMenu( id ) { new wmenu = menu_create( "Weapon Menu", "weapon_handler" ); menu_additem( wmenu, g_WeaponInfo[0][Name], "1" ); menu_additem( wmenu, g_WeaponInfo[1][Name], "2" ); menu_additem( wmenu, g_WeaponInfo[2][Name], "3" ); menu_additem( wmenu, g_WeaponInfo[3][Name], "4" ); menu_additem( wmenu, g_WeaponInfo[4][Name], "5" ); menu_setprop( wmenu, MPROP_EXIT, MEXIT_ALL ); menu_setprop( wmenu, MPROP_EXITNAME, "\wBack" ); menu_display( id, wmenu, 0 ); }
public weapon_handler( id, wmenu, item ) { if( item == MENU_EXIT ) { menu_destroy( wmenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo( wmenu, item, access, data, 5, iName, 63, callback ); new picked = str_to_num( data ); new money = cs_get_user_money( id ); switch( picked ) { case 1: { if( money >= g_WeaponInfo[0][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasAwp[id] ) { cs_set_user_money( id, money - g_WeaponInfo[0][Cost] ); give_item( id, "weapon_awp" ); cs_set_weapon_ammo( find_ent_by_owner( 1, "weapon_awp", id ), 1 ); g_bHasAwp[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 2: { if( money >= g_WeaponInfo[1][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasDeagle[id] ) { cs_set_user_money( id, money - g_WeaponInfo[1][Cost] ); give_item( id, "weapon_deagle" ); cs_set_weapon_ammo( find_ent_by_owner( 1, "weapon_deagle", id ), 1 ); g_bHasDeagle[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 3: { if( money >= g_WeaponInfo[2][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasGrenade[id] ) { cs_set_user_money( id, money - g_WeaponInfo[2][Cost] ); give_item( id, "weapon_hegrenade" ); g_bHasGrenade[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 4: { if( money >= g_WeaponInfo[3][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasFrost[id] ) { cs_set_user_money( id, money - g_WeaponInfo[3][Cost] ); give_item( id, "weapon_smokegrenade" ); g_bHasFrost[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 5: { if( money >= g_WeaponInfo[4][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasFlash[id] ) { cs_set_user_money( id, money - g_WeaponInfo[4][Cost] ); give_item( id, "weapon_flashbang" ); g_bHasFlash[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } } menu_destroy( wmenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; }
public CmdAmmoMenu( id ) { new ammomenu = menu_create( "Ammo Menu", "ammo_handler" ); menu_additem( ammomenu, g_AmmoInfo[0][Name], "1" ); menu_additem( ammomenu, g_AmmoInfo[1][Name], "2" ); menu_additem( ammomenu, g_AmmoInfo[2][Name], "3" ); menu_additem( ammomenu, g_AmmoInfo[3][Name], "4" ); menu_setprop( ammomenu, MPROP_EXIT, MEXIT_ALL ); menu_setprop( ammomenu, MPROP_EXITNAME, "\wBack" ); menu_display( id, ammomenu, 0 ); }
public ammo_handler( id, ammomenu, item ) { if( item == MENU_EXIT ) { menu_destroy( ammomenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo( ammomenu, item, access, data, 5, iName, 63, callback ); new picked = str_to_num( data ); new money = cs_get_user_money( id ); switch( picked ) { case 1: { if( money >= g_AmmoInfo[0][Cost] ) { if( is_user_alive( id ) ) { if( user_has_weapon( id, CSW_AWP, 0 ) ) { if( !g_bHas1Awp[id] ) { cs_set_user_money( id, money - g_AmmoInfo[0][Cost] ); cs_add_weapon_ammo( id, CSW_AWP, 1 ); g_bHas1Awp[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have an Awp!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 2: { if( money >= g_AmmoInfo[1][Cost] ) { if( is_user_alive( id ) ) { if( user_has_weapon( id, CSW_AWP, 0 ) ) { if( !g_bHas2Awp[id] ) { cs_set_user_money( id, money - g_AmmoInfo[1][Cost] ); cs_add_weapon_ammo( id, CSW_AWP, 2 ); g_bHas2Awp[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have an Awp!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 3: { if( money >= g_AmmoInfo[2][Cost] ) { if( is_user_alive( id ) ) { if( user_has_weapon( id, CSW_DEAGLE, 0 ) ) { if( !g_bHas1Deagle[id] ) { cs_set_user_money( id, money - g_AmmoInfo[2][Cost] ); cs_add_weapon_ammo( id, CSW_DEAGLE, 1 ); g_bHas1Deagle[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have a Deagle!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 4: { if( money >= g_AmmoInfo[3][Cost] ) { if( is_user_alive( id ) ) { if( user_has_weapon( id, CSW_DEAGLE, 0 ) ) { if( !g_bHas2Deagle[id] ) { cs_set_user_money( id, money - g_AmmoInfo[3][Cost] ); cs_add_weapon_ammo( id, CSW_DEAGLE, 2 ); g_bHas2Deagle[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have a Deagle!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } } menu_destroy( ammomenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; }
public CmdPowerMenu( id ) { new pmenu = menu_create( "Power Menu", "power_handler" ); menu_additem( pmenu, g_PowerInfo[0][Name], "1" ); menu_additem( pmenu, g_PowerInfo[1][Name], "2" ); menu_additem( pmenu, g_PowerInfo[2][Name], "3" ); menu_additem( pmenu, g_PowerInfo[3][Name], "4" ); menu_additem( pmenu, g_PowerInfo[4][Name], "5" ); menu_additem( pmenu, g_PowerInfo[5][Name], "6" ); menu_setprop( pmenu, MPROP_EXIT, MEXIT_ALL ); menu_setprop( pmenu, MPROP_EXITNAME, "\wBack" ); menu_display( id, pmenu, 0 ); }
public power_handler( id, pmenu, item ) { if( item == MENU_EXIT ) { menu_destroy( pmenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo( pmenu, item, access, data, 5, iName, 63, callback ); new picked = str_to_num( data ); new money = cs_get_user_money( id ); switch( picked ) { case 1: { if( money >= g_PowerInfo[0][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasNoFlash[id] ) { cs_set_user_money( id, money - g_PowerInfo[0][Cost] ); g_bHasNoFlash[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 2: { if( money >= g_PowerInfo[1][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasNoFrost[id] ) { cs_set_user_money( id, money - g_PowerInfo[1][Cost] ); add_user_immune( id ); g_bHasNoFrost[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 3: { if( money >= g_PowerInfo[2][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasNoFall[id] ) { cs_set_user_money( id, money - g_PowerInfo[2][Cost] ); g_bHasNoFall[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 4: { if( money >= g_PowerInfo[3][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasBoots[id] ) { cs_set_user_money( id, money - g_PowerInfo[3][Cost] ); set_user_maxspeed( id, 320.0 ); g_bHasBoots[id] = true; set_task( BOOTS_TIME, "RemoveBoots", id ); g_iBootTime = BOOTS_COUNTDOWN; set_task( 1.0, "BootsCountdown", 550, _, _, "a", BOOTS_COUNTDOWN ); } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 5: { if( money >= g_PowerInfo[4][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasStealth[id] ) { cs_set_user_money( id, money - g_PowerInfo[4][Cost] ); set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 0 ); g_bHasStealth[id] = true; set_task( STEALTH_TIME, "RemoveStealth", id ); g_iStealthTime = STEALTH_COUNTDOWN; set_task( 1.0, "StealthCountdown", 551, _, _, "a", STEALTH_COUNTDOWN ); } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 6: { if( money >= g_PowerInfo[5][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHasCamo[id] ) { cs_set_user_money( id, money - g_PowerInfo[5][Cost] ); new CsTeams:iTeam = cs_get_user_team( id ); if( iTeam == CS_TEAM_T ) { cs_set_user_model( id, "urban" ); } else if( iTeam == CS_TEAM_CT ) { cs_set_user_model( id, "leet" ); } else { client_print( id, print_chat, "%s You must be on a team before you buy this!" ); return PLUGIN_HANDLED; } g_bHasCamo[id] = true; set_task( CAMO_TIME, "RemoveCamo", id ); g_iCamoTime = CAMO_COUNTDOWN; set_task( 1.0, "CamoCountdown", 552, _, _, "a", CAMO_COUNTDOWN ); } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } } menu_destroy( pmenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; }
public CmdXPMenu( id ) { new xpmenu = menu_create( "XP Menu", "xp_handler" ); menu_additem( xpmenu, g_XPInfo[0][Name], "1" ); menu_additem( xpmenu, g_XPInfo[1][Name], "2" ); menu_additem( xpmenu, g_XPInfo[2][Name], "3" ); menu_additem( xpmenu, g_XPInfo[3][Name], "4" ); menu_additem( xpmenu, g_XPInfo[4][Name], "5" ); menu_additem( xpmenu, g_XPInfo[5][Name], "6" ); menu_setprop( xpmenu, MPROP_EXIT, MEXIT_ALL ); menu_setprop( xpmenu, MPROP_EXITNAME, "\wBack" ); menu_display( id, xpmenu, 0 ); }
public xp_handler( id, xpmenu, item ) { if( item == MENU_EXIT ) { menu_destroy( xpmenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo( xpmenu, item, access, data, 5, iName, 63, callback ); new picked = str_to_num( data ); new money = cs_get_user_money( id ); switch( picked ) { case 1: { if( money >= g_XPInfo[0][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas25XP[id] ) { cs_set_user_money( id, money - g_XPInfo[0][Cost] ); hnsxp_add_user_xp( id, 25 ); g_bHas25XP[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 2: { if( money >= g_XPInfo[1][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas50XP[id] ) { cs_set_user_money( id, money - g_XPInfo[1][Cost] ); hnsxp_add_user_xp( id, 50 ); g_bHas50XP[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 3: { if( money >= g_XPInfo[2][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas75XP[id] ) { cs_set_user_money( id, money - g_XPInfo[2][Cost] ); hnsxp_add_user_xp( id, 75 ); g_bHas75XP[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 4: { if( money >= g_XPInfo[3][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas100XP[id] ) { cs_set_user_money( id, money - g_XPInfo[3][Cost] ); hnsxp_add_user_xp( id, 100 ); g_bHas100XP[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 5: { if( money >= g_XPInfo[4][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas125XP[id] ) { cs_set_user_money( id, money - g_XPInfo[4][Cost] ); hnsxp_add_user_xp( id, 125 ); g_bHas125XP[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } case 6: { if( money >= g_XPInfo[5][Cost] ) { if( is_user_alive( id ) ) { if( !g_bHas150XP[id] ) { cs_set_user_money( id, money - g_XPInfo[5][Cost] ); hnsxp_add_user_xp( id, 150 ); g_bHas150XP[id] = true; } else { client_print( id, print_chat, "%s You already bought this item!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You must be alive to use the shop!", CLAN_TAG ); return PLUGIN_HANDLED; } } else { client_print( id, print_chat, "%s You don't have enough money for this!", CLAN_TAG ); return PLUGIN_HANDLED; } } } menu_destroy( xpmenu ); CmdMainMenu( id ); return PLUGIN_HANDLED; }
public RemoveBoots( id ) { if( is_user_connected( id ) ) { set_user_maxspeed( id, 250.0 ); } //remove_task( BOOTSID ); }
public RemoveStealth( id ) { if( is_user_connected( id ) ) { set_user_rendering( id ); } //remove_task( STEALTHID ); }
public RemoveCamo( id ) { if( is_user_connected( id ) ) { cs_reset_user_model( id ); } //remove_task( id ); }
public CamoCountdown( ) { set_hudmessage( 255, 255, 0, -1.0, 0.87, 0, 0.0, 12.0, 0.1, 0.2, -1 ); ShowSyncHudMsg( 0, g_HudSyncInfo, "Camouflage Time: %i", g_iCamoTime-- ); }
public StealthCountdown( ) { set_hudmessage( 255, 255, 0, -1.0, 0.87, 0, 0.0, 12.0, 0.1, 0.2, -1 ); ShowSyncHudMsg( 0, g_HudSyncInfo, "Stealth Time: %i", g_iStealthTime-- ); }
public BootsCountdown( ) { set_hudmessage( 255, 255, 0, -1.0, 0.87, 0, 0.0, 12.0, 0.1, 0.2, 2 ); ShowSyncHudMsg( 0, g_HudSyncInfo, "Boots Time: %i", g_iBootTime-- ); }
/// NoFlash Blinding - Start public bad_fix2() { new Float:gametime = get_gametime(); if(gametime - g_gametime2 > 2.5) for(new i = 0; i < 32; i++) grenade[i] = 0; }
public eventFlash( id ) { new Float:gametime = get_gametime(); if(gametime != g_gametime) { g_owner = get_grenade_owner(); g_gametime = gametime; for(new i = 0; i < 33; i++) g_track[i] = false; g_track_enemy = false; } if(is_user_connected(g_owner) && g_bHasNoFlash[id] ) { g_track_enemy = true;
message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id); write_short(1); write_short(1); write_short(1); write_byte(0); write_byte(0); write_byte(0); write_byte(255); message_end(); } }
public flash_delay() { if(g_track_enemy == false) { for(new i = 0; i < 33; i++) { if(g_track[i] == true && is_user_connected(i)) { message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, i) ; write_short(1); write_short(1); write_short(1); write_byte(0); write_byte(0); write_byte(0); write_byte(255); message_end(); } } } }
public grenade_throw() { if(g_sync_check_data == 0) return PLUGIN_CONTINUE; g_sync_check_data--; if(read_datanum() < 2) return PLUGIN_HANDLED_MAIN;
if(read_data(1) == 11 && (read_data(2) == 0 || read_data(2) == 1)) add_grenade_owner(last);
return PLUGIN_CONTINUE; }
public fire_in_the_hole() { new name[32]; read_data(3, name, 31); new temp_last = get_user_index(name); new junk; if((temp_last == 0) || (!is_user_connected(temp_last))) return PLUGIN_CONTINUE; if(get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG) { last = temp_last; g_sync_check_data = 2; } return PLUGIN_CONTINUE; }
public fire_in_the_hole2() { new name[32]; read_data(4, name, 31); new temp_last = get_user_index(name); new junk; if((temp_last == 0) || (!is_user_connected(temp_last))) return PLUGIN_CONTINUE; if(get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG) { last = temp_last; g_sync_check_data = 2; } return PLUGIN_CONTINUE; }
add_grenade_owner(owner) { new Float:gametime = get_gametime(); g_gametime2 = gametime; for(new i = 0; i < 32; i++) { if(grenade[i] == 0) { grenade[i] = owner; return; } } }
get_grenade_owner() { new which = grenade[0]; for(new i = 1; i < 32; i++) grenade[i-1] = grenade[i]; grenade[31] = 0; return which; }
// from XxAvalanchexX "Flashbang Dynamic Light" public fw_emitsound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch) { if(!equali(sample,"weapons/flashbang-1.wav") && !equali(sample,"weapons/flashbang-2.wav")) return FMRES_IGNORED;
new Float:gametime = get_gametime();
//in case no one got flashed, the sound happens after all the flashes, same game time if(gametime != g_gametime) { g_owner = get_grenade_owner(); return FMRES_IGNORED; } return FMRES_IGNORED; } // NoFlash Blinding - End
stock cs_add_weapon_ammo( id, weapon, amt=1 ) { if( is_user_alive( id ) ) { new bad_weapons_bitsum = ( ( 1 << CSW_KNIFE ) | ( 1 << CSW_HEGRENADE ) | ( 1 << CSW_FLASHBANG ) | ( 1 << CSW_SMOKEGRENADE ) | ( 1 << 2 ) ); if( !( ( 1 << weapon ) & bad_weapons_bitsum ) ) { new wname[20]; get_weaponname( weapon, wname, 19 ); new iWep = find_ent_by_owner( iWep, wname, id, 0 ); if( iWep ) { cs_set_weapon_ammo( iWep, cs_get_weapon_ammo( iWep ) + amt ); return iWep; } } } return 0; }
|