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

modify c4 plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-30-2014 , 08:13   modify c4 plugin
Reply With Quote #1

hi i want to modify this plugin so the c4 can be picked and droped only i don't want it to be exploded or any thing else only pick and drop.
PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <engine> 
#include <cstrike>
#include <fun>

// Based on Bomberman! - From the NES :) & Superheromod

// amx_fakec4radius  -- Radius of damage
// amx_fakec4maxdmg  -- Maxdamage of explotion

new boom 
new MineEntity[33
new 
bombmodel[33]
new 
smoke 
new white 
new fire 
//----------------------------------------------------------------------------------------------
public plugin_init()
{
  
// Plugin Info
  
register_plugin("Fake C4","1.0","AssKicR")
 
  
register_event("ResetHUD","newRound","b")

  
register_concmd("amx_fakec4","plant_mine",ADMIN_SLAY,"")

  
register_cvar("amx_fakec4radius""400" 
  
register_cvar("amx_fakec4maxdmg""100" 
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
  
precache_sound("weapons/c4_plant.wav"
  
boom precache_model("sprites/zerogxplode.spr"

  
precache_model("models/w_c4.mdl")
  
copy(bombmodel,32,"models/w_c4.mdl")

  
smoke precache_model("sprites/steam1.spr"
  
white precache_model("sprites/white.spr"
  
fire precache_model("sprites/explode1.spr"
}
//----------------------------------------------------------------------------------------------
public newRound(id)
{
  if (
MineEntity[id]) 
  {
    
remove_entity(MineEntity[id])
    
MineEntity[id]=false 
  
}
  return 
PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public plant_mine(id)


  if (!
is_user_alive(id)) 
  { 
    
client_print(id,print_chat,"****You cannot plant mines while you are dead****"
    return 
PLUGIN_HANDLED 
  


  if (
MineEntity[id] != 0
  { 
    new 
Float:vExplodeAt[3
    
entity_get_vector(MineEntity[id], EV_VEC_originvExplodeAt

    
blowUp(idvExplodeAt)

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY
    
write_byte(3
    
write_coord(floatround(vExplodeAt[0])) 
    
write_coord(floatround(vExplodeAt[1])) 
    
write_coord(floatround(vExplodeAt[2])) 
    
write_short(boom
    
write_byte(50
    
write_byte(15
    
write_byte(0
    
message_end() 

    
remove_entity(MineEntity[id]) 
    
MineEntity[id] = false 

    
return PLUGIN_CONTINUE 
  

  else if (
MineEntity[id] == 0
  { 
    
MineEntity[id] = create_entity("info_target"
    if(
MineEntity[id] == 0) return PLUGIN_HANDLED_MAIN 

    entity_set_string
(MineEntity[id], EV_SZ_classname"remote_mine"
    
entity_set_model(MineEntity[id], bombmodel

    new 
Float:PlayerOrigin[3
    
entity_get_vector(idEV_VEC_originPlayerOrigin

    
entity_set_origin(MineEntity[id], PlayerOrigin

    
entity_set_int(MineEntity[id], EV_INT_solid0)    
    
entity_set_int(MineEntity[id], EV_INT_movetype6
    
entity_set_edict(MineEntity[id], EV_ENT_ownerid

    
emit_sound(MineEntity[id], CHAN_WEAPON"weapons/c4_plant.wav"1.0ATTN_NORM0PITCH_NORM

    
client_print(id,print_chat,"**** Bomb Planted!!!! ****"
  }
  
  return 
PLUGIN_CONTINUE 
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
   
MineEntity[id]=false 
   
return PLUGIN_CONTINUE 

//---------------------------------------------------------------------------------------------- 
public client_disconnect(id)

 if (
MineEntity[id]) 
 {
    
remove_entity(MineEntity[id])
    
MineEntity[id]=false 
 
}
 return 
PLUGIN_CONTINUE 

//----------------------------------------------------------------------------------------------
public blowUpidFloat:vExplodeAt[3] )

   new 
distanceBetween
   
new damagemultiplier
   
   
new name[32
   
get_user_name(id,name,31
   
set_user_rendering(id,kRenderFxNone,255,255,255kRenderNormal,16);
   new 
FFOnget_cvar_num("mp_friendlyfire")
   new 
origin[3
   
origin[0]=floatround(vExplodeAt[0])
   
origin[1]=floatround(vExplodeAt[1])
   
origin[2]=floatround(vExplodeAt[2])+37
   
   explode
(origin// blowup even if dead
   
   
for(new 1<= get_playersnum()+1a++) 
   { 
     if( 
is_user_alive(a) && ( get_user_team(id) != get_user_team(a) || FFOn != || a==id ) )
     {
       new 
origin1[3]
       
get_user_origin(a,origin1
       
distanceBetween get_distance(originorigin1 )
       if( 
distanceBetween get_cvar_num("amx_fakec4radius") )
       {
         
multiplier=(get_cvar_num("amx_fakec4maxdmg")*get_cvar_num("amx_fakec4maxdmg"))/get_cvar_num("amx_fakec4radius")
         
damage=(get_cvar_num("amx_fakec4radius")-distanceBetween)*multiplier
         damage
=sqrt(damage)
         
ExtraDamage(aiddamage"Fake C4")
       } 
// distance
     
// alive target...
   
// loop    
}
//---------------------------------------------------------------------------------------------- 
public explodevec1[3] )

   
// blast circles 
   
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1
   
write_byte21 
   
write_coord(vec1[0]) 
   
write_coord(vec1[1]) 
   
write_coord(vec1[2] + 16
   
write_coord(vec1[0]) 
   
write_coord(vec1[1]) 
   
write_coord(vec1[2] + 1936
   
write_shortwhite 
   
write_byte// startframe 
   
write_byte// framerate 
   
write_byte// life 2 
   
write_byte20 // width 16 
   
write_byte// noise 
   
write_byte188 // r 
   
write_byte220 // g 
   
write_byte255 // b 
   
write_byte255 //brightness 
   
write_byte// speed 
   
message_end() 

   
//Explosion2 
   
message_beginMSG_BROADCAST,SVC_TEMPENTITY
   
write_byte12 
   
write_coord(vec1[0]) 
   
write_coord(vec1[1]) 
   
write_coord(vec1[2]) 
   
write_byte188 // byte (scale in 0.1's) 188 
   
write_byte10 // byte (framerate) 
   
message_end() 

   
//TE_Explosion 
   
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1
   
write_byte
   
write_coord(vec1[0]) 
   
write_coord(vec1[1]) 
   
write_coord(vec1[2]) 
   
write_shortfire 
   
write_byte60 // byte (scale in 0.1's) 188 
   
write_byte10 // byte (framerate) 
   
write_byte// byte flags 
   
message_end() 


   
//Smoke 
   
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1
   
write_byte// 5 
   
write_coord(vec1[0]) 
   
write_coord(vec1[1]) 
   
write_coord(vec1[2]) 
   
write_shortsmoke 
   
write_byte10 )  // 2 
   
write_byte10 )  // 10 
   
message_end() 

//---------------------------------------------------------------------------------------------- 
stock ExtraDamage(idattackerdamageweaponDescription[] )
  {
     if ( 
is_user_alive(id) )
     {
       new 
userHealth=get_user_health(id)
       
set_user_health(iduserHealth damage )
       if ( 
userHealth damage <= )
       { 
         if ( 
get_user_team(id) != get_user_team(attacker) )
         {
           
// The person dying shouldn't get negative credit for this kill (so add it back)
           
set_user_fragsidget_user_frags(id) + )
           
           
// The killing should get credit for the frag
           
set_user_fragsattackerget_user_frags(attacker)+ )
           new 
money cs_get_user_money(attacker
           if (
cs_get_user_money(attacker) < 16000
              
cs_set_user_money(attacker,money 300,1)
         }
         else
         {
           
// The person dying shouldn't get negative credit for this kill (so add it back)
           
set_user_fragsidget_user_frags(id)+ )  
           
           
// The killer killed a teammember or self
           // Engine gives credit for the kill so let's take away that + 1
           
set_user_fragsattackerget_user_frags(attacker) - 2)
           
           new 
money cs_get_user_money(attacker
           if (
cs_get_user_money(attacker) != 0
              
cs_set_user_money(attacker,money 150,1)
         }
                  
         
message_beginMSG_BROADCASTget_user_msgid("DeathMsg"),{0,0,0},0)
         
write_byte(attacker)
         
write_byte(id)
         
write_byte(0)
         
write_string(weaponDescription)
         
message_end()
       }
     }
  }
//---------------------------------------------------------------------------------------------- 
stock sqrt(num
  { 
   
// Cool - Newton's Method - Ludwig
   
new div num 
   
new result 
   
while (div result
   {  
// end when div == result, or just below 
      
div = (div result) / // take mean value as new divisor 
      
result num div 
   

   return 
div 

__________________
JusTGo 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 05:37.


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