AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [CS] Silent bomb removing (https://forums.alliedmods.net/showthread.php?t=206443)

alonelive 01-22-2013 11:06

[CS] Silent bomb removing
 
Hello. I read some topics about this..
But a can't find a better way.
1. Is possible remove bomb from spawned players without any text\chat messages (player dropped the bomb), red icons (when you lose c4 with cs_set_user_bpammo(player, CSW_C4, 0)), etc?
I tried some variants.. For example:

PHP Code:

register_logevent("logevent_function_p"3"2=Spawned_With_The_Bomb");

public 
logevent_function_p()
{
    new 
players[32], inum
    get_players
(playersinum)
    
    for (new 
0inum; ++i)
    {
        if(
user_has_weapon(players[i], CSW_C4))
        {
            
cs_set_user_bpammo(players[i], CSW_C40)
            
cs_set_user_plant(players[i], 00)
        }
    }


This way is good, when you playing alone (or with 1 enemy). When count of players > 2, every spawn of T player adds c4 to you. Or red point on radar does not removes, or bomb can not be removed, if bomb is dropped, or player marked as a "BOMB" in scoreboard (when player did't have a c4)..

One note: do not use removing func / info _bomb_target. Plugin-remover C4 should work some time (ex. 2 minutes from map start (warm up mod)).

2. when i use cs_set_user_plant, player's status in scoreboard updates ONLY AFTER death. Is possible to update status immediately?

ConnorMcLeod 01-22-2013 11:14

Re: [CS] Silent bomb removing
 
PHP Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>

#define VERSION "0.0.1"
#define PLUGIN ""

new gmsgBombPickup

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
register_logevent"LogEvent_Got_Bomb"3"2=Spawned_With_The_Bomb" )
    
register_logevent"LogEvent_Got_Bomb"3"2=Got_The_Bomb" )

    
gmsgBombPickup get_user_msgid("BombPickup")
}

public 
LogEvent_Got_Bomb( )
{
    new 
iFwd register_forward(FM_SetModel"SetModel"1)
    
engclient_cmd(0"drop""weapon_c4")
    
unregister_forward(FM_SetModeliFwd1)
}

public 
SetModelentmodel[] )
{
    if( 
equal(model"models/w_backpack.mdl") )
    {
        
call_think(ent)
        
message_begin(MSG_ALLgmsgBombPickup)
        
message_end()
    }



alonelive 01-22-2013 11:24

Re: [CS] Silent bomb removing
 
1 Attachment(s)
Thank you, i saw this your post.
Works fine. but.. :(
when bots connected, i see this

PS there are no other c4 plugins installed.

Is the way for blocking icons?

fl0werD 01-22-2013 13:09

Re: [CS] Silent bomb removing
 
Block message WeapPickup.

alonelive 01-22-2013 13:21

Re: [CS] Silent bomb removing
 
Thank you.
Solved with:

set_msg_block(get_user_msgid("AmmoPickup"), BLOCK_SET) // little C4 icons
set_msg_block(get_user_msgid("WeapPickup"), BLOCK_SET) // big c4 icons

This construction blocks all weapon pickup\drop icon messages.
Сойдет! :)

fl0werD 01-22-2013 14:30

Re: [CS] Silent bomb removing
 
PHP Code:

register_message(get_user_msgid("WeapPickup"), "MessageWeapPickup"

PHP Code:

public MessageWeapPickup(MsgIDMsgDestiPlayer)
{
    if(
get_msg_arg_int(1) == CSW_C4)
        return 
PLUGIN_HANDLED;

    return 
PLUGIN_CONTINUE;


But you only wanted to c4
Но ты же только хотел с4.


All times are GMT -4. The time now is 20:29.

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