I was wrong, you don't need to resend, will post the code in few seconds/minutes.
Ok, tested on my listenserver, so 1 represent(=listenserver) my player id, all other players were BOTs.
Gives me the bomb each new round, you just have to make it works with your code.
PHP Code:
/* Copyright © 2009, ConnorMcLeod
Detect c4 is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Detect c4; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <hamsandwich>
#define PLUGIN "Detect c4"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"
// #define MAX_PLAYERS 32
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
new g_iMaxPlayers, gmsgScoreAttrib
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_iMaxPlayers = get_maxplayers()
gmsgScoreAttrib = get_user_msgid("ScoreAttrib")
RegisterHam(Ham_Touch, "weapon_c4", "C4_Touch")
}
public C4_Touch(iEnt, id)
{
if( IsPlayer(id) && is_user_bot(id) )
{
if( is_user_alive(1) )
{
SetHamParamEntity(2, 1)
SetPlanter(id, 0)
SetPlanter(1, 1)
}
}
}
SetPlanter(id, bOnOff)
{
new iFlags, iPlantSkill
if( bOnOff )
{
iFlags = (1<<1)
iPlantSkill = 1
}
cs_set_user_plant(id, iPlantSkill) // set player ability to plant the bomb (or not)
entity_set_int(id, EV_INT_body, iPlantSkill) // draw bomb at player's back (or not)
message_begin(MSG_BROADCAST, gmsgScoreAttrib) // show players as bomb carrier in scoreboard (or not)
write_byte(id)
write_byte(iFlags)
message_end()
}
__________________