Raised This Month: $ Target: $400
 0% 

Help with plasma shoot.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 11-04-2014 , 13:41   Help with plasma shoot.
Reply With Quote #1

Hi, I need help with plasma shoot on predator mod.
Shot can not pass through the door.
Watch the video http://www.youtube.com/watch?v=bfibP...ature=youtu.be
Full source in attachment, source part with create entity:
PHP Code:
 public cmdShoot(id)
 {
    if(
g_predator[id] >= 0)
    {
        if(
plasma[id] > 0)
        {
            
plasma[id]--;
            
ColorPrint(id"You got %i plasma left"plasma[id]);

            new 
origin[3], Float:fOrigin[3]//player origin... and float origin
            
new Float:velocity[3// speed of the entity to move

            
get_user_origin(id,origin,1)//get user origin - int
            
IVecFVec(originfOrigin)// convert the int into float

            
new ePlasmaBall create_entity("info_target"// create the plasma ball
            
entity_set_string(ePlasmaBallEV_SZ_classname"PlasmaBall"//set name of the entity "PlasmaBall"

            
new Float:posAdjust[3//Used for adjusting the starting position
            
velocity_by_aim(id50posAdjust)  //was 70//You can replace 50 with whatever , get origin of the AIM
            
fOrigin[0] += posAdjust[0]
            
fOrigin[1] += posAdjust[1]
            
fOrigin[2] += posAdjust[2]
            
entity_set_vector(ePlasmaBallEV_VEC_originfOrigin)//set the shot's direction

            
entity_set_size(ePlasmaBallFloat:{-0.005, -0.005, -0.005}, Float:{0.0050.0050.005})//set size
            
entity_set_int(ePlasmaBall,     EV_INT_solid,         SOLID_BBOX)//make solid
            
entity_set_int(ePlasmaBall,     EV_INT_movetype,     MOVETYPE_FLYMISSILE)//set movetype
            
            
entity_set_float(ePlasmaBall,     EV_FL_framerate,     1.0)//framerate
            
entity_set_int(ePlasmaBall,     EV_INT_rendermode,     5)//randermode
            
entity_set_float(ePlasmaBall,     EV_FL_renderamt,     255.0)//visable
            
entity_set_float(ePlasmaBall,     EV_FL_scale,         1.20)//dunno
            
entity_set_model(ePlasmaBall,     "sprites/plasma.spr")//model
            
emit_sound(ePlasmaBallCHAN_AUTO"predator/plasma_shoot.wav"1.0ATTN_NORM0PITCH_NORM)//sound
            
VelocityByAim(id,1150,velocity)//speed
            
entity_set_vector(ePlasmaBall,EV_VEC_velocity,velocity)//set the shot's speed
            
entity_set_edict(ePlasmaBallEV_ENT_ownerid)

            
// Create a trail...
            /* Broadcast to all players*/
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)     // TE_BEAMFOLLOW ( msg #22) create a line of decaying beam segments until entity stops moving
            
write_byte(22)                // msg id
            
write_short(ePlasmaBall)      // short (entity:attachment to follow)
            
write_short(gTrailModel)      // short (sprite index)
            
write_byte(25)                // byte (life in 0.1's)
            
write_byte(5)                 // byte (line width in 0.1's)
            
write_byte(42)                // byte (color)
            
write_byte(170)               // byte (color)
            
write_byte(255)               // byte (color)
            
write_byte(255)               // byte (brightness)
            
message_end()
            return 
PLUGIN_HANDLED
        
}
        else
        {
            
set_hudmessage(0,30,200,-1.0,0.75,0,3.0,10.0,0.15,0.5,1)
            
show_hudmessage(id,"You are out of ammo")
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED
 

Attached Files
File Type: sma Get Plugin or Get Source (Predator.sma - 624 views - 21.8 KB)
FromTheFuture is offline
 


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


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