Raised This Month: $ Target: $400
 0% 

Minor Code Editing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
drosado15
Junior Member
Join Date: Aug 2009
Old 04-17-2010 , 20:23   Minor Code Editing
Reply With Quote #1

I've edited a Air Raid plugin to fit my needs. Now i need some help from the fellow coders of AlliedModders


The plugin is below and this is what i need coded for me.

1. The plugin seems to follow the person of the command around, I need it to go where the person had there mouse once the command /airstrike was activated.

2.Once /airstrike has been typed i need it to check if the person has had 6 kills without dying before it will send the airstrike

3. I need it to have two sounds one sound for when the T'S OR CT type /airstrike it will play a .wav that says "Friendly Airstrike Incoming" But at the same time it will play a .wav for the CT'S OR T'S saying "Enemy Airstrike Incoming" I already have the .wavs.

4. On some maps the bombs will actually blow up in the air and not hit the floor, Can we try to fix that?

5. The plugin needs to kill anyone in the range of it including it's own team mates.

So pretty much depending on what team the Air Strike is launched each team will get a certain message.


Please do what you can, This is a big help. Thanks all


PHP Code:
/* Air Strike 
   
    
   by eXplicit954
     April of 2010
    

   **COMMANDS** 
   /airstrike :: Triggers the air-raid sequence of events 
    
   **UPDATES** 
    
   Version 1.0: 
   - Initial Release 
    
*/ 

//-------------------------------------------------------------------------------------------------- 

#define MAXBOMBS 30 // Number of bombs 
#define BETWEENTIME 2 // Must be greater or equal to 1 
#define RADIUS 400 // Radius of bomb drops 

#include <amxmodx> // Amx mod include definitions 
#include <fun> // Fun Module 
#include <amxmisc> // Useful functions 
#include <engine> // Engine Plugin 

//-------------------------------------------------------------------------------------------------- 

// Declaring info variables 
new PLUGIN[]="AirStrike" 
new AUTHOR[]="eXplicit954" 
new VERSION[]="1.0" 

