Raised This Month: $ Target: $400
 0% 

Teleport bomb carrier to bomb site.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-15-2017 , 15:25   Re: Teleport bomb carrier to bomb site.
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
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(); }

Last edited by suhdude; 11-15-2017 at 15:29.
suhdude is offline
 



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 17:18.


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