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

[CSS] Bots drop C4 with E [CS:GO Style]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
g0oDnIgHt
Junior Member
Join Date: Oct 2020
Plugin ID:
7385
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Players can force nearby Bots to drop C4 with E [use button, +use]
    Old 11-21-2020 , 17:26   [CSS] Bots drop C4 with E [CS:GO Style]
    Reply With Quote #1

    Description:
    Players can force nearby Bots to drop C4 with E [use button, +use] like CS:GO

    Changelog:

    1.0
    First release!
    Attached Files
    File Type: sp Get Plugin or Get Source (c4drop.sp - 712 views - 1.9 KB)

    Last edited by g0oDnIgHt; 12-17-2020 at 02:37.
    g0oDnIgHt is offline
    doctawaald
    New Member
    Join Date: Apr 2021
    Old 05-13-2021 , 07:42   Re: [CSS] Bots drop C4 with E [CS:GO Style]
    Reply With Quote #2

    Hi,

    Plugin sounds great!
    But it does not work for me

    Here is my log :

    L 05/13/2021 - 078:26: [SM] Blaming: c4drop.smx
    L 05/13/2021 - 078:26: [SM] Call stack trace:
    L 05/13/2021 - 078:26: [SM] [0] SDKCall
    L 05/13/2021 - 078:26: [SM] [1] Line 69, /home/forums/content/files/3/0/5/0/4/6/185131.attach:ropC4
    L 05/13/2021 - 078:26: [SM] [2] Line 42, /home/forums/content/files/3/0/5/0/4/6/185131.attach::OnPlayerRunCmd

    If i compile it from my PC i get the following :
    L 05/13/2021 - 07:26:25: [SM] Blaming: c4drop.smx
    L 05/13/2021 - 07:26:25: [SM] Call stack trace:
    L 05/13/2021 - 07:26:25: [SM] [0] SDKCall
    L 05/13/2021 - 07:26:25: [SM] [1] Line 69, C:\Users\**USER**\Downloads\c4drop.sp:ropC4
    L 05/13/2021 - 07:26:25: [SM] [2] Line 42, C:\Users\**USER**\Downloads\c4drop.sp::OnPlay erRunCmd

    Any help ?
    doctawaald is offline
    L4D2Noob
    AlliedModders Donor
    Join Date: Mar 2020
    Location: Moscow
    Old 05-13-2021 , 17:36   Re: [CSS] Bots drop C4 with E [CS:GO Style]
    Reply With Quote #3

    Code:
    L 05/14/2021 - 00:35:01: [SM] Blaming: c4drop.smx
    L 05/14/2021 - 00:35:01: [SM] Call stack trace:
    L 05/14/2021 - 00:35:01: [SM]   [0] SDKCall
    L 05/14/2021 - 00:35:01: [SM]   [1] Line 69, /home/forums/content/files/3/0/5/0/4/6/185131.attach::DropC4
    L 05/14/2021 - 00:35:01: [SM]   [2] Line 42, /home/forums/content/files/3/0/5/0/4/6/185131.attach::OnPlayerRunCmd
    Bots don't drop bombs.
    __________________
    L4D2Noob is offline
    Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
    g0oDnIgHt
    Junior Member
    Join Date: Oct 2020
    Old 05-17-2021 , 01:51   Re: [CSS] Bots drop C4 with E [CS:GO Style]
    Reply With Quote #4

    Quote:
    Originally Posted by doctawaald View Post
    If i compile it from my PC i get the following :
    L 05/13/2021 - 07:26:25: [SM] Blaming: c4drop.smx
    L 05/13/2021 - 07:26:25: [SM] Call stack trace:
    L 05/13/2021 - 07:26:25: [SM] [0] SDKCall
    L 05/13/2021 - 07:26:25: [SM] [1] Line 69, C:\Users\**USER**\Downloads\c4drop.sp:ropC4
    L 05/13/2021 - 07:26:25: [SM] [2] Line 42, C:\Users\**USER**\Downloads\c4drop.sp::OnPlay erRunCmd
    Sourcemod version?

    Last edited by g0oDnIgHt; 05-17-2021 at 01:52.
    g0oDnIgHt is offline
    doctawaald
    New Member
    Join Date: Apr 2021
    Old 05-19-2021 , 14:41   Re: [CSS] Bots drop C4 with E [CS:GO Style]
    Reply With Quote #5

    That would be version 1.10.0.6497 running on Linux.

    Thanks!
    doctawaald is offline
    Ilusion9
    Veteran Member
    Join Date: Jun 2018
    Location: Romania
    Old 05-20-2021 , 03:15   Re: [CSS] Bots drop C4 with E [CS:GO Style]
    Reply With Quote #6

    PHP Code:

    #include <sourcemod>
    #include <sdktools>
    #include <cstrike>

    public Plugin myinfo =
    {
        
    name "Bots drop C4",
        
    author "gOoDnIgHt",
        
    description "Players can force nearby Bots to drop C4 with E",
        
    version "1.0",
        
    url "ExaGame.ir"
    };

    int g_LastButtons[MAXPLAYERS 1];

    public 
    void OnClientConnected(int client)
    {
        
    g_LastButtons[client] = 0;
    }

    public 
    void OnPlayerRunCmdPost(int clientint buttonsint impulse, const float vel[3], const float angles[3], int weaponint subtypeint cmdnumint tickcountint seed, const int mouse[2])
    {
        if (!
    IsClientInGame(client
            || 
    IsFakeClient(client)
            || !
    IsPlayerAlive(client)
            || 
    GetClientTeam(client) != CS_TEAM_T)
        {
            return;
        }
        
        
    int botTarget GetClientAimTarget(clienttrue);
        if (
    botTarget == -1
            
    || !IsEntityClient(botTarget)
            || !
    IsFakeClient(botTarget))
        {
            return;
        }
        
        
    int c4 GetPlayerWeaponSlot(botTargetCS_SLOT_C4);
        if (
    c4 == -1)
        {
            return;
        }
        
        
    float origin[3];
        
    float botOrigin[3];
        
        
    GetClientAbsOrigin(clientorigin);
        
    GetClientAbsOrigin(botTargetbotOrigin);
        
        if (
    GetVectorDistance(originbotOrigin) > 200.0)
        {
            return;
        }
        
        
    PrintHintText(client"Press E to take the bomb!");
        
        if (
    view_as<bool>(buttons IN_USE
            && !
    view_as<bool>(g_LastButtons[client] & IN_USE))
        {
            
    CS_DropWeapon(botTargetc4false);
            
    EquipPlayerWeapon(clientc4);
        }
        
        
    g_LastButtons[client] = buttons;
    }

    bool IsEntityClient(int client)
    {
        return (
    client && client <= MaxClients);

    __________________

    Last edited by Ilusion9; 05-20-2021 at 15:50.
    Ilusion9 is offline
    doctawaald
    New Member
    Join Date: Apr 2021
    Old 05-20-2021 , 14:19   Re: [CSS] Bots drop C4 with E [CS:GO Style]
    Reply With Quote #7

    Quote:
    Originally Posted by Ilusion9 View Post
    PHP Code:

    #include <sourcemod>
    #include <sdktools>
    #include <cstrike>

    public Plugin myinfo =
    {
        
    name "Bots drop C4",
        
    author "gOoDnIgHt",
        
    description "Players can force nearby Bots to drop C4 with E",
        
    version "1.0",
        
    url "ExaGame.ir"
    };

    int g_LastButtons[MAXPLAYERS 1];

    public 
    void OnClientConnected(int client)
    {
        
    g_LastButtons[client] = 0;
    }

    public 
    void OnPlayerRunCmdPost(int clientint buttonsint impulse, const float vel[3], const float angles[3], int weaponint subtypeint cmdnumint tickcountint seed, const int mouse[2])
    {
        if (!
    IsClientInGame(client
            || 
    IsFakeClient(client)
            || !
    IsPlayerAlive(client)
            || 
    GetClientTeam(client) != CS_TEAM_T)
        {
            return;
        }
        
        
    int botTarget GetClientAimTarget(clienttrue);
        if (
    botTarget == -1
            
    || !IsEntityClient(botTarget)
            || !
    IsFakeClient(botTarget))
        {
            return;
        }
        
        
    int c4 GetPlayerWeaponSlot(botTargetCS_SLOT_C4);
        if (!
    c4)
        {
            return;
        }
        
        
    float origin[3];
        
    float botOrigin[3];
        
        
    GetClientAbsOrigin(clientorigin);
        
    GetClientAbsOrigin(botTargetbotOrigin);
        
        if (
    GetVectorDistance(originbotOrigin) > 200.0)
        {
            return;
        }
        
        
    PrintHintText(client"Press E to take the bomb!");
        
        if (
    view_as<bool>(buttons IN_USE
            && !
    view_as<bool>(g_LastButtons[client] & IN_USE))
        {
            
    FakeClientCommand(botTarget"say_team I dropped the bomb!");
            
    CS_DropWeapon(botTargetc4false);
            
    EquipPlayerWeapon(clientc4);
        }
        
        
    g_LastButtons[client] = buttons;
    }

    bool IsEntityClient(int client)
    {
        return (
    client && client <= MaxClients);

    This code works.
    But it keeps spamming the HintText when you look at any bot in range, T or CT
    Then when you press use on the selected bot (with or without bomb it execs the say message)
    doctawaald is offline
    Ilusion9
    Veteran Member
    Join Date: Jun 2018
    Location: Romania
    Old 05-20-2021 , 15:50   Re: [CSS] Bots drop C4 with E [CS:GO Style]
    Reply With Quote #8

    Quote:
    Originally Posted by doctawaald View Post
    This code works.
    But it keeps spamming the HintText when you look at any bot in range, T or CT
    Then when you press use on the selected bot (with or without bomb it execs the say message)
    I fixed those, check the post again
    __________________
    Ilusion9 is offline
    doctawaald
    New Member
    Join Date: Apr 2021
    Old 05-22-2021 , 02:42   Re: [CSS] Bots drop C4 with E [CS:GO Style]
    Reply With Quote #9

    Quote:
    Originally Posted by Ilusion9 View Post
    I fixed those, check the post again
    Works like a charm!

    Thanks
    doctawaald 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 19:06.


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