| MyEyesGreen |
06-17-2010 10:34 |
Help with Hns Shop
i try to make shop
and i have to much problem and i don't know what the problem
Some one can fix all my plugin ?
Here the plugin:
PHP Code:
/* * <-----------------> * Coded in 2010. * By Lw. * <-----------------> * * .:: Description ::. * * Hide'N'Seek Shop. * * .:: Contacts ::. * * Email: [email protected] * * Steam: ilovemycat12 */
#include <amxmodx> #include <fun> #include <cstrike> #include <fakemeta> #include <chatcolor>
#define PLUGIN "Hns-Shop" #define AUTHOR "Lw." #define VERSION "1.0"
#define get_user_money(%1) get_pdata_int( %1, 115 )
#define cs_get_user_money(%1) get_pdata_int( %1, 115 )
#define MAX_CLIENTS 32
native hnsxp_get_user_xp(client);
native hnsxp_set_user_xp(client, xp);
stock hnsxp_add_user_xp(client, xp) { return hnsxp_set_user_xp(client, hnsxp_get_user_xp(client) + xp); }
native add_user_immune( id ) native remove_user_immune( id )
// other pcvars new plugin_on
// cfg new cfg[] = "\addons\amxmodx\configs\Hns-Shop.cfg"
// Amount of health and xp and such... new hpcvar; new xpcvar;
// cost pcvars new HEgrenadecost, Flashbangcost, Smokegrenadecost, Awpcost, Deaglecost, HPcost, Armorcost, Nofalldamagecost, Antiflashcost, Antifrostcost, Stealthcost, Camocost, Respawncost, Xpcost; new allowHEgrenade, allowFlashbang, allowSmokegrenade, allowAwp, allowDeagle, allowHP, allowArmor, allowNofalldamage, allowAntiFlash, allowAntifrost, allowStealth, allowCamo, allowRespawn, allowXp; new userHEgrenade[33], userFlashbang[33], userSmokegrenade[33], userAwp[33], userDeagle[33], userHP[33], userArmor[33], userNofalldamage[33], userAntiflash[33], userAntifrost[33], userStealth[33], userCamo[33], userRespawn[33], userXp[33];
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_cvar("Hns-Shop_version", VERSION, FCVAR_SERVER); set_cvar_string("Hns-Shop_version", VERSION); // Player Spawn plugin_on = register_cvar( "shop_on", "1");
// Events register_event("DeathMsg", "eDeath", "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"); // Pcvars plugin_on = register_cvar("hns_shop", "1"); HEgrenadecost = register_cvar("HEgrenade_cost", "1"); Flashbangcost = register_cvar("Flashbang_cost", "1"); Smokegrenadecost = register_cvar("Smokegrenade_cost", "1"); Awpcost = register_cvar("Awp_cost", "1"); Deaglecost = register_cvar("Deagle_cost", "1"); HPcost = register_cvar("HP_cost", "1"); Armorcost = register_cvar("Armor_cost", "1"); Nofalldamagecost = register_cvar("Nofalldamage_cost", "1"); Antiflashcost = register_cvar("Antiflash_cost", "1"); Antifrostcost = register_cvar("Antifrost_cost", "1"); Stealthcost = register_cvar("Stealth_cost", "1"); Camocost = register_cvar("Camo_cost", "1"); Respawncost = register_cvar("Respawn_cost", "1"); Xpcost = register_cvar("Xp_cost", "1"); allowHEgrenade = register_cvar("allowHEgrenade", "1"); allowFlashbang = register_cvar("allowFlashbang", "1"); allowSmokegrenade = register_cvar("allowSmokegrenade", "1"); allowAwp = register_cvar("allowAwp", "1"); allowDeagle = register_cvar("allowDeagle", "1"); allowHP = register_cvar("allowHP", "1"); allowArmor = register_cvar("allowArmor", "1"); allowNofalldamage = register_cvar("allowNofalldamage", "1"); allowAntiFlash = register_cvar("allowAntiflash", "1"); allowAntifrost = register_cvar("allowAntifrost", "1"); allowStealth = register_cvar("allowStealth", "1"); allowCamo = register_cvar("allowCamo", "1"); allowRespawn = register_cvar("allowRespawn", "1"); allowXp = register_cvar("allowXp", "1"); hpcvar = register_cvar( "hp_amount", "150"); xpcvar = register_cvar( "xp_amount", "150"); // Clcmds register_clcmd( "say /shop", "hideNseek" ); register_clcmd( "say shop", "hideNseek" ); register_clcmd( "say_team /shop", "hideNseek" ); register_clcmd( "say_team shop", "hideNseek" ); register_clcmd( "say /hnsshop", "hideNseek" ); register_clcmd( "say hnsshop", "hideNseek" ); register_clcmd( "say_team /hnsshop", "hideNseek" ); register_clcmd( "say_team hnsshop", "hideNseek" ); // Forwards register_forward(FM_EmitSound,"fw_emitsound"); register_forward(FM_CmdStart, "fwd_FM_CmdStart_pre", 0);
// Tasks set_task( 2.0, "bad_fix2",_,_,_, "b" ); set_task( 100.0, "advert",_,_,_, "b" ); }
public plugin_cfg() { if (!file_exists(cfg)) { write_file(cfg, "// other cfg"); write_file(cfg, "shop_on 1"); write_file(cfg, ""); write_file(cfg, ""); write_file(cfg, "// Cost cvars"); write_file(cfg, "HEgrenade_cost 1"); write_file(cfg, "Flashbang_cost 1"); write_file(cfg, "Smokegrenade_cost 1"); write_file(cfg, "Awp_cost 1"); write_file(cfg, "Deagle_cost"); write_file(cfg, "HP_cost 1"); write_file(cfg, "Armor_cost 1"); write_file(cfg, "Nofalldamage 1"); write_file(cfg, "Antiflash 1"); write_file(cfg, "Antifrost 1"); write_file(cfg, "Stealth_cost 1"); write_file(cfg, "Camo_cost 1"); write_file(cfg, "Respawn_cost 1"); write_file(cfg, "Xp_cost 1"); write_file(cfg, ""); write_file(cfg, "") ; write_file(cfg, "// amount cvars"); write_file(cfg, "hp_amount 250"); write_file(cfg, "xp_amount 150") write_file(cfg, "// Allow cvars"); write_file(cfg, "allowHEgrenade 1"); write_file(cfg, "allowFlashbang 1"); write_file(cfg, "allowSmokegrenade 1"); write_file(cfg, "allowAwp 1"); write_file(cfg, "allowDeagle 1"); write_file(cfg, "allowHP 1"); write_file(cfg, "allowArmor 1"); write_file(cfg, "allowNofalldamage 1"); write_file(cfg, "allowAntiflash 1"); write_file(cfg, "allowAntifrost 1"); write_file(cfg, "allowStealth 1"); write_file(cfg, "allowCamo 1"); write_file(cfg, "allowRespawn 1"); write_file(cfg, "allowXp 1"); write_file(cfg, "echo Hns Shop CFG succesfully loaded");
console_print(0, "%s file not found. creating new ...", cfg); } else { server_cmd("exec %s", cfg); } }
public client_connect(id) { userHEgrenade[id] = 0; userFlashbang[id] = 0; userSmokegrenade[id] = 0; userAwp[id] = 0; userDeagle[id] = 0; userHP[id] = 0; userArmor[id] = 0; userNofalldamage[id] = 0; userAntiflash[id] = 0; userAntifrost[id] = 0; userStealth[id] = 0; userCamo[id] = 0; userRespawn[id] = 0; userXp[id] = 0; }
public client_disconnect(id) { userHEgrenade[id] = 0; userFlashbang[id] = 0; userSmokegrenade[id] = 0; userAwp[id] = 0; userDeagle[id] = 0; userHP[id] = 0; userArmor[id] = 0; userNofalldamage[id] = 0; userAntiflash[id] = 0; userAntifrost[id] = 0; userStealth[id] = 0; userCamo[id] = 0; userRespawn[id] = 0; userXp[id] = 0; }
public advert() { client_print_color(0, DontChange, "^4[Lw. Shop] ^1Click ^4'N' ^1To Open The ^4Shop."); client_print_color(0, DontChange, "^4[Lw. Shop] ^1This server is running ^3Hide'N'Seek ^4Shop, ^1to open the Type ^4/shop ^1or Press ^4'N'"); }
public Event_Deathmsg() { new victim = read_data(2) userHEgrenade[victim] = 0; userFlashbang[victim] = 0; userSmokegrenade[victim] = 0; userAwp[victim] = 0; userDeagle[victim] = 0; userHP[victim] = 0; userArmor[victim] = 0; userNofalldamage[victim] = 0; userAntiflash[victim] = 0; userAntifrost[victim] = 0; userStealth[victim] = 0; userCamo[victim] = 0; userRespawn[victim] = 0; userXp[victim] = 0; }
public hideNseek(id){ new iMoney = cs_get_user_money( id ); new color1[] = "\d"; new color2[] = "\d"; new color3[] = "\d"; new color4[] = "\d"; new color5[] = "\d"; new color6[] = "\d"; new color7[] = "\d"; new color8[] = "\d"; new color9[] = "\d"; new color10[] = "\d"; new color11[] = "\d"; new color12[] = "\d"; new color13[] = "\d"; new color14[] = "\d"; if(iMoney >= get_pcvar_num(HEgrenadecost)) { color1 = "\w"; } if(iMoney >= get_pcvar_num(Flashbangcost)) { color2 = "\w"; } if(iMoney >= get_pcvar_num(Smokegrenadecost)) { color3 = "\w"; } if(iMoney >= get_pcvar_num(Awpcost)) { color4 = "\w"; } if(iMoney >= get_pcvar_num(Deaglecost)) { color5 = "\w"; } if(iMoney >= get_pcvar_num(HPcost)) { color6 = "\w"; } if(iMoney >= get_pcvar_num(Armorcost)) { color7 = "\w"; } if(iMoney >= get_pcvar_num(Nofalldamagecost)) { color8 = "\w"; } if(iMoney >= get_pcvar_num(Antiflashcost)) { color9 = "\w"; } if(iMoney >= get_pcvar_num(Antifrostcost)) { color10 = "\w"; } if(iMoney >= get_pcvar_num(Stealthcost)) { color11 = "\w"; } if(iMoney >= get_pcvar_num(Camocost)) { color12 = "\w"; } if(iMoney >= get_pcvar_num(Respawncost)) { color13 = "\w"; } if(iMoney >= get_pcvar_num(Xpcost)) { color14 = "\w"; }
if(get_pcvar_num(plugin_on) == 1) { new iMenu = menu_create( "\r[\wLw. Shop\r]\yHide'N'Seek Shop v1.0^n\wBy Lw.^n^n", "hideNseek_handler" );
new grav[60];
formatex(grav, sizeof(grav) - 1, "%sHE-Grenade \r%d$", color1, get_pcvar_num(HEgrenadecost)); menu_additem(iMenu, grav, "1", 0);
formatex(grav, sizeof(grav) - 2, "%sHe-grenade - \r%d$", color2, get_pcvar_num(Flashbangcost)); menu_additem(iMenu, grav, "2", 0); formatex(grav, sizeof(grav) - 3, "%sHe-grenade - \r%d$", color3, get_pcvar_num(Smokegrenadecost)); menu_additem(iMenu, grav, "3", 0); formatex(grav, sizeof(grav) - 4, "%sHe-grenade - \r%d$", color4, get_pcvar_num(Awpcost)); menu_additem(iMenu, grav, "4", 0); formatex(grav, sizeof(grav) - 5, "%sHe-grenade - \r%d$", color5, get_pcvar_num(Deaglecost)); menu_additem(iMenu, grav, "5", 0); formatex(grav, sizeof(grav) - 6, "%sHe-grenade - \r%d$", color6, get_pcvar_num(HPcost)); menu_additem(iMenu, grav, "6", 0); formatex(grav, sizeof(grav) - 7, "%sHe-grenade - \r%d$", color7, get_pcvar_num(Armorcost)); menu_additem(iMenu, grav, "7", 0); formatex(grav, sizeof(grav) - 8, "%sHe-grenade - \r%d$", color8, get_pcvar_num(Nofalldamagecost)); menu_additem(iMenu, grav, "8", 0); formatex(grav, sizeof(grav) - 9, "%sHe-grenade - \r%d$", color9, get_pcvar_num(Antiflashcost)); menu_additem(iMenu, grav, "9", 0); formatex(grav, sizeof(grav) - 10, "%sHe-grenade - \r%d$", color10, get_pcvar_num(Antifrostcost)); menu_additem(iMenu, grav, "10", 0); formatex(grav, sizeof(grav) - 11, "%sHe-grenade - \r%d$", color11, get_pcvar_num(Stealthcost)); menu_additem(iMenu, grav, "11", 0); formatex(grav, sizeof(grav) - 12, "%sHe-grenade - \r%d$", color12, get_pcvar_num(Camocost)); menu_additem(iMenu, grav, "12", 0); formatex(grav, sizeof(grav) - 13, "%sHe-grenade - \r%d$", color13, get_pcvar_num(Respawncost)); menu_additem(iMenu, grav, "13", 0); formatex(grav, sizeof(grav) - 14, "%sHe-grenade - \r%d$", color14, get_pcvar_num(Xpcost)); menu_additem(iMenu, grav, "14", 0);
} else { client_print( id, print_chat, "[Lw. Shop] Shop is currently closed."); } }
public hideNseek_handler(id, iMenu, item) { if( item == MENU_EXIT ) { menu_destroy( iMenu ); return PLUGIN_HANDLED; } new data[6], iName[32]; new access, callback; menu_item_getinfo(iMenu, item, access, data,5, iName, 31, callback); new key = str_to_num(data); switch(key) { case 1: // HE-Grenade { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userHEgrenade[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowHEgrenade) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(HEgrenadecost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); fm_give_item(id, "weapon_hegrenade") userHEgrenade[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3HE-Grenade."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 2: // Flash-Bang { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userFlashbang[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowFlashbang) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Flashbangcost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); fm_give_item(id, "weapon_flashbang") userFlashbang[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3Flash-Bang."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 3: // Smoke-Grenade { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userSmokegrenade[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowSmokegrenade) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Smokegrenadecost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); fm_give_item(id, "weapon_smokegrenade") userSmokegrenade[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3Smoke-Grenade."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 4: // Awp { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userAwp[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowAwp) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Awpcost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); fm_give_item( id, "weapon_awp" ) cs_set_weapon_ammo( find_ent_by_owner( 1, "weapon_awp", id ), 1 ) userAwp[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3Awp 1 Shot."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 5: // Deagle { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userDeagle[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowDeagle) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Deaglecost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); fm_give_item( id, "weapon_deagle" ) cs_set_weapon_ammo( find_ent_by_owner( 1, "weapon_deagle", id ), 1 ) userDeagle[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3Deagle 1 Shot."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 6: // 150 HP { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userHP[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowHP) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(HPcost); if(money > cost || money == cost) { new userhp = get_user_health( id ) new hpcvar = get_pcvar_num( hpcvar ) fm_set_user_health( id, userhp ) userHP[id]++; client_cmd( id, "spk items/medshot4" ) fm_get_user_money(id, money - cost); userHP[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3150 HP."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 7: // 150 Armor { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userArmor[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowArmor) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Armorcost); if(money > cost || money == cost) { new playerarmor = get_user_armor( id ) new armor = get_pcvar_num( armorammount ) fm_set_user_armor( id, playerarmor + armor ) fm_get_user_money(id, money - cost); userArmor[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3150 Armor."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 8: // NoFallDamage { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userNofalldamage[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowNofalldamage) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Nofalldamagecost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); userNofalldamage[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3NoFallDamage."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 9: // Anti-Flash { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userAntiflash[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(Antiflashcost) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Antiflashcost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); userAntiflash[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3Anti-Flash."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 10: // Anti-Frost { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userAntifrost[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(Antifrostcost) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Antifrostcost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); userAntifrost[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3150 HP."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 11: // Stealth { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userStealth[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(Stealthcost) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Stealthcost); if(money > cost || money == cost) { fm_set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 15 ); set_task( 20.0, "remove_stealth", id ); fm_get_user_money(id, money - cost); userStealth[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3Stealth For 20 Sec."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 12: // Camoflouge { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userCamo[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowCamo) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Camocost); if(money > cost || money == cost) { team = get_user_team(id); if (team == 1) { cs_set_user_model(id, "urban"); } else { cs_set_user_model(id, "leet"); } fm_get_user_money(id, money - cost); userCamo[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3Camoflouge For 20 Sec."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 13: // Respawn { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userRespawn[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowRespawn) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Respawncost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); ExecuteHamB(Ham_CS_RoundRespawn, id); userRespawn[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3Respawn."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } case 14: // 150 Xp { if(!is_user_alive(id)) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need to be alive!"); return PLUGIN_HANDLED; } if(userXp[id] > 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You already own this item!"); return PLUGIN_HANDLED; } if(get_pcvar_num(allowXp) == 0) { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1This item is disabled."); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(Xpcost); if(money > cost || money == cost) { fm_get_user_money(id, money - cost); userXp[id]++; client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You purchased ^3150 Xp."); } else { client_print_color( 0, DontChange, "^4[Lw. Shop] ^1You need more ^4money ^1to buy this!"); } } } return PLUGIN_HANDLED; }
public remove_camo(id) { cs_reset_user_model(id); usercamo[id] = 0; ColorChat(id, GREEN, "^4[Lw. Shop] ^1you dont look like enemy anymore."); }
// remove stealth public remove_stealth( id ) { new iName[32] get_user_name(id,iName,31) set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255); ColorChat(id, BLUE,"^4[Lw. Shop] ^1 you dont have Stealth anymore.",iName); }
/// 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) && usernoflash[id] > 0) { 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
it good?
|