Raised This Month: $12 Target: $400
 3% 

Auto Plant C4 after spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 02-07-2021 , 21:40   Auto Plant C4 after spawn
Reply With Quote #1

I tried to plant the C4 right when you spawn with the bombsite is the whole map. I found a way that create a fake C4 but it won't work with BOT since bot hook NETMSG_TEXTMSG #Bomb_Planted so it will just run around even when enemy team is all dead rather than defusing the bomb.

This is what I got so far.

PHP Code:
public plugin_precache()
{
    
CreateBombTarget();

}

public 
fw_Player_Spawn_Post(id)
{

    if(
is_user_alive(id) && user_has_weapon(idCSW_C4))
    {
        
engclient_cmd(id"weapon_c4")
        static 
entent fm_get_user_weapon_entity(idCSW_C4)
        
ExecutreHam(Ham_Weapon_PrimaryAttackent)
    }
}

public 
CreateBombTarget()
{
    new 
NewBombTarget engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"func_bomb_target"))
    if(
NewBombTarget 0)
    {
        
dllfunc(DLLFunc_SpawnNewBombTarget)
        
engfunc(EngFunc_SetSizeNewBombTargetFloat:{-100000.0,-100000.0,-100000.0}, Float:{100000.0,100000.0,100000.0})
    }

I have also tried those offset but it seem doesn't work too
PHP Code:
#define m_bStartedArming 320
#define m_bBombPlacedAnimation 321
#define m_flArmedTime 81 
I also tried Auto Plant plugins but it doesn't work.

This only show the starting part and a bar time but it can't actually plant the bomb.


It is the best if it can play full animation but as long as it can be plant, I am happy with that.
__________________
My plugin:

Last edited by Celena Luna; 02-07-2021 at 22:03.
Celena Luna is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 02-07-2021 , 21:51   Re: Auto Plant C4 after spawn
Reply With Quote #2

This one?
PHP Code:
/**
 * Sets the client's ability to plant the bomb and displays or hides the bomb
 * HUD icon.
 *
 * @note Only with this set can the client plant the bomb within the usual bomb
 *       target areas. If this is not set the user can not plant the bomb, even
 *       when he has one in the inventory. This is only correctly set when the
 *       client touches a bomb and picks it up "manually" (only possible for
 *       Terrorists), so this should be used if the bomb is added to the
 *       inventory through other means.
 *
 * @param index         Client index
 * @param plant         If nonzero the client will be able to plant the bomb,
 *                      otherwise he will be unable to
 * @param showbombicon  If nonzero the green C4 icon will be displayed on the
 *                      client's hud, otherwise it will be hidden
 *
 * @return              1 if the client is able to plant the bomb, 0 otherwise
 * @error               If the client index is not within the range of 1 to
 *                      MaxClients, or the client is not connected, an error
 *                      will be thrown.
 */
native cs_set_user_plant(indexplant 1showbombicon 1); 
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 02-07-2021 , 21:54   Re: Auto Plant C4 after spawn
Reply With Quote #3

Quote:
Originally Posted by +ARUKARI- View Post
This one?
PHP Code:
/**
 * Sets the client's ability to plant the bomb and displays or hides the bomb
 * HUD icon.
 *
 * @note Only with this set can the client plant the bomb within the usual bomb
 *       target areas. If this is not set the user can not plant the bomb, even
 *       when he has one in the inventory. This is only correctly set when the
 *       client touches a bomb and picks it up "manually" (only possible for
 *       Terrorists), so this should be used if the bomb is added to the
 *       inventory through other means.
 *
 * @param index         Client index
 * @param plant         If nonzero the client will be able to plant the bomb,
 *                      otherwise he will be unable to
 * @param showbombicon  If nonzero the green C4 icon will be displayed on the
 *                      client's hud, otherwise it will be hidden
 *
 * @return              1 if the client is able to plant the bomb, 0 otherwise
 * @error               If the client index is not within the range of 1 to
 *                      MaxClients, or the client is not connected, an error
 *                      will be thrown.
 */
native cs_set_user_plant(indexplant 1showbombicon 1); 
This one only show the plant StatusIcon, not actually plant it
__________________
My plugin:
Celena Luna is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 02-08-2021 , 10:23   Re: Auto Plant C4 after spawn
Reply With Quote #4

Maybe this will help you:
Only reAPI

native rg_plant_bomb()
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 02-08-2021 , 12:53   Re: Auto Plant C4 after spawn
Reply With Quote #5

Quote:
Originally Posted by Shadows Adi View Post
Maybe this will help you:
Only reAPI

native rg_plant_bomb()
reAPI did work but I need it to work on the original HLDS too
__________________
My plugin:
Celena Luna 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 07:14.


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