Custom Shop

Čia galite paskelbti apie naudingus pluginus, kuriuos radote internete ar kur kitur ir manote, kad jie bus naudingi kitiems. Savo kurtus pluginus prašome skelbti "Naujai pateikti pluginai" forume.
Forum rules
1. Pluginai turi turėti išsamius aprašymus.
2. Aprašymai turi būti lietuvių kalba.
Post Reply
Terror
Senbūvis
Posts: 1086
Joined: 2015 Feb 27 19:29
Location: Alytus

Custom Shop

Post by Terror »

Sveiki radau nebloga plugins man patiko tai pasidalinu su jums :liux:
custom_shop_v20.zip
(92.52 KiB) Downloaded 246 times

Code: Select all

/*OciXCrom's Custom ShopThe shop contains the following items (by default): [a] +50 Health -- Gives you +50 health points[b] +100 Armor -- Gives you +100 armor points[c] Unlimited Clip -- Makes your current weapon have unlimited bullets (without reloading). This item can only be activated on a weapon that actually uses bullets, reloading will remove the unlimited clip[d] Unlimited Ammo -- Adds unlimited backpack ammo to your current weapon[e] All Grenades -- Gives you HE Grenade, 2x Flashbang and a Smoke Grenade[f] Bomber -- Gives you 20 HE Grenades[g] Silent Footsteps -- You won't make noise when running[h] Faster Speed -- Makes you run faster[i] Low Gravity -- Allows you to jump higher[j] Chameleon -- Use this item to fool your enemies by disguising as them[k] Drugs (Speed + Health) -- Distorts your screen, makes you run faster and gives you additional health. The distortion is lost when zooming in[l] Transparency -- Makes you transparent[m] Invisibility (15 Seconds) -- Buying this will make you fully invisible for 15 seconds[n] Double Damage -- Doubles the damage you make on an enemy player[o] GodMode (5 Seconds) -- Become immortal for 5 seconds[p] Health Regeneration -- Regenerates 1 health point each half of a second[q] Armor Regeneration -- Regenerates 10 armor points each half of a second[r] No Recoil -- Removes weapon recoil Every single item can be disabled and modified by using various cvars.To disable any item, you can use the cvar "customshop_disableditems", add the item's letter in the cvar string to disable it. Use these cvars to control the main options of the Shop: * customshop_disableditems <any available item letter (case sensitive)> -- Leave it empty if you want all items to be enabled* customshop_viponly <default: 0> -- Set to "1" if you want the Shop to be available only for players with a certain flag, you can change the flag by editing SHOP_ACCESS* customshop_infomessage_enabled <default: 1> -- Enable/Disable information message showing in chat* customshop_infomessage_time <default: 90.0> -- Controls the time needed (in seconds) for the information message to display in chat* customshop_buyequip <default: 1> -- Use "0" if you don't want the shop to be accessed by using the "buyequip" command (or button "o" by default)* customshop_currency_symbol <default: $ / Pts.> -- Set the currency symbol that is shown in the shop menu* customshop_teamonly <default: 0> -- Use this to make the shop available only for a certain team (0 = None; 1 = T; 2 = CT; 3 = Spectator) Cvars for the Points System: * customshop_points <default: 0> -- Set to "1" if you want to use special points, instead of money* customshop_savepoints <default: 1> -- Controls whether the plugin will save players' points on disconnect* customshop_teamkillpoints <default: 0> -- If you want players to get points when killing a teammate* customshop_killmessage <default: 1> -- Use "0" to disable the kill messages in chat* customshop_reward_normal <default: 15> -- Controls how many points you get for a normal kill* customshop_reward_headshot <default: 30> -- Controls how many points you get for a headshot* customshop_reward_knife <default: 50> -- Controls how many points you get for a knife kill Commands: * say /shop -- Opens up the Shop Menu* say /points -- Shows the player his current points status* amx_points <nick|#userid|@team> <points to give/take> -- An admin command to give or take points, you can use "0" to take all points from the player You can change any item's price by using the following cvars: [a] customshop_health_price <default: 1500>[b] customshop_armor_price <default: 1000>[c] customshop_unlclip_price <default: 3000>[d] customshop_unlammo_price <default: 200>[e] customshop_allgrenades_price <default: 800>[f] customshop_bomber_price <default: 1600>[g] customshop_silentsteps_price <default: 3000>[h] customshop_fasterspeed_price <default: 4300>[i] customshop_lowgravity_price <default: 2800>[j] customshop_chameleon_price <default: 9000>[k] customshop_drugs_price <default: 8000>[l] customshop_transparency_price <default: 2500>[m] customshop_invisibility_price <default: 16000>[n] customshop_doubledamage_price <default: 10000>[o] customshop_godmode_price <default: 16000>[p] customshop_healthregen_price <default: 1800>[q] customshop_armorregen_price <default: 2000>[r] customshop_norecoil_price <default: 12000> Note: The cvars above are for the regular Money System, and the other ones are for the Points System. [a] customshop_health_price2 <default: 150>[b] customshop_armor_price2 <default: 100>[c] customshop_unlclip_price2 <default: 300>[d] customshop_unlammo_price2 <default: 20>[e] customshop_allgrenades_price2 <default: 80>[f] customshop_bomber_price2 <default: 160>[g] customshop_silentsteps_price2 <default: 300>[h] customshop_fasterspeed_price2 <default: 430>[i] customshop_lowgravity_price2 <default: 280>[j] customshop_chameleon_price2 <default: 900>[k] customshop_drugs_price2 <default: 800>[l] customshop_transparency_price2 <default: 250>[m] customshop_invisibility_price2 <default: 1600>[n] customshop_doubledamage_price2 <default: 1000>[o] customshop_godmode_price2 <default: 1600>[p] customshop_healthregen_price2 <default: 180>[q] customshop_armorregen_price2 <default: 200>[r] customshop_norecoil_price2 <default: 1200> Use these cvars to control the item limit:    [a] customshop_health_limit <default: 5>[b] customshop_armor_limit <default: 8>[c] customshop_unlclip_limit <default: 3>[d] customshop_unlammo_limit <default: 5>[e] customshop_allgrenades_limit <default: 10>[f] customshop_bomber_limit <default: 3>[g] customshop_silentsteps_limit <default: 1>[h] customshop_fasterspeed_limit <default: 1>[i] customshop_lowgravity_limit <default: 1>[j] customshop_chameleon_limit <default: 1>[k] customshop_drugs_limit <default: 2>[l] customshop_transparency_limit <default: 1>[m] customshop_invisibility_limit <default: 3>[n] customshop_doubledamage_limit <default: 1>[o] customshop_godmode_limit <default: 1>[p] customshop_healthregen_limit <default: 2>[q] customshop_armorregen_limit <default: 2>[r] customshop_norecoil_limit <default: 1> Other item cvars: [a] customshop_health_amount <default: 50> -- Controls the health points you get when buying item "a"[b] customshop_armor_amount <default: 100> -- Controls the armor points you get when buying item "b"[f] customshop_bomber_amount <default: 20> -- Controls how many HE Grenades you get when buying item "f"[h] customshop_fasterspeed_amount <default: 300.0> -- Controls the speed boost you get when buying item "h"[i] customshop_lowgravity_amount <default: 0.5> -- Controls the gravity you get when buying item "i". Be aware that the lower the gravity is, the higher you jump[k] customshop_drugs_speedamount <default: 300.0> -- Controls the speed boost you get when buying item "k"[k] customshop_drugs_healthamount <default: 200> -- Controls the health points you get when buying item "k"[l] customshop_transparency_amount <default: 75> -- Controls the transparency amount when buying item "l". Use a number from 0 to 255, the lower the number, the more transparency you get[m] customshop_invisibility_time <default: 15.0> -- Controls how many seconds you're invisible when buying item "m"[o] customshop_godmode_time <default: 5.0> -- Controls how many seconds you're immortal when buying item "o"[p] customshop_healthregen_amount <default: 1> -- Controls how many health points you get every second when buying item "p"[p] customshop_healthregen_time <default: 0.5> -- Controls the speed of regeneration when buying item "p"[p] customshop_healthregen_max <default: 150> -- Controls the maximum amount of regenerated health when buying item "p"[q] customshop_armorregen_amount <default: 10> -- Controls how many armor points you get every second when buying item "p"[q] customshop_armorregen_time <default: 0.5> -- Controls the speed of regeneration when buying item "p"[q] customshop_armorregen_max <default: 150> -- Controls the maximum amount of regenerated armor when buying item "p" The plugin also allows you to add a custom sound for every item, check g_itemSounds.*/ #include <amxmodx>#include <amxmisc>#include <cstrike>#include <fakemeta>#include <fun>#include <hamsandwich>#include <nvault> #define PLUGIN_NAME "Custom Shop"#define PLUGIN_VERSION "2.0"#define PLUGIN_AUTHOR "OciXCrom" #define SHOP_ACCESS ADMIN_RESERVATION#define FLAG_ADMIN ADMIN_SLAY#define MAX_ITEMS 17#define m_pActiveItem 373 #define sNo "buttons/button11.wav"#define sOver "buttons/blip2.wav" new const szPrefix[] = "^4[Custom Shop]" enum Color{    NORMAL = 1, // clients scr_concolor cvar color    GREEN, // Green Color    TEAM_COLOR, // Red, grey, blue    GREY, // grey    RED, // Red    BLUE, // Blue} new TeamName[][] = {    "",    "TERRORIST",    "CT",    "SPECTATOR"} new const g_playerModels[][] = {    "arctic",    "guerilla",    "leet",    "terror",    "gign",    "gsg9",    "sas",    "urban"} new const g_itemSounds[][] = {    "items/smallmedkit1.wav", // Item "a": +50 Health    "items/ammopickup2.wav", // Item "b": +50 Armor    "items/gunpickup2.wav", // Item "c": Unlimited Clip    "items/gunpickup2.wav", // Item "d": Unlimited Ammo    "items/gunpickup2.wav", // Item "e": All Grenades    "x/x_pain2.wav", // Item "f": Bomber    "items/gunpickup2.wav", // Item "g": Silent Footsteps    "misc/bipbip.wav", // Item "h": Faster Speed    "items/gunpickup2.wav", // Item "i": Low Gravity    "items/gunpickup2.wav", // Item "j": Chameleon    "items/gunpickup2.wav", // Item "k": Drugs (Speed + Health)    "items/gunpickup2.wav", // Item "l": Transparency    "hornet/ag_buzz1.wav", // Item "m": Invisibility (15 Seconds)    "items/gunpickup2.wav", // Item "n": Double Damage    "misc/stinger12.wav", // Item "o": GodMode (5 Seconds)    "items/suitchargeok1.wav", // Item "p": Health Regeneration    "items/suitchargeok1.wav", // Item "q": Armor Regeneration    "items/gunpickup2.wav" // Item "r": No Recoil} new DisabledItems, VIPOnly, gmsg_SetFOVnew HealthAmount, HealthPrice, ArmorAmount, ArmorPrice, UnlimitedClipPrice, UnlimitedAmmoPrice, AllGrenadesPrice, BomberPrice, BomberAmount, SilentFootstepsPricenew FasterSpeedAmount, FasterSpeedPrice, LowGravityAmount, LowGravityPrice, ChameleonPrice, DrugsSpeedAmount, DrugsHealthAmount, DrugsPricenew TransparencyAmount, TransparencyPrice, InvisibilityTime, InvisibilityPrice, DoubleDamagePrice, GodModeTime, GodModePrice, HealthRegenAmount, HealthRegenTimenew HealthRegenMax, HealthRegenPrice, ArmorRegenAmount, ArmorRegenTime, ArmorRegenMax, ArmorRegenPrice, InfoMessageEnabled, InfoMessageTime, ShopEquip, ShopPointsnew SavePoints, TeamKillPoints, KillMessage, NormalReward, HeadshotReward, KnifeReward, CurrencySymbol, NoRecoilPrice, TeamOnlynew HealthLimit, ArmorLimit, UnlimitedClipLimit, UnlimitedAmmoLimit, AllGrenadesLimit, BomberLimit, SilentFootstepsLimit, FasterSpeedLimit, LowGravityLimit, ChameleonLimitnew DrugsLimit, TransparencyLimit, InvisibilityLimit, DoubleDamageLimit, GodModeLimit, HealthRegenLimit, ArmorRegenLimit, NoRecoilLimitnew g_vault, activity, cvar new weapon[33], points[33]new userlimit[33][33] new bool:cshop_speed[33]new bool:cshop_ddamage[33]new bool:cshop_healthregen[33]new bool:cshop_armorregen[33]new bool:cshop_norecoil[33] new bool:use_points new const g_itemLanguage[][] = {    "CSHOP_HEALTH",    "CSHOP_ARMOR",    "CSHOP_UNLCLIP",    "CSHOP_UNLAMMO",    "CSHOP_ALLGRENADES",    "CSHOP_BOMBER",    "CSHOP_SILENTSTEPS",    "CSHOP_FASTERSPEED",    "CSHOP_LOWGRAVITY",    "CSHOP_CHAMELEON",    "CSHOP_DRUGS",    "CSHOP_TRANSPARENCY",    "CSHOP_INVISIBILITY",    "CSHOP_DDAMAGE",    "CSHOP_GODMODE",    "CSHOP_HEALTHREGEN",    "CSHOP_ARMORREGEN",    "CSHOP_NORECOIL"} public plugin_init(){    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)    register_dictionary("custom_shop.txt")        register_event("CurWeapon", "change_weapon", "be", "1=1")    register_event("DeathMsg", "player_killed", "a")    RegisterHam(Ham_Spawn, "player", "player_spawn", 1)    RegisterHam(Ham_TakeDamage, "player", "player_damage")    register_forward(FM_PlayerPreThink, "player_prethink")        register_clcmd("say /shop", "cshop_main")    register_clcmd("say_team /shop", "cshop_main")    register_clcmd("say /points", "cmd_points")    register_clcmd("say_team /points", "cmd_points")        ShopPoints = register_cvar("customshop_points", "0")    use_points = (get_pcvar_num(ShopPoints) == 1) ? true : false        DisabledItems = register_cvar("customshop_disableditems", "")    VIPOnly = register_cvar("customshop_viponly", "0")        if(use_points)    {        HealthPrice = register_cvar("customshop_health_price2", "150")        ArmorPrice = register_cvar("customshop_armor_price2", "100")        UnlimitedClipPrice = register_cvar("customshop_unlclip_price2", "300")        UnlimitedAmmoPrice = register_cvar("customshop_unlammo_price2", "20")        AllGrenadesPrice = register_cvar("customshop_allgrenades_price2", "80")        BomberPrice = register_cvar("customshop_bomber_price2", "160")        SilentFootstepsPrice = register_cvar("customshop_silentsteps_price2", "300")        FasterSpeedPrice = register_cvar("customshop_fasterspeed_price2", "430")        LowGravityPrice = register_cvar("customshop_lowgravity_price2", "280")        ChameleonPrice = register_cvar("customshop_chameleon_price2", "900")        DrugsPrice = register_cvar("customshop_drugs_price2", "800")        TransparencyPrice = register_cvar("customshop_transparency_price2", "250")        InvisibilityPrice = register_cvar("customshop_invisibility_price2", "1600")        DoubleDamagePrice = register_cvar("customshop_doubledamage_price2", "1000")        GodModePrice = register_cvar("customshop_godmode_price2", "1600")        HealthRegenPrice = register_cvar("customshop_healthregen_price2", "180")        ArmorRegenPrice = register_cvar("customshop_armorregen_price2", "200")        SavePoints = register_cvar("customshop_savepoints", "1")        TeamKillPoints = register_cvar("customshop_teamkillpoints", "0")        KillMessage = register_cvar("customshop_killmessage", "1")        NormalReward = register_cvar("customshop_reward_normal", "15")        HeadshotReward = register_cvar("customshop_reward_headshot", "30")        KnifeReward = register_cvar("customshop_reward_knife", "50")        CurrencySymbol = register_cvar("customshop_currency_symbol2", " Pts.")        NoRecoilPrice = register_cvar("customshop_norecoil_price2", "1200")                register_concmd("amx_points", "cmd_givepoints", FLAG_ADMIN, "<nick|#userid|@team> <points to give/take>")    }    else    {        HealthPrice = register_cvar("customshop_health_price", "1500")        ArmorPrice = register_cvar("customshop_armor_price", "1000")        UnlimitedClipPrice = register_cvar("customshop_unlclip_price", "3000")        UnlimitedAmmoPrice = register_cvar("customshop_unlammo_price", "200")        AllGrenadesPrice = register_cvar("customshop_allgrenades_price", "800")        BomberPrice = register_cvar("customshop_bomber_price", "1600")        SilentFootstepsPrice = register_cvar("customshop_silentsteps_price", "3000")        FasterSpeedPrice = register_cvar("customshop_fasterspeed_price", "4300")        LowGravityPrice = register_cvar("customshop_lowgravity_price", "2800")        ChameleonPrice = register_cvar("customshop_chameleon_price", "9000")        DrugsPrice = register_cvar("customshop_drugs_price", "8000")        TransparencyPrice = register_cvar("customshop_transparency_price", "2500")        InvisibilityPrice = register_cvar("customshop_invisibility_price", "16000")        DoubleDamagePrice = register_cvar("customshop_doubledamage_price", "10000")        GodModePrice = register_cvar("customshop_godmode_price", "16000")        HealthRegenPrice = register_cvar("customshop_healthregen_price", "1800")        ArmorRegenPrice = register_cvar("customshop_armorregen_price", "2000")        CurrencySymbol = register_cvar("customshop_currency_symbol", "$")        NoRecoilPrice = register_cvar("customshop_norecoil_price", "12000")    }        HealthAmount = register_cvar("customshop_health_amount", "50")    ArmorAmount = register_cvar("customshop_armor_amount", "100")    BomberAmount = register_cvar("customshop_bomber_amount", "20")    FasterSpeedAmount = register_cvar("customshop_fasterspeed_amount", "300.0")    LowGravityAmount = register_cvar("customshop_lowgravity_amount", "0.5")    DrugsSpeedAmount = register_cvar("customshop_drugs_speedamount", "300.0")    DrugsHealthAmount = register_cvar("customshop_drugs_healthamount", "200")    TransparencyAmount = register_cvar("customshop_transparency_amount", "75")    InvisibilityTime = register_cvar("customshop_invisibility_time", "15.0")    GodModeTime = register_cvar("customshop_godmode_time", "5.0")    HealthRegenAmount = register_cvar("customshop_healthregen_amount", "1")    HealthRegenTime = register_cvar("customshop_healthregen_time", "0.5")    HealthRegenMax = register_cvar("customshop_healthregen_max", "150")    ArmorRegenAmount = register_cvar("customshop_armorregen_amount", "10")    ArmorRegenTime = register_cvar("customshop_armorregen_time", "0.5")    ArmorRegenMax = register_cvar("customshop_armorregen_max", "150")    InfoMessageEnabled = register_cvar("customshop_infomessage_enabled", "1")    InfoMessageTime = register_cvar("customshop_infomessage_time", "90.0")    ShopEquip = register_cvar("customshop_buyequip", "1")    TeamOnly = register_cvar("customshop_teamonly", "0")        HealthLimit = register_cvar("customshop_health_limit", "5")    ArmorLimit = register_cvar("customshop_armor_limit", "8")    UnlimitedClipLimit = register_cvar("customshop_unlclip_limit", "3")    UnlimitedAmmoLimit = register_cvar("customshop_unlammo_limit", "5")    AllGrenadesLimit = register_cvar("customshop_allgrenades_limit", "10")    BomberLimit = register_cvar("customshop_bomber_limit", "3")    SilentFootstepsLimit = register_cvar("customshop_silentsteps_limit", "1")    FasterSpeedLimit = register_cvar("customshop_fasterspeed_limit", "1")    LowGravityLimit = register_cvar("customshop_lowgravity_limit", "1")    ChameleonLimit = register_cvar("customshop_chameleon_limit", "1")    DrugsLimit = register_cvar("customshop_drugs_limit", "2")    TransparencyLimit = register_cvar("customshop_transparency_limit", "1")    InvisibilityLimit = register_cvar("customshop_invisibility_limit", "3")    DoubleDamageLimit = register_cvar("customshop_doubledamage_limit", "1")    GodModeLimit = register_cvar("customshop_godmode_limit", "1")    HealthRegenLimit = register_cvar("customshop_healthregen_limit", "2")    ArmorRegenLimit = register_cvar("customshop_armorregen_limit", "2")    NoRecoilLimit = register_cvar("customshop_norecoil_limit", "1")        if(get_pcvar_num(ShopEquip) == 1) register_clcmd("buyequip", "cshop_main")    if(get_pcvar_num(InfoMessageEnabled) == 1) set_task(get_pcvar_float(InfoMessageTime), "infoMessage", 1111, "", 0, "b", 0)        gmsg_SetFOV = get_user_msgid("SetFOV")    g_vault = nvault_open("CutomShop")    activity = get_pcvar_num(get_cvar_pointer("amx_show_activity"))} public client_putinserver(id){    cshop_speed[id] = false    cshop_ddamage[id] = false    cshop_healthregen[id] = false    cshop_armorregen[id] = false    cshop_norecoil[id] = false    LoadData(id)} public client_disconnect(id)    if(use_points && get_pcvar_num(SavePoints) == 1) SaveData(id) public SaveData(id){    new name[32]    get_user_name(id, name, 31)    new vaultkey[64], vaultdata[256]        format(vaultkey, 63, "%s", name)    format(vaultdata, 255, "%i", points[id])    nvault_set(g_vault, vaultkey, vaultdata)        return PLUGIN_CONTINUE} LoadData(id){    new name[32]    get_user_name(id, name, 31)    new vaultkey[64], vaultdata[256]        format(vaultkey, 63, "%s", name)    format(vaultdata, 255, "%i", points[id])    nvault_get(g_vault, vaultkey, vaultdata, 255)        new points_user[10]    parse(vaultdata, points_user, 9)        new points_set = str_to_num(points_user)    points[id] = points_set        return PLUGIN_CONTINUE} public player_spawn(id){    cshop_speed[id] = false    cshop_ddamage[id] = false    cshop_healthregen[id] = false    cshop_armorregen[id] = false    cshop_norecoil[id] = false    if(is_user_alive(id))    {        set_user_footsteps(id, 0)        set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)    }    if(is_user_connected(id)) cs_reset_user_model(id)        for(new i = 0; i < MAX_ITEMS + 1; i++)        set_user_limit(id, i, 0)} public change_weapon(id){    weapon[id] = get_user_weapon(id)    if(cshop_speed[id]) set_user_maxspeed(id, get_pcvar_float(FasterSpeedAmount))} public infoMessage()    ColorChat(0, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_INFO", PLUGIN_NAME, PLUGIN_AUTHOR) public cmd_points(id){    if(!use_points) ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_NOPOINTS")       else ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_YOURPOINTS", points[id])        return PLUGIN_HANDLED} public cmd_givepoints(id, level, cid){    if(!cmd_access(id, level, cid, 3))        return PLUGIN_HANDLED     new arg[32], arg2[8], name[32], name2[32], g_players[32], num, player    read_argv(1, arg, 31)    read_argv(2, arg2, 7)    get_players(g_players, num)    get_user_name(id, name, 31)        new amount = str_to_num(arg2)       new count = 0     if(arg[0] == '@')    {        for(new i = 0; i < num; i++)        {            player = g_players[i]                        if((equali(arg, "@T") && get_user_team(player) == 1) || (equali(arg, "@CT") && get_user_team(player) == 2) || equali(arg, "@ALL"))            {                points[player] += amount                count++            }        }                if(count == 0)        {            ColorChat(id, RED, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_NOPLAYERS")            client_print(id, print_console, "%s %L", szPrefix, LANG_SERVER, "CSHOP_NOPLAYERS")            return PLUGIN_HANDLED        }                if(equali(arg, "@T")) formatex(name2, 31, "%L", LANG_SERVER, "CSHOP_ALL_T")        else if(equali(arg, "@CT")) formatex(name2, 31, "%L", LANG_SERVER, "CSHOP_ALL_CT")        else formatex(name2, 31, "%L", LANG_SERVER, "CSHOP_ALL_PLR")    }    else    {        player = cmd_target(id, arg, 0)        if(!player) return PLUGIN_HANDLED                get_user_name(player, name2, 31)                if(amount == 0)        {            ColorChat(0, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_TOOKALL", name, name2)            client_print(id, print_console, "%s %L", szPrefix, LANG_SERVER, "CSHOP_TOOKALL_CONSOLE", name2)            log_amx("%s %L", szPrefix, LANG_SERVER, "CSHOP_TOOKALL_LOG", name, name2)                        points[player] = 0            return PLUGIN_HANDLED        }                points[player] += amount    }        switch(activity)    {        case 1: ColorChat(0, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_GIVEPOINTS", LANG_SERVER, (amount >= 0) ? "CSHOP_GAVE" : "CSHOP_TOOK", abs(amount), LANG_SERVER, (amount >= 0) ? "CSHOP_TO" : "CSHOP_FROM", name2)        case 2: ColorChat(0, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_GIVEPOINTS", name, LANG_SERVER, (amount >= 0) ? "CSHOP_GAVE" : "CSHOP_TOOK", abs(amount), LANG_SERVER, (amount >= 0) ? "CSHOP_TO" : "CSHOP_FROM", name2)    }        client_print(id, print_console, "%s %L", szPrefix, LANG_SERVER, "CSHOP_GIVEPOINTS_CONSOLE", LANG_SERVER, (amount >= 0) ? "CSHOP_GAVE" : "CSHOP_TOOK", abs(amount), LANG_SERVER, (amount >= 0) ? "CSHOP_TO" : "CSHOP_FROM", name2)    log_amx("%s %L", szPrefix, LANG_SERVER, "CSHOP_GIVEPOINTS_LOG", name, LANG_SERVER, (amount >= 0) ? "CSHOP_GAVE" : "CSHOP_TOOK", abs(amount), LANG_SERVER, (amount >= 0) ? "CSHOP_TO" : "CSHOP_FROM", name2)        return PLUGIN_HANDLED}    public cshop_main(id){    if(get_pcvar_num(VIPOnly) == 1)    {        if(!(get_user_flags(id) & SHOP_ACCESS))        {            ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_NOACCESS")            client_cmd(id, "spk %s", sNo)            return PLUGIN_HANDLED        }    }        new shop_team = get_pcvar_num(TeamOnly)    new team = get_user_team(id)        if(shop_team != 0)    {        if(shop_team != team)        {            ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_TEAMONLY", (shop_team == 1) ? "T" : (shop_team == 2) ? "CT" : "Spectator")            client_cmd(id, "spk %s", sNo)            return PLUGIN_HANDLED        }    }        if(!is_user_alive(id))    {        ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_NOTALIVE")        client_cmd(id, "spk %s", sNo)        return PLUGIN_HANDLED    }        new menu_title[200], items[30], symbol[20]    new amount = use_points ? points[id] : cs_get_user_money(id)    get_pcvar_string(DisabledItems, items, charsmax(items))    get_pcvar_string(CurrencySymbol, symbol, charsmax(symbol))        formatex(menu_title, charsmax(menu_title), "\yOciXCrom's \rCustom Shop^n\w%L: \r%i \d| \w%L:\d", LANG_SERVER, use_points ? "CSHOP_POINTS" : "CSHOP_MONEY", amount, LANG_SERVER, "CSHOP_PAGE")    new customshop = menu_create(menu_title, "cshop_handler")        new item[80], close[15], back[15], next[15]        if(contain(items, "a") == -1) // Item "a": +50 Health    {        formatex(item, charsmax(item), "%s+%i %L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(HealthPrice)) ? "" : "\d", get_pcvar_num(HealthAmount), LANG_SERVER, "CSHOP_HEALTH", get_pcvar_num(HealthPrice), symbol, get_user_limit(id, 0), itemlimit(0))        menu_additem(customshop, item, "0", 0)    }        if(contain(items, "b") == -1) // Item "b": +50 Armor    {        formatex(item, charsmax(item), "%s+%i %L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(ArmorPrice)) ? "" : "\d", get_pcvar_num(ArmorAmount), LANG_SERVER, "CSHOP_ARMOR", get_pcvar_num(ArmorPrice), symbol, get_user_limit(id, 1), itemlimit(1))        menu_additem(customshop, item, "1", 0)    }           if(contain(items, "c") == -1) // Item "c": Unlimited Clip    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(UnlimitedClipPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_UNLCLIP", get_pcvar_num(UnlimitedClipPrice), symbol, get_user_limit(id, 2), itemlimit(2))        menu_additem(customshop, item, "2", 0)    }        if(contain(items, "d") == -1) // Item "d": Unlimited Ammo    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(UnlimitedAmmoPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_UNLAMMO", get_pcvar_num(UnlimitedAmmoPrice), symbol, get_user_limit(id, 3), itemlimit(3))        menu_additem(customshop, item, "3", 0)    }           if(contain(items, "e") == -1) // Item "e": All Grenades    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(AllGrenadesPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_ALLGRENADES", get_pcvar_num(AllGrenadesPrice), symbol, get_user_limit(id, 4), itemlimit(4))        menu_additem(customshop, item, "4", 0)    }           if(contain(items, "f") == -1) // Item "f": Bomber    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(BomberPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_BOMBER", get_pcvar_num(BomberPrice), symbol, get_user_limit(id, 5), itemlimit(5))        menu_additem(customshop, item, "5", 0)    }           if(contain(items, "g") == -1) // Item "g": Silent Footsteps    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(SilentFootstepsPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_SILENTSTEPS", get_pcvar_num(SilentFootstepsPrice), symbol, get_user_limit(id, 6), itemlimit(6))        menu_additem(customshop, item, "6", 0)    }           if(contain(items, "h") == -1) // Item "h": Faster Speed    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(FasterSpeedPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_FASTERSPEED", get_pcvar_num(FasterSpeedPrice), symbol, get_user_limit(id, 7), itemlimit(7))        menu_additem(customshop, item, "7", 0)    }           if(contain(items, "i") == -1) // Item "i": Low Gravity    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(LowGravityPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_LOWGRAVITY", get_pcvar_num(LowGravityPrice), symbol, get_user_limit(id, 8), itemlimit(8))        menu_additem(customshop, item, "8", 0)    }        if(contain(items, "j") == -1) // Item "j": Chameleon    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(ChameleonPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_CHAMELEON", get_pcvar_num(ChameleonPrice), symbol, get_user_limit(id, 9), itemlimit(9))        menu_additem(customshop, item, "9", 0)    }           if(contain(items, "k") == -1) // Item "k": Drugs (Speed + Health)    {        formatex(item, charsmax(item), "%s%L (%L) \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(DrugsPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_DRUGS", LANG_SERVER, "CSHOP_DRUGS2", get_pcvar_num(DrugsPrice), symbol, get_user_limit(id, 10), itemlimit(10))        menu_additem(customshop, item, "10", 0)    }           if(contain(items, "l") == -1) // Item "l": Transparency    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(TransparencyPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_TRANSPARENCY", get_pcvar_num(TransparencyPrice), symbol, get_user_limit(id, 11), itemlimit(11))        menu_additem(customshop, item, "11", 0)    }           if(contain(items, "m") == -1) // Item "m": Invisibility (15 Seconds)    {        formatex(item, charsmax(item), "%s%L (%i %L) \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(InvisibilityPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_INVISIBILITY", get_pcvar_num(InvisibilityTime), LANG_SERVER, "CSHOP_SECONDS", get_pcvar_num(InvisibilityPrice), symbol, get_user_limit(id, 12), itemlimit(12))        menu_additem(customshop, item, "12", 0)    }           if(contain(items, "n") == -1) // Item "n": Double Damage    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(DoubleDamagePrice)) ? "" : "\d", LANG_SERVER, "CSHOP_DDAMAGE", get_pcvar_num(DoubleDamagePrice), symbol, get_user_limit(id, 13), itemlimit(13))        menu_additem(customshop, item, "13", 0)    }           if(contain(items, "o") == -1) // Item "o": GodMode (5 Seconds)    {        formatex(item, charsmax(item), "%s%L (%i %L) \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(GodModePrice)) ? "" : "\d", LANG_SERVER, "CSHOP_GODMODE", get_pcvar_num(GodModeTime), LANG_SERVER, "CSHOP_SECONDS", get_pcvar_num(InvisibilityPrice), symbol, get_user_limit(id, 14), itemlimit(14))        menu_additem(customshop, item, "14", 0)    }        if(contain(items, "p") == -1) // Item "p": Health Regeneration    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(HealthRegenPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_HEALTHREGEN", get_pcvar_num(HealthRegenPrice), symbol, get_user_limit(id, 15), itemlimit(15))        menu_additem(customshop, item, "15", 0)    }           if(contain(items, "q") == -1) // Item "q": Armor Regeneration    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(ArmorRegenPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_ARMORREGEN", get_pcvar_num(ArmorRegenPrice), symbol, get_user_limit(id, 16), itemlimit(16))        menu_additem(customshop, item, "16", 0)    }        if(contain(items, "r") == -1) // Item "r": No Recoil    {        formatex(item, charsmax(item), "%s%L \r[\y%i%s\r] [\y%i\r/\y%i\r]", (amount >= get_pcvar_num(NoRecoilPrice)) ? "" : "\d", LANG_SERVER, "CSHOP_NORECOIL", get_pcvar_num(NoRecoilPrice), symbol, get_user_limit(id, 17), itemlimit(17))        menu_additem(customshop, item, "17", 0)    }        formatex(close, charsmax(close), "%L", LANG_SERVER, "CSHOP_EXIT")    formatex(back, charsmax(back), "%L", LANG_SERVER, "CSHOP_BACK")    formatex(next, charsmax(next), "%L", LANG_SERVER, "CSHOP_NEXT")        menu_setprop(customshop, MPROP_EXITNAME, close)    menu_setprop(customshop, MPROP_BACKNAME, back)    menu_setprop(customshop, MPROP_NEXTNAME, next)        menu_display(id, customshop, 0)    return PLUGIN_HANDLED} public cshop_handler(id, customshop, item){    if(!is_user_alive(id) || item == MENU_EXIT)    {        menu_destroy(customshop)        return PLUGIN_HANDLED    }        new data[6], iName[64], access, callback    menu_item_getinfo(customshop, item, access, data, charsmax(data), iName, charsmax(iName), callback)     new key = str_to_num(data)        check_cvars(key)    buy_item(id, key, cvar, g_itemLanguage[key])        menu_destroy(customshop)    return PLUGIN_HANDLED} stock buy_item(id, item, price, const msg[]){    if(get_user_limit(id, item) == itemlimit(item))    {        ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_LIMITREACHED", itemlimit(item))        client_cmd(id, "spk %s", sNo)        return    }        new amount = (use_points) ? points[id] : cs_get_user_money(id)        new text[50]    formatex(text, charsmax(text), "%s", msg)        new symbol[20]    get_pcvar_string(CurrencySymbol, symbol, charsmax(symbol))        if(amount >= price)    {        if(item == 2 || item == 3)        {            buy_unlimited(id, item, price, text, symbol)            return        }        else        {            switch(item)            {                case 0: set_user_health(id, get_user_health(id) + get_pcvar_num(HealthAmount))                case 1: set_user_armor(id, get_user_armor(id) + get_pcvar_num(ArmorAmount))                case 4:                {                    give_item(id, "weapon_hegrenade")                    give_item(id, "weapon_flashbang")                    give_item(id, "weapon_flashbang")                    give_item(id, "weapon_smokegrenade")                }                case 5:                {                    give_item(id, "weapon_hegrenade")                    cs_set_user_bpammo(id, CSW_HEGRENADE, get_pcvar_num(BomberAmount))                }                case 6: set_user_footsteps(id, 1)                case 7:                {                    cshop_speed[id] = true                    set_user_maxspeed(id, get_pcvar_float(FasterSpeedAmount))                }                case 8: set_user_gravity(id, get_pcvar_float(LowGravityAmount))                case 9:                {                    switch(get_user_team(id))                    {                        case 1: cs_set_user_model(id, g_playerModels[random_num(4, 7)])                        case 2: cs_set_user_model(id, g_playerModels[random_num(0, 3)])                    }                }                case 10:                {                    set_user_health(id, get_pcvar_num(DrugsHealthAmount))                    set_user_maxspeed(id, get_pcvar_float(DrugsSpeedAmount))                    drug_player(id)                }                case 11: set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, get_pcvar_num(TransparencyAmount))                case 12:                {                    set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0)                    set_task(get_pcvar_float(InvisibilityTime), "NoMoreInvis", id)                }                case 13: cshop_ddamage[id] = true                case 14:                {                    set_user_godmode(id, 1)                    set_task(get_pcvar_float(GodModeTime), "NoMoreGod", id)                }                case 15:                {                    cshop_healthregen[id] = true                    set_task(get_pcvar_float(HealthRegenTime), "healthRegenTicker", id, "", 0, "b", 0)                }                case 16:                {                    cshop_armorregen[id] = true                    set_task(get_pcvar_float(ArmorRegenTime), "armorRegenTicker", id, "", 0, "b", 0)                }                case 17: cshop_norecoil[id] = true            }        }                set_user_limit(id, item, get_user_limit(id, item) + 1)        player_charge(id, price)        ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_BOUGHT", LANG_SERVER, msg, price, symbol)        emit_sound(id, CHAN_ITEM, g_itemSounds[item], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)    }    else notenough(id)}    public check_cvars(item){    switch(item)    {        case 0: cvar = get_pcvar_num(HealthPrice)        case 1: cvar = get_pcvar_num(ArmorPrice)        case 2: cvar = get_pcvar_num(UnlimitedClipPrice)        case 3: cvar = get_pcvar_num(UnlimitedAmmoPrice)        case 4: cvar = get_pcvar_num(AllGrenadesPrice)        case 5: cvar = get_pcvar_num(BomberPrice)        case 6: cvar = get_pcvar_num(SilentFootstepsPrice)        case 7: cvar = get_pcvar_num(FasterSpeedPrice)        case 8: cvar = get_pcvar_num(LowGravityPrice)        case 9: cvar = get_pcvar_num(ChameleonPrice)        case 10: cvar = get_pcvar_num(DrugsPrice)        case 11: cvar = get_pcvar_num(TransparencyPrice)        case 12: cvar = get_pcvar_num(InvisibilityPrice)        case 13: cvar = get_pcvar_num(DoubleDamagePrice)        case 14: cvar = get_pcvar_num(GodModePrice)        case 15: cvar = get_pcvar_num(HealthRegenPrice)        case 16: cvar = get_pcvar_num(ArmorRegenPrice)        case 17: cvar = get_pcvar_num(NoRecoilPrice)    }} stock buy_unlimited(id, item, price, msg[], symbol[20]){    if(weapon[id] == CSW_KNIFE || weapon[id] == CSW_HEGRENADE || weapon[id] == CSW_FLASHBANG || weapon[id] == CSW_SMOKEGRENADE || weapon[id] == CSW_C4)    {        cantactivateitem(id, item)        return    }    else switch(item)    {        case 2:        {            cs_set_weapon_ammo(get_pdata_cbase(id, m_pActiveItem), 97280)            cs_set_user_bpammo(id, weapon[id], 0)        }        case 3: cs_set_user_bpammo(id, weapon[id], 99999)           }        set_user_limit(id, item, get_user_limit(id, item) + 1)    player_charge(id, price)    ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_BOUGHT", LANG_SERVER, msg, price, symbol)    emit_sound(id, CHAN_ITEM, g_itemSounds[item], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)} stock itemlimit(item){    new limit     switch(item)    {        case 0: limit = get_pcvar_num(HealthLimit)        case 1: limit = get_pcvar_num(ArmorLimit)        case 2: limit = get_pcvar_num(UnlimitedClipLimit)        case 3: limit = get_pcvar_num(UnlimitedAmmoLimit)        case 4: limit = get_pcvar_num(AllGrenadesLimit)        case 5: limit = get_pcvar_num(BomberLimit)        case 6: limit = get_pcvar_num(SilentFootstepsLimit)        case 7: limit = get_pcvar_num(FasterSpeedLimit)        case 8: limit = get_pcvar_num(LowGravityLimit)        case 9: limit = get_pcvar_num(ChameleonLimit)        case 10: limit = get_pcvar_num(DrugsLimit)        case 11: limit = get_pcvar_num(TransparencyLimit)        case 12: limit = get_pcvar_num(InvisibilityLimit)        case 13: limit = get_pcvar_num(DoubleDamageLimit)        case 14: limit = get_pcvar_num(GodModeLimit)        case 15: limit = get_pcvar_num(HealthRegenLimit)        case 16: limit = get_pcvar_num(ArmorRegenLimit)        case 17: limit = get_pcvar_num(NoRecoilLimit)    }        return limit} stock set_user_limit(id, item, limit)    userlimit[id][item] = limit stock get_user_limit(id, item)    return userlimit[id][item] stock notenough(id){    ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_NOTENOUGH", LANG_SERVER, use_points ? "CSHOP_POINTS_SMALL" : "CSHOP_MONEY_SMALL")    client_cmd(id, "spk %s", sNo)} stock cantactivateitem(id, item){    ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_CANNOT_ACTIVATE", LANG_SERVER, (item == 2) ? "CSHOP_UNLCLIP" : "CSHOP_UNLAMMO")    client_cmd(id, "spk %s", sNo)} public NoMoreInvis(id){    set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)    ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_NOMOREINVIS")    client_cmd(id, "spk %s", sOver)} public NoMoreGod(id){    if(is_user_alive(id)) set_user_godmode(id, 0)    ColorChat(id, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_NOMOREGOD")    client_cmd(id, "spk %s", sOver)} public player_damage(victim, inflictor, attacker, Float:damage, damage_bits){    if(is_user_alive(attacker) && cshop_ddamage[attacker] && attacker != victim)        SetHamParamFloat(4, damage * 2)} public player_prethink(id){    if(!is_user_alive(id) || !cshop_norecoil[id])        return        set_pev(id, pev_punchangle, {0.0, 0.0, 0.0})} stock player_charge(id, price){    if(use_points) points[id] -= price    else cs_set_user_money(id, cs_get_user_money(id) - price)} stock drug_player(id){    message_begin(MSG_ONE, gmsg_SetFOV, {0, 0, 0}, id)    write_byte(180)    message_end()} public player_killed(){       new attacker = read_data(1)    new victim = read_data(2)        if(!use_points || !is_user_connected(attacker) || !is_user_connected(victim) || attacker == victim)        return HAM_IGNORED        new headshot = read_data(3)     new wep[32]    read_data(4, wep, 31)        new team_attacker = get_user_team(attacker)    new team_victim = get_user_team(victim)        if(team_attacker == team_victim)    {        if(get_pcvar_num(TeamKillPoints) == 0)            return HAM_IGNORED    }        new reward        if(equali(wep, "knife")) reward = get_pcvar_num(KnifeReward)    else if(headshot) reward = get_pcvar_num(HeadshotReward)    else reward = get_pcvar_num(NormalReward)        points[attacker] += reward        if(get_pcvar_num(KillMessage) == 1)    {        new name_victim[32]        get_user_name(victim, name_victim, 31)                ColorChat(attacker, TEAM_COLOR, "%s ^1%L", szPrefix, LANG_SERVER, "CSHOP_KILL", reward, name_victim)    }        return HAM_IGNORED} public healthRegenTicker(id){    if(!is_user_alive(id) || !cshop_healthregen[id]) remove_task(id)        new health = get_user_health(id)    new healthamount = get_pcvar_num(HealthRegenAmount)    new healthmax = get_pcvar_num(HealthRegenMax)        if(cshop_healthregen[id] && is_user_alive(id))    {        if(health < healthmax)        {            if(health + healthamount > healthmax) set_user_health(id, healthmax)            else set_user_health(id, health + healthamount)        }    }} public armorRegenTicker(id){    if(!is_user_alive(id) || !cshop_armorregen[id]) remove_task(id)        new armor = get_user_armor(id)    new armoramount = get_pcvar_num(ArmorRegenAmount)    new armormax = get_pcvar_num(ArmorRegenMax)            if(cshop_armorregen[id] && is_user_alive(id))    {        if(armor < armormax)        {            if(armor + armoramount > armormax) set_user_armor(id, armormax)            else set_user_armor(id, armor + armoramount)        }    }} public plugin_precache(){    for(new i = 0; i < sizeof g_itemSounds; i++)        precache_sound(g_itemSounds[i])} /* ======================================================================================================= *//* ColorChat *//* ======================================================================================================= */ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...){    if( !get_playersnum() ) return;        new message[256];     switch(type)    {        case NORMAL: // clients scr_concolor cvar color        {            message[0] = 0x01;        }        case GREEN: // Green        {            message[0] = 0x04;        }        default: // White, Red, Blue        {            message[0] = 0x03;        }    }     vformat(message[1], 251, msg, 4);     replace_all(message, 191, "!n", "^x01")    replace_all(message, 191, "!t", "^x03")    replace_all(message, 191, "!g", "^x04")        // Make sure message is not longer than 192 character. Will crash the server.    message[192] = '^0';     new team, ColorChange, index, MSG_Type;        if(id)    {        MSG_Type = MSG_ONE;        index = id;    } else {        index = FindPlayer();        MSG_Type = MSG_ALL;    }        team = get_user_team(index);    ColorChange = ColorSelection(index, MSG_Type, type);     ShowColorMessage(index, MSG_Type, message);            if(ColorChange)    {        Team_Info(index, MSG_Type, TeamName[team]);    }} ShowColorMessage(id, type, message[]){    static bool:saytext_used;    static get_user_msgid_saytext;    if(!saytext_used)    {        get_user_msgid_saytext = get_user_msgid("SayText");        saytext_used = true;    }    message_begin(type, get_user_msgid_saytext, _, id);    write_byte(id)          write_string(message);    message_end();  } Team_Info(id, type, team[]){    static bool:teaminfo_used;    static get_user_msgid_teaminfo;    if(!teaminfo_used)    {        get_user_msgid_teaminfo = get_user_msgid("TeamInfo");        teaminfo_used = true;    }    message_begin(type, get_user_msgid_teaminfo, _, id);    write_byte(id);    write_string(team);    message_end();     return 1;} ColorSelection(index, type, Color:Type){    switch(Type)    {        case RED:        {            return Team_Info(index, type, TeamName[1]);        }        case BLUE:        {            return Team_Info(index, type, TeamName[2]);        }        case GREY:        {            return Team_Info(index, type, TeamName[0]);        }    }     return 0;} FindPlayer(){    new i = -1;     while(i <= get_maxplayers())    {        if(is_user_connected(++i))            return i;    }     return -1;}

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests