Raised This Month: $ Target: $400
 0% 

Block the flashlight on zombie bots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 04-27-2024 , 09:55   Block the flashlight on zombie bots
Reply With Quote #1

Can you put some kind of check so that the bots, when they are zombies, can't drop the flashlight. With real players, when they are zombies, it does not allow them.
Attached Files
File Type: sma Get Plugin or Get Source (zombie_plague40.sma - 39 views - 344.0 KB)

Last edited by .:cs.stambeto:.; 04-27-2024 at 12:21.
.:cs.stambeto:. is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-27-2024 , 17:30   Re: Block the flashlight on zombie bots
Reply With Quote #2

Feel free to refer your request on ZP Section.
__________________
CS:CZ > CS 1.6
Ace67 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-28-2024 , 09:10   Re: Block the flashlight on zombie bots
Reply With Quote #3

Drop or turn on flashlight? Or drop flashbang?
__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video bellow to see zombie frost grenade

https://youtu.be/j0zspNfN-AM?si=_1IiGPETN-GQY9Ua

Look at the video below to see Zombie blind grenade

https://youtu.be/ORC7ZmoaipQ?si=QC8Bul96QGitUwX4
Krtola is offline
Send a message via Skype™ to Krtola
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 04-28-2024 , 10:29   Re: Block the flashlight on zombie bots
Reply With Quote #4

Quote:
Originally Posted by Krtola View Post
Drop or turn on flashlight? Or drop flashbang?
If the bot is a zombie, it can't turn on the flashlight.
.:cs.stambeto:. is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-28-2024 , 11:48   Re: Block the flashlight on zombie bots
Reply With Quote #5

Ok,add this
PHP Code:
if (g_isbot[id])
        return; 
in
PHP Code:
public fw_CmdStart(idhandle
just bellow
PHP Code:
// Not alive
    
if (!g_isalive[id])
        return; 
after that compile sma
__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video bellow to see zombie frost grenade

https://youtu.be/j0zspNfN-AM?si=_1IiGPETN-GQY9Ua

Look at the video below to see Zombie blind grenade

https://youtu.be/ORC7ZmoaipQ?si=QC8Bul96QGitUwX4

Last edited by Krtola; 04-28-2024 at 11:51.
Krtola is offline
Send a message via Skype™ to Krtola
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 04-28-2024 , 13:23   Re: Block the flashlight on zombie bots
Reply With Quote #6

Quote:
Originally Posted by Krtola View Post
Ok,add this
PHP Code:
if (g_isbot[id])
        return; 
in
PHP Code:
public fw_CmdStart(idhandle
just bellow
PHP Code:
// Not alive
    
if (!g_isalive[id])
        return; 
after that compile sma
Well, I see them again that they can put the flashlight on, but I want them not to.
.:cs.stambeto:. is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-28-2024 , 15:01   Re: Block the flashlight on zombie bots
Reply With Quote #7

PHP Code:
// Forward CmdStart
public fw_CmdStart(idhandle)
{
    
// Not alive
    
if (!g_isalive[id])
        return;

        if(
g_isbot[id])
        return 
FMRES_IGNORED
    
    
// This logic looks kinda weird, but it should work in theory...
    // p = g_zombie[id], q = g_survivor[id], r = g_cached_customflash
    // ¬(p v q v (¬p ^ r)) <==> ¬p ^ ¬q ^ (p v ¬r)
    
if (!g_zombie[id] && !g_survivor[id] && (g_zombie[id] || !g_cached_customflash))
        return;
    
    
// Check if it's a flashlight impulse
    
if (get_uc(handleUC_Impulse) != IMPULSE_FLASHLIGHT)
        return;
    
    
// Block it I say!
    
set_uc(handleUC_Impulse0)
    
    
// Should human's custom flashlight be turned on?
    
if (!g_zombie[id] && !g_survivor[id] && g_flashbattery[id] > && get_gametime() - g_lastflashtime[id] > 1.2)
    {
        
// Prevent calling flashlight too quickly (bugfix)
        
g_lastflashtime[id] = get_gametime()
        
        
// Toggle custom flashlight
        
g_flashlight[id] = !(g_flashlight[id])
        
        
// Play flashlight toggle sound
        
emit_sound(idCHAN_ITEMsound_flashlight1.0ATTN_NORM0PITCH_NORM)
        
        
// Update flashlight status on the HUD
        
message_begin(MSG_ONEg_msgFlashlight_id)
        
write_byte(g_flashlight[id]) // toggle
        
write_byte(g_flashbattery[id]) // battery
        
message_end()
        
        
// Remove previous tasks
        
remove_task(id+TASK_CHARGE)
        
remove_task(id+TASK_FLASH)
        
        
// Set the flashlight charge task
        
set_task(1.0"flashlight_charge"id+TASK_CHARGE__"b")
        
        
// Call our custom flashlight task if enabled
        
if (g_flashlight[id]) set_task(0.1"set_user_flashlight"id+TASK_FLASH__"b")
    }
        return 
FMRES_HANDLED

If this doesn't work either,then instead of
PHP Code:
if(g_isbot[id])
        return 
FMRES_IGNORED 
wryte this
PHP Code:
if(is_user_bot(id))
        return 
FMRES_IGNORED 
__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video bellow to see zombie frost grenade

https://youtu.be/j0zspNfN-AM?si=_1IiGPETN-GQY9Ua

Look at the video below to see Zombie blind grenade

https://youtu.be/ORC7ZmoaipQ?si=QC8Bul96QGitUwX4

Last edited by Krtola; 04-28-2024 at 15:06.
Krtola is offline
Send a message via Skype™ to Krtola
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 04-28-2024 , 22:12   Re: Block the flashlight on zombie bots
Reply With Quote #8

Error

zombie_plague40.sma(3647) : warning 209: function "fw_CmdStart" should return a value
zombie_plague40.sma(3649) : warning 217: loose indentation
zombie_plague40.sma(3650) : error 078: function uses both "return" and "return <value>"
zombie_plague40.sma(3655) : warning 217: loose indentation
zombie_plague40.sma(3656) : warning 209: function "fw_CmdStart" should return a value
zombie_plague40.sma(3660) : warning 209: function "fw_CmdStart" should return a value
zombie_plague40.sma(3693) : warning 217: loose indentation
zombie_plague40.sma(3693) : error 078: function uses both "return" and "return <value>"
.:cs.stambeto:. is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-29-2024 , 09:05   Re: Block the flashlight on zombie bots
Reply With Quote #9

Ok,lets try this.Add new plugin in plugins.ini
PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN "Flashlight Block"
#define VERSION "1.0"
#define AUTHOR "AMXX Community"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_impulse(idimpulse)
{
    if(
impulse == 100)
    {
        if(
is_user_bot(id))
        {
            
                return 
PLUGIN_CONTINUE
        
}
    }
    return 
PLUGIN_CONTINUE

__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video bellow to see zombie frost grenade

https://youtu.be/j0zspNfN-AM?si=_1IiGPETN-GQY9Ua

Look at the video below to see Zombie blind grenade

https://youtu.be/ORC7ZmoaipQ?si=QC8Bul96QGitUwX4
Krtola is offline
Send a message via Skype™ to Krtola
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 04-29-2024 , 11:13   Re: Block the flashlight on zombie bots
Reply With Quote #10

Again I can see them being able to use it as zombies.
.:cs.stambeto:. is offline
Reply



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 04:47.


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