AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Item hint (https://forums.alliedmods.net/showthread.php?t=333669)

fdxx 07-28-2021 08:52

[L4D2] Item hint
 
2 Attachment(s)
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.

HarryPotter 07-30-2021 12:23

Re: [L4D2] Item hint
 
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!"},
}; 


swiftswing1 07-31-2021 03:15

Re: [L4D2] Item hint
 
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!"},
}; 


yabi 08-23-2021 22:21

Re: [L4D2] Item hint
 
Not available
Why?
Is it malfunctioning?

HarryPotter 08-24-2021 04:00

Re: [L4D2] Item hint
 
Quote:

Originally Posted by yabi (Post 2756022)
Not available

Please more specific.

yabi 08-29-2021 10:41

Re: [L4D2] Item hint
 
Quote:

Originally Posted by HarryPotter (Post 2756040)
Please more specific.


I pressed the button z, when I looked at the item, it was not displayed in the chat window

Silvers 08-29-2021 11:52

Re: [L4D2] Item hint
 
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.

HarryPotter 08-29-2021 12:50

Re: [L4D2] Item hint
 
Quote:

Originally Posted by yabi (Post 2756458)
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?

yabi 08-30-2021 07:42

Re: [L4D2] Item hint
 
Quote:

Originally Posted by HarryPotter (Post 2756476)
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?:(

HarryPotter 08-30-2021 09:06

Re: [L4D2] Item hint
 
Quote:

Originally Posted by yabi (Post 2756549)
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


All times are GMT -4. The time now is 23:40.

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