Raised This Month: $ Target: $400
 0% 

Following RPG_ROCKET


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DahVid
Senior Member
Join Date: Jun 2005
Old 08-21-2005 , 14:36   Following RPG_ROCKET
Reply With Quote #1

Well, I know how to make a trail to my liking, but I don't know how to put it behind the rocket. I was thinking of finding the rocket with FM_SetModel but I also want to try to supercede and ignore the other trail {If possible} any suggestions?
DahVid is offline
More
Member
Join Date: Nov 2004
Location: Internet
Old 08-21-2005 , 14:47  
Reply With Quote #2

maybe this??

#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving
// short (entity:attachment to follow)
// short (sprite index)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte,byte,byte (color)
// byte (brightness)
More is offline
DahVid
Senior Member
Join Date: Jun 2005
Old 08-21-2005 , 16:01  
Reply With Quote #3

... How would I target entity? Surely if I put rpg_rocket there it wouldn't work, will it?
DahVid is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-21-2005 , 16:10  
Reply With Quote #4

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fakemeta> new sprite; public plugin_init() {     register_plugin("Drevil Ammo","0.1","DahVid")     register_forward(FM_SetModel,"ChangeAmmo",0) } public plugin_precache() {     precache_model("models/zombie.mdl")     sprite = precache_model("sprites/laserbeam.spr"); } public ChangeAmmo(entity,model[]) {     if(equali(model,"models/rpgrocket.mdl")==1) {         entity_set_model(entity,"models/zombie.mdl")         set_trail(entity);         return FMRES_SUPERCEDE     }     return FMRES_IGNORED } public set_trail(ent) {    if(!is_valid_ent(ent)) { return; }    message_begin(MSG_ALL,SVC_TEMPENTITY);    write_byte(22); // TE_BEAMFOLLOW    write_short(ent); // rocket    write_short(sprite); // laserbeam    write_byte(50); // life    write_byte(20); // width    write_byte(255); // R    write_byte(100); // G    write_byte(100); // B    write_byte(100); // brightness    message_end();    return; }

See if it works.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
DahVid
Senior Member
Join Date: Jun 2005
Old 08-21-2005 , 16:25  
Reply With Quote #5

It works, but is there anyway to kill the old one? ooooo
Also, how does it now ent is RPG_ROCKET? I don't understand..
DahVid is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-21-2005 , 18:14  
Reply With Quote #6

FM_SetModel is called when an entity is given a model. Every time that happens, we see if it is being given the model "models/rpgrocket.mdl" -- if it is we assume it's an RPG rocket, give it another model, and call the function set_trail, passing the entity ID along. In set_trail we send a message to have a beam follow the entity we told it to.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 14:25.


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