Raised This Month: $32 Target: $400
 8% 

[L4D2] Item hint


Post New Thread Reply   
 
Thread Tools Display Modes
Author
fdxx
Member
Join Date: Oct 2020
Location: 0xdeadbeef
Plugin ID:
7734
Plugin Version:
0.3
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    When using 'Look' in vocalize menu, print corresponding item to chat area.
    Old 07-28-2021 , 08:52   [L4D2] Item hint
    Reply With Quote #1

    Improved version of HarryPotter


    Description:
    • When using 'Look' in vocalize menu (default is to press the Z button), print corresponding item to chat area.
    • Supported items: first aid kit, defibrillator, pain pills, adrenaline, bile bomb, molotov, pipe bomb, laser sight, incendiary, explosive.
    • You must be close to the item, the approximate distance: 96 (default value of cvar player_use_radius).

    Related Plugins:
    • Vocalize To Chat: Cannot identify command "vocalize smartlook" specific item. Require Scene Processor plugin.
    • This plugin: Only support command "vocalize smartlook". Not required Scene Processor plugin.

    Thanks:
    • BHaType - Provide get item index method.
    Attached Files
    File Type: txt l4d2_item_hint.txt (123 Bytes, 753 views)
    File Type: sp Get Plugin or Get Source (l4d2_item_hint.sp - 501 views - 3.6 KB)

    Last edited by fdxx; 01-10-2023 at 21:30. Reason: update
    fdxx is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 07-30-2021 , 12:23   Re: [L4D2] Item hint
    Reply With Quote #2

    cool plugin, I love it
    I add more models

    PHP Code:
    static const char g_sItems[][][] = 
    {
        
    //MODEL_NAME, WEP_NAME
        
    {"models/w_models/weapons/w_eq_medkit.mdl""First aid kit!"},
        {
    "models/w_models/weapons/w_eq_defibrillator.mdl""Defibrillator!"},
        {
    "models/w_models/weapons/w_eq_painpills.mdl""Pain pills!"},
        {
    "models/w_models/weapons/w_eq_adrenaline.mdl""Adrenaline!"},
        {
    "models/w_models/weapons/w_eq_bile_flask.mdl""Bile Bomb!"},
        {
    "models/w_models/weapons/w_eq_molotov.mdl""Molotov!"},
        {
    "models/w_models/weapons/w_eq_pipebomb.mdl""Pipe bomb!"},
        {
    "models/w_models/Weapons/w_laser_sights.mdl""Laser Sight!"},
        {
    "models/w_models/weapons/w_eq_incendiary_ammopack.mdl""Incendiary UpgradePack!"},
        {
    "models/w_models/weapons/w_eq_explosive_ammopack.mdl""Explosive UpgradePack!"},
        {
    "models/props/terror/ammo_stack.mdl""Ammo!"},
        {
    "models/props_unique/spawn_apartment/coffeeammo.mdl""Ammo!"},
        {
    "models/props/de_prodigy/ammo_can_02.mdl""Ammo!"},
        {
    "models/weapons/melee/w_chainsaw.mdl""Chainsaw!"},
        {
    "models/w_models/weapons/w_pistol_B.mdl""Pistol!"},
        {
    "models/w_models/weapons/w_desert_eagle.mdl""Magnum!"},
        {
    "models/w_models/weapons/w_shotgun.mdl""Pump Shotgun!"},
        {
    "models/w_models/weapons/w_pumpshotgun_A.mdl""Shotgun Chrome!"},
        {
    "models/w_models/weapons/w_smg_uzi.mdl""Uzi!"},
        {
    "models/w_models/weapons/w_smg_a.mdl""Silenced Smg!"},
        {
    "models/w_models/weapons/w_smg_mp5.mdl""MP5!"},
        {
    "models/w_models/weapons/w_rifle_m16a2.mdl""Rifle!"},
        {
    "models/w_models/weapons/w_rifle_sg552.mdl""SG552!"},
        {
    "models/w_models/weapons/w_rifle_ak47.mdl""AK47!"},
        {
    "models/w_models/weapons/w_desert_rifle.mdl""Desert Rifle!"},
        {
    "models/w_models/weapons/w_shotgun_spas.mdl""Shotgun Spas!"},
        {
    "models/w_models/weapons/w_autoshot_m4super.mdl""Auto Shotgun!"},
        {
    "models/w_models/weapons/w_sniper_mini14.mdl""Hunting Rifle!"},
        {
    "models/w_models/weapons/w_sniper_military.mdl""Military Sniper!"},
        {
    "models/w_models/weapons/w_sniper_scout.mdl""Scout!"},
        {
    "models/w_models/weapons/w_sniper_awp.mdl""AWP!"},
        {
    "models/w_models/weapons/w_grenade_launcher.mdl""Grenade Launcher!"},
        {
    "models/w_models/weapons/w_m60.mdl""M60!"},
        {
    "models/props_junk/gascan001a.mdl""Gas Can!"},
        {
    "models/props_junk/explosive_box001.mdl""Firework!"},
        {
    "models/props_junk/propanecanister001a.mdl""Propane Tank!"},
        {
    "models/props_equipment/oxygentank01.mdl""Oxygen Tank!"},
        {
    "models/props_junk/gnome.mdl""Gnome!"},
        {
    "models/w_models/weapons/w_cola.mdl""Cola!"},
    }; 
    __________________

    Last edited by HarryPotter; 08-23-2021 at 23:15.
    HarryPotter is offline
    swiftswing1
    Member
    Join Date: Oct 2020
    Old 07-31-2021 , 03:15   Re: [L4D2] Item hint
    Reply With Quote #3

    thanks guys. nice plugin! similar to this one but simpler, which i prefer.

    in addition to HarryPotter, here's a few more models if interested:
    PHP Code:
    static const char g_sItems[][][] = 
    {
        
    //MODEL_NAME, WEP_NAME
        
    {"models/w_models/weapons/50cal.mdl"".50 Cal Machine Gun here!"},
        {
    "models/w_models/weapons/w_minigun.mdl""Minigun here!"},
        {
    "models/w_models/weapons/w_knife_t.mdl""Knife!"},
        {
    "models/weapons/melee/w_bat.mdl""Baseball Bat!"},
        {
    "models/weapons/melee/w_cricket_bat.mdl""Cricket Bat!"},
        {
    "models/weapons/melee/w_crowbar.mdl""Crowbar!"},
        {
    "models/weapons/melee/w_electric_guitar.mdl""Electric Guitar!"},
        {
    "models/weapons/melee/w_fireaxe.mdl""Fireaxe!"},
        {
    "models/weapons/melee/w_frying_pan.mdl""Frying Pan!"},
        {
    "models/weapons/melee/w_katana.mdl""Katana!"},
        {
    "models/weapons/melee/w_machete.mdl""Machete!"},
        {
    "models/weapons/melee/w_tonfa.mdl""Nightstick!"},
        {
    "models/weapons/melee/w_golfclub.mdl""Golf Club!"},
        {
    "models/weapons/melee/w_pitchfork.mdl""Pitckfork!"},
        {
    "models/weapons/melee/w_shovel.mdl""Shovel!"},
        {
    "models/props/terror/exploding_ammo.mdl""Explosive Ammo!"},
        {
    "models/props/terror/incendiary_ammo.mdl""Incendiary Ammo!"},
    }; 
    swiftswing1 is offline
    yabi
    Senior Member
    Join Date: Jun 2021
    Location: Taiwan
    Old 08-23-2021 , 22:21   Re: [L4D2] Item hint
    Reply With Quote #4

    Not available
    Why?
    Is it malfunctioning?
    yabi is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 08-24-2021 , 04:00   Re: [L4D2] Item hint
    Reply With Quote #5

    Quote:
    Originally Posted by yabi View Post
    Not available
    Please more specific.
    __________________
    HarryPotter is offline
    yabi
    Senior Member
    Join Date: Jun 2021
    Location: Taiwan
    Old 08-29-2021 , 10:41   Re: [L4D2] Item hint
    Reply With Quote #6

    Quote:
    Originally Posted by HarryPotter View Post
    Please more specific.

    I pressed the button z, when I looked at the item, it was not displayed in the chat window
    yabi is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 08-29-2021 , 11:52   Re: [L4D2] Item hint
    Reply With Quote #7

    Should probably mention how to install such as the .txt goes into gamedata.

    Using "StrContains" is kinda inefficient for this, I assume it's always going to be "vocalize smartlook #" so just use strncmp(sCmdString[9], "smartlook #", 11) == 0 to start matching from the 10th character and only matching those 11 characters.

    It's unnecessary to have the string size sCmdString[256] you can use something like 32.

    It would be faster to replace "g_sItems" array with a StringMap and then searching if the value exists in there with the StringMap natives instead of looping through the array. Fill the StringMap with the data in plugin start.
    __________________

    Last edited by Silvers; 08-29-2021 at 11:59.
    Silvers is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 08-29-2021 , 12:50   Re: [L4D2] Item hint
    Reply With Quote #8

    Quote:
    Originally Posted by yabi View Post
    I pressed the button z, when I looked at the item, it was not displayed in the chat window
    Are you sure the plugin actually running?
    do you check error.log?
    __________________
    HarryPotter is offline
    yabi
    Senior Member
    Join Date: Jun 2021
    Location: Taiwan
    Old 08-30-2021 , 07:42   Re: [L4D2] Item hint
    Reply With Quote #9

    Quote:
    Originally Posted by HarryPotter View Post
    Are you sure the plugin actually running?
    do you check error.log?

    This kind of plug-in shouldn't...
    Can it only be used on dedicated servers?
    The local server cannot be used?
    yabi is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 08-30-2021 , 09:06   Re: [L4D2] Item hint
    Reply With Quote #10

    Quote:
    Originally Posted by yabi View Post
    This kind of plug-in shouldn't...
    Can it only be used on dedicated servers?
    The local server cannot be used?
    This plugin works on both.



    檢查插件有沒有在執行
    控制台打上
    PHP Code:
    sm plugins list 
    檢查插件有沒有發生錯誤
    addons/sourcemod/logs/error.log
    __________________
    HarryPotter is offline
    Reply


    Thread Tools
    Display Modes

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

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

    Forum Jump


    All times are GMT -4. The time now is 16:18.


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