new inuse // variable to tell whether used already or not 
new donebombs MAXBOMBS // tells the engine how many bombs are finished dropping 
new bombs[MAXBOMBS// bomb array 
new Float:timers[MAXBOMBS// timers array 
new SpriteExplosion 

//-------------------------------------------------------------------------------------------------- 

// initalize function 
public plugin_init() 

    
register_plugin(PLUGIN,VERSION,AUTHOR// Register Function 
    
register_clcmd("say /airstrike""CMD_airraid"ADMIN_ALL// Register Airraid Command 
    
register_cvar("amx_airraidadmin","1",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)  


//-------------------------------------------------------------------------------------------------- 

// Precache 
public plugin_precache() 

    
precache_sound("ambience/siren.wav"// Siren Sound 
    
precache_sound("ambience/jetflyby1.wav"// Fly By Sound 
    
precache_model("models/rpgrocket.mdl"// Bomb Model 
    
SpriteExplosion precache_model("sprites/bexplo.spr"// precache explosion sprite 


//-------------------------------------------------------------------------------------------------- 

public CMD_airraid(idlevelcid

    new 

     
    
if (!cmd_access(idlevelcid1)) // Checks if the command user has access 
        
return PLUGIN_HANDLED 
     
    
if (inuse == && donebombs != MAXBOMBS
    { 
        
client_print(idprint_chat"You must wait longer before issuing another air strike"
        return 
PLUGIN_HANDLED 
    

     
    
inuse 
     
    emit_sound
(id,CHAN_AUTO"ambience/siren.wav"1.0ATTN_NORM0PITCH_NORM
     
    new 
Float:ftime 
    ftime 
float(BETWEENTIME
     
    
set_task(ftime"ACT_resetraid"
    
set_task(5.0"ACT_stopsound"
    
set_task(6.0"ACT_flybysound"id
     
    
set_task(6.0"CRT_bomb"id
     
    for (
0k<MAXBOMBSk++) 
    { 
        
timers[k] = random_float(1.0,2.0
    } 
     
    return 
PLUGIN_HANDLED 


public 
ACT_explodebomb(posistion

    new 
location[3
    new 
Float:Vec[3
    
IVecFVec(locationVec
    
entity_get_vector(bombs[posistion], EV_VEC_originVec
    
FVecIVec(Veclocation
    
location[2] = location[2] + 20 
    CRT_explosion
(locationSpriteExplosion25100
    
REM_bomb(posistion
     
    new 
players[32
    new 
playercount 
     
    get_players
(players,playercount,"a"
     
    for (new 
m=0m<playercountm++) 
    { 
        new 
playerlocation[3
        new 
resultdistance 
         
        get_user_origin
(players[m], playerlocation
         
        
resultdistance get_distance(playerlocation,location
         
        if(
resultdistance 100 && !access(players[m], ADMIN_SLAY)) 
        { 
            
fakedamage(players[m],"Air Raid",1000.0,DMG_BLAST
        } 
    } 


public 
REM_bomb(posistion

    
remove_entity(bombs[posistion]) 
    
bombs[posistion] = 


public 
CRT_bomb(id

    new 
location[3
    new 
randomlocation[3
    new 
endrandomlocation[3
    new 
randomx 
    
new randomy 
     
    get_user_origin
(idlocation
     
    
location[2] = location[2] + 500 
     
    donebombs 

     
    
for (new i=0i<MAXBOMBSi++) 
    { 
        
randomx random_num(-RADIUS,RADIUS
        
randomy random_num(-RADIUS,RADIUS
         
        
randomlocation[0] = location[0]+1*randomx 
        randomlocation
[1] = location[1]+1*randomy 
        randomlocation
[2] = location[2
         
        new 
Float:LocVec[3
        
IVecFVec(randomlocationLocVec
         
        
endrandomlocation[0] = randomlocation[0
        
endrandomlocation[1] = randomlocation[1
        
endrandomlocation[2] = randomlocation[2] - 
         
        
new Float:EndVec[3
        
IVecFVec(endrandomlocationEndVec
         
        new 
Float:VeloVec[3
        
VeloVec[0] = (EndVec[0] - LocVec[0])*1+
        VeloVec
[1] = (EndVec[1] - LocVec[1])*1+
        VeloVec
[2] = (EndVec[2] - LocVec[2])*1+
         
         
        bombs
[i] = create_entity("info_target"// creates the bombs 
        
if (!bombs[i]) // if not exist 
            
return PLUGIN_HANDLED 
         
        entity_set_string
(bombs[i], EV_SZ_classname"Bomb"// set name 
        
entity_set_edict(bombs[i], EV_ENT_ownerid// set owner 
        
entity_set_int(bombs[i], EV_INT_solid1// not a solid but interactive 
        
entity_set_int(bombs[i], EV_INT_movetype6// set move type to toss 
        
entity_set_model(bombs[i], "models/rpgrocket.mdl"// enterance sprite     
        
entity_set_origin(bombs[i], LocVec// start posistion     
        
entity_set_vector(bombs[i], EV_VEC_velocityVeloVec// follow velocity             
        
DispatchSpawn(bombs[i]) // Dispatches the Fire 
    

     
    for (new 
0k<MAXBOMBSk++) 
    { 
        
set_task(timers[k], "ACT_explodebomb"k
    } 
     
    return 
PLUGIN_CONTINUE 


public 
ACT_resetraid() 

    
inuse 
    
return PLUGIN_CONTINUE 


public 
ACT_stopsound() 

    
client_cmd(0,"stopsound"// stops sound on all clients  
    
return PLUGIN_CONTINUE 


public 
ACT_flybysound(id

    
emit_sound(id,CHAN_AUTO"ambience/jetflyby1.wav"1.0ATTN_NORM0PITCH_NORM
    return 
PLUGIN_CONTINUE 


public 
CRT_explosion(location[3], spritenamescaleframerateflags

    
message_beginMSG_BROADCASTSVC_TEMPENTITY
    
write_byte(3// TE_EXPLOSION 
    
write_coord(location[0]) 
    
write_coord(location[1]) 
    
write_coord(location[2]) 
    
write_short(spritename
    
write_byte(scale
    
write_byte(framerate
    
write_byte(flags
    
message_end() 


Last edited by drosado15; 04-17-2010 at 20:28.
drosado15 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 19:37.


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