Quote:
Originally Posted by HamletEagle
Try looking in bomb status, there's a menu that allows admins to teleport to a bomb site(a/b). But the code is pretty complicated so I'm not sure you will understand.
So, what do you need? Spawn a planted bomb or move the carrier to a random bombsite?
|
We play retake scenarios together on my server right now.
And it looks like this:
T spawn on B site (using the map spawn editor plugin)
CT spawn outside B site and in tunnels.
Both teams are given full gear, but some different grenades.
The bomb is automatically given to every terrorist, and a plugin forces the player touching the bomb zone to plant the bomb instantly on spawn, all other bombs are deleted.
This works alright, only problem is that you can only have 5 terrorist spawn points because someone has to touch the bombzone. So you can't spread the spawn points around and make it different.
So the best thing would be if the bomb was automatically planted on round start, without a player having to plant it.
This is the plugin I'm using right now to force plant the bomb.
I basically slaughtered other peoples code and put something together, not very pretty.
Code:
new g_c4timer
new mp_c4timer
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("HLTV", "new_round", "a", "1=0", "2=0");
register_event("HLTV", "event_hltv", "a", "1=0", "2=0")
mp_c4timer = get_cvar_pointer("mp_c4timer")
}
public event_hltv()
g_c4timer = get_pcvar_num(mp_c4timer)
public plugin_precache() precache_sound("radio/bombpl.wav");
stock is_user_in_plant_zone( id )
{
return (cs_get_user_mapzones(id) & CS_MAPZONE_BOMBTARGET)
}
public new_round()
{
new players[32];
new playercount, i;
get_players(players, playercount);
for (i=0; i<playercount; i++)
set_task(0.5,"plant_bomb",players[i]);
return PLUGIN_CONTINUE;
}
public plant_bomb(id)
{
if ( is_user_in_plant_zone( id ) )
{
set_task(0.5,"PlantABomb", id);
set_task(10.5,"change_clock", id);
emit_sound(0,CHAN_AUTO,"radio/bombpl.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM);
}
}
public PlantABomb( player ) {
new iEntity = create_entity( "weapon_c4" );
if( !iEntity )
return;
DispatchKeyValue( iEntity, "detonatedelay", "0" );
DispatchSpawn( iEntity );
new Float:origin[ 3 ];
pev( player, pev_origin, origin );
origin[ 0 ] += 30.0
// or
origin[ 1 ] += 30.0
engfunc( EngFunc_SetOrigin, iEntity, origin );
force_use( iEntity, iEntity ); // This plants it
}
public change_clock(id)
{
message_begin(MSG_ALL, get_user_msgid("RoundTime"))
write_short (g_c4timer);
message_end();
}