Raised This Month: $ Target: $400
 0% 

Help with plasma shoot.


Post New Thread Reply   
 
Thread Tools Display Modes
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 - 625 views - 21.8 KB)
FromTheFuture is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 11-04-2014 , 14:42   Re: Help with plasma shoot.
Reply With Quote #2

Try setting size -1.0, -1.0, -1.0; 1.0, 1.0, 1.0
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 11-04-2014 , 15:53   Re: Help with plasma shoot.
Reply With Quote #3

Quote:
Originally Posted by GuskiS View Post
Try setting size -1.0, -1.0, -1.0; 1.0, 1.0, 1.0
The problem was not solved
FromTheFuture is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 11-04-2014 , 16:27   Re: Help with plasma shoot.
Reply With Quote #4

try lower value like 0.5, if it's still not working try 0.4 and so on. You see what i mean ?
Fr33m@n is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 11-04-2014 , 16:56   Re: Help with plasma shoot.
Reply With Quote #5

Quote:
Originally Posted by Fr33m@n View Post
try lower value like 0.5, if it's still not working try 0.4 and so on. You see what i mean ?
But -0.005 is lower than 0.5.
FromTheFuture is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 11-06-2014 , 10:17   Re: Help with plasma shoot.
Reply With Quote #6

No idea? I solved part of this -> change model from spr to small mdl. And I wanna ask, entity size is take model size?
FromTheFuture is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 11-06-2014 , 11:02   Re: Help with plasma shoot.
Reply With Quote #7

^It's any size according to what you set regardless of model size.
RateX is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 11-06-2014 , 11:33   Re: Help with plasma shoot.
Reply With Quote #8

don't try to think in a mathematic way, i was talking about absolute value.
keep the - where they are.

And there is nothing related to the models here.
Models don't affect touchability.

Last edited by Fr33m@n; 11-06-2014 at 11:34.
Fr33m@n is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 11-06-2014 , 13:01   Re: Help with plasma shoot.
Reply With Quote #9

Anyway any manipulation no has effect with this, only change the model.
FromTheFuture is offline
Lycode
Junior Member
Join Date: Aug 2014
Old 11-06-2014 , 18:00   Re: Help with plasma shoot.
Reply With Quote #10

Set the size after the model. You don't need to use anything smaller than 1.0 for the size. That's small enough as it is.

PHP Code:
entity_set_model(ePlasmaBall"sprites/plasma.spr")//model
entity_set_size(ePlasmaBallFloat:{-1.0, -1.0, -1.0}, Float:{1.01.01.0})//set size 
__________________
-This too shall pass
Lycode is offline
Reply



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