AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blood effect/beam ... [UNANSWERED] (https://forums.alliedmods.net/showthread.php?t=51577)

Davidos 02-20-2007 12:12

Blood effect/beam ... [UNANSWERED]
 
Is it possible to send some kind of blood stream/beam <'urinate' mod anyone?>

from one player to another? I need it for the vampire mod I am building -_-

UPDATE

I just got a mail from the server host, either I release this plug for his server or he is scrapping the idea...

SAMURAI16 02-20-2007 14:01

Re: Blood effect/beam ...
 
you can use TE_BLOODSTREAM
Code:

#define    TE_BLOODSTREAM  101           
 write_byte(TE_BLOODSTREAM)
 write_coord(position.x)
 write_coord(position.y)
 write_coord(position.z)
 write_coord(vector.x)
 write_coord(vector.y)
 write_coord(vector.z)
 write_byte(color)
 write_byte(speed)

If you want to send blood from an person to another just take a look on AMX Piss plugin and change from that yellow stream in a blood effects

Davidos 02-20-2007 14:12

Re: Blood effect/beam ...
 
Quote:

Originally Posted by SAMURAI16 (Post 442955)
you can use TE_BLOODSTREAM
Code:

#define    TE_BLOODSTREAM  101           
 write_byte(TE_BLOODSTREAM)
 write_coord(position.x)
 write_coord(position.y)
 write_coord(position.z)
 write_coord(vector.x)
 write_coord(vector.y)
 write_coord(vector.z)
 write_byte(color)
 write_byte(speed)

If you want to send blood from an person to another just take a look on AMX Piss plugin and change from that yellow stream in a blood effects

But the problem is, piss goes to where the user aims at... but not to a player itself...

Code:
public sqrt(num) {     new div = num     new result = 1     while (div > result) {         div = (div + result) / 2         result = num / div     }     return div } public make_blood(ids[]) {     new id=ids[0]     new vec[3]     new aimvec[3]     new velocityvec[3]     new length     get_user_origin(id,vec)     get_user_origin(id,aimvec,3)     new distance = get_distance(vec,aimvec)     new speed = floatround(distance*1.9)         velocityvec[0]=aimvec[0]-vec[0]     velocityvec[1]=aimvec[1]-vec[1]     velocityvec[2]=aimvec[2]-vec[2]         length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2])         velocityvec[0]=velocityvec[0]*speed/length     velocityvec[1]=velocityvec[1]*speed/length     velocityvec[2]=velocityvec[2]*speed/length     message_begin(MSG_BROADCAST,SVC_TEMPENTITY)     write_byte(101)     write_coord(vec[0])     write_coord(vec[1])     write_coord(vec[2])     write_coord(velocityvec[0])     write_coord(velocityvec[1])     write_coord(velocityvec[2])     write_byte(225) // color     write_byte(160) // speed     message_end() }

this is from the piss code, but then I modded the color and the name XD, I took out the case stuff as well, seeing you don't need to set up the style...

So how do I edit that in there?


Cuz somtin tells me THIS doesn't work

Code:
public make_blood(ids[]) {     new id=vec1[3]     new target=vec2[3]     message_begin(MSG_BROADCAST,SVC_TEMPENTITY)     write_byte(101)     write_coord(vec1[0])     write_coord(vec1[1])     write_coord(vec1[2])     write_coord(vec2[0])     write_coord(vec2[1])     write_coord(vec2[2])     write_byte(225) // color     write_byte(160) // speed     message_end() }

XxAvalanchexX 02-20-2007 19:36

Re: Blood effect/beam ... [URGENT]
 
Try this out.

Code:
 new beamSpr;  public plugin_precache()  {     beamSpr = precache_model("sprites/lgtning.spr");  }  public make_blood_beam(from,to)  {     message_begin(MSG_ALL,SVC_TEMPENTITY);     write_byte(TE_BEAMENTS);     write_short(from); // start entity     write_short(to); // end entity     write_short(beamSpr); // sprite index     write_byte(0); // start frame     write_byte(30); // frame rate in 0.1's     write_byte(20); // life in 0.1's     write_byte(25); // line width in 0.1's     write_byte(50); // noise amplititude in 0.01's     write_byte(200); // red     write_byte(10); // green     write_byte(10); // blue     write_byte(100); // brightness     write_byte(50); // scroll speed in 0.1's     message_end();  }

Davidos 02-21-2007 05:28

Re: Blood effect/beam ... [URGENT]
 
Quote:

Originally Posted by XxAvalanchexX (Post 443084)
Try this out.

Code:
 new beamSpr;  public plugin_precache()  {     beamSpr = precache_model("sprites/lgtning.spr");  }  public make_blood_beam(from,to)  {     message_begin(MSG_ALL,SVC_TEMPENTITY);     write_byte(TE_BEAMENTS);     write_short(from); // start entity     write_short(to); // end entity     write_short(beamSpr); // sprite index     write_byte(0); // start frame     write_byte(30); // frame rate in 0.1's     write_byte(20); // life in 0.1's     write_byte(25); // line width in 0.1's     write_byte(50); // noise amplititude in 0.01's     write_byte(200); // red     write_byte(10); // green     write_byte(10); // blue     write_byte(100); // brightness     write_byte(50); // scroll speed in 0.1's     message_end();  }

Now it's asking what code beaments is -_-

I put it on 8... that's right, right?

Anyway now the lightning is shooting up XD`

Edit: I just addded 106 <Piss code>

Code:


No model 25610!
Host_Error: UserMsg: Not Present on Client 19

No go...



EDIT!

BOOYAH! I got it to go, only one problem... the beam starts at the... lower... parts...

And, there is really... no way to make this work with blood stream huh... <101>

Davidos 02-21-2007 11:57

Re: Blood effect/beam ... [URGENT]
 
Sorry for the mega double post but the guy hosting the serv says that I have just one more day before he cuts me off!

All that works but:

The beam comes from the crotch
I don't think he likes it when the beam flashes that fast <it looks like it sucks 31 gallons of blood O_o>

I would really appreciate it if this could be able in ent type 101 <blood stream>

[ --<-@ ] Black Rose 02-21-2007 13:20

Re: Blood effect/beam ... [URGENT]
 
TE_BEAMPOINTS with another sprite and get users origin and add some height.

Davidos 02-21-2007 17:11

Re: Blood effect/beam ... [URGENT]
 
Quote:

Originally Posted by [ --<-@ ] Black Rose (Post 443417)
TE_BEAMPOINTS with another sprite and get users origin and add some height.

... uh, how do you expect me to know how to do that... *sniff*

I don't have the slightest idea how to code, the only thing I'm good at coding is just learning from other scripts. So unless you have an example to back it up that's pretty much a useless post for me -_-;

Lemme try to explain.

Beampoints
Code:
/* Temp entity message types for message_begin() */ #define TE_BEAMPOINTS               0        // Beam effect between two points // write_byte(TE_BEAMPOINTS) // write_coord(startposition.x) // write_coord(startposition.y) // write_coord(startposition.z) // write_coord(endposition.x) // write_coord(endposition.y) // write_coord(endposition.z) // write_short(sprite index) // write_byte(starting frame) // write_byte(frame rate in 0.1's) // write_byte(life in 0.1's) // write_byte(line width in 0.1's) // write_byte(noise amplitude in 0.01's) // write_byte(red) // write_byte(green) // write_byte(blue) // write_byte(brightness) // write_byte(scroll speed in 0.1's)


Bloodstream 101
Code:
#define TE_BLOODSTREAM              101      // Particle spray // write_byte(TE_BLOODSTREAM) // write_coord(position.x) // write_coord(position.y) // write_coord(position.z) // write_coord(vector.x) // write_coord(vector.y) // write_coord(vector.z) // write_byte(color) // write_byte(speed)

HOW do I bind these to a player and it's target... <And I mean a diffrent player as in target...>

Because I have tried id[] and target[]
with id[3] and target[3] from id[0/2] and target[0/2] and that didn't do anything...

XxAvalanchexX 02-21-2007 23:41

Re: Blood effect/beam ... [URGENT]
 
For TE_BEAMPOINTS:

Code:
new from_origin[3], to_origin[3]; get_user_origin(from,from_origin); get_user_origin(to,to_origin); from_origin[2] += 16.0; // raised to_origin[2] += 16.0; // raised // ... write_coord(from_origin[0]); write_coord(from_origin[1]); write_coord(from_origin[2]); write_coord(to_origin[0]); write_coord(to_origin[1]); write_coord(to_origin[2]); // ...

If you want to change how it appears, I commented what each of the write_* things are for, so just change the values until you find what you (or your boss guy) likes.

TE_BLOODSTREAM is a little bit more complicated. Try this.

Code:
new iStart[3], Float:fStart[3], iEnd[3], Float:fEnd[3] Float:fVelocity[3]; get_user_origin(from,iStart); get_user_origin(to,iEnd); iStart[2] += 16.0; // raise iEnd[2] += 16.0; // raise IVecFVec(iStart,fStart); IVecFVec(iEnd,fEnd); get_speed_vector(fStart,fEnd,512.0,fVelocity); // 512.0 is the speed // ... write_coord(iStart[0]); write_coord(iStart[1]); write_coord(iStart[2]); write_coord(floatround(fVelocity[0])); write_coord(floatround(fVelocity[1])); write_coord(floatround(fVelocity[2])); // ...

Note that get_speed_vector is a function from GHW_Chronic's CHR Engine.

Davidos 02-22-2007 04:58

Re: Blood effect/beam ... [URGENT]
 
Code:


L 02/22/2007 - 14:52:47: [ENGINE] Invalid player 0 (not in-game)
L 02/22/2007 - 14:52:47: [AMXX] Displaying debug trace (plugin "GHW_feedmod3.amxx")
L 02/22/2007 - 14:52:47: [AMXX] Run time error 10: native error (native "entity_range")
L 02/22/2007 - 14:52:47: [AMXX]    [0] engine_stocks.inc::get_entity_distance (line 65)
L 02/22/2007 - 14:52:47: [AMXX]    [1] feedmod3.sma::feed (line 82)

wtf?


Well I fixed that up there, sorry for the flame. Anyway, now the beams are flying up <And the blood stream thing wont work...

Code:
/* AMXMOD X script. * * Scripted by GHW.Chronic, edited by Davidos * *   v0.6 - Late Alpha Release * */ #include <amxmodx> #include <amxmisc> #include <fakemeta> #include <engine> #include <vault> #include <fun> #include <tsx> #include <messages> #include <chr_engine> new bool:afeed[33] new target, body new beamSpr public plugin_init() {     register_plugin("FeedMOD","0.6","GHW & Dave")     register_clcmd("say_team /feed","feed")     register_clcmd("say_team /stop","stop")     set_task(150.0,"advertise",0,"",0,"b")     return PLUGIN_HANDLED } public plugin_precache() {     precache_sound("feeding.wav")     precache_sound("ah.wav")     beamSpr = precache_model("sprites/lgtning.spr") } public client_connect(id) {     afeed[id]=false } public client_disconnect(id) {     afeed[id]=false } public stop(id) {     new args[128]     read_args(args, 127)     remove_quotes(args)     if(!afeed[id])     {         client_print(id,print_chat,"You Aren't Feeding")         return PLUGIN_HANDLED     }     else     {         afeed[id]=false         set_task(1.0,"fadeout",id)     }     return PLUGIN_HANDLED } public feed(id) {     if(afeed[id])     {         client_print(id,print_chat,"You Are Already Feeding")         return PLUGIN_HANDLED     }     else     {         if(!is_user_alive(id))         {             client_print(id,print_chat,"You Cannot Feed While Dead / In Spec ")             return PLUGIN_HANDLED         }         get_user_aiming(id, target, body)         if(get_entity_distance(id, target) > 320)         {             client_print(id,print_chat,"You aren't close enough to a player!")             return PLUGIN_HANDLED         }         else         {             afeed[id]=true             set_task(0.1, "fadeout", id)             set_task(0.2,"make_blood_info",id,"",0,"b")             client_print(id,print_center," * You Begin the feeding process * ^n")             client_print(id,print_chat,"Type /stop to stop feeding.")             emit_sound(id, CHAN_VOICE, "feeding.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)             return PLUGIN_HANDLED         }     }     return PLUGIN_HANDLED } public fadeout(id) {     if(!afeed[id])     {         set_user_rendering(id,kRenderFxNone,0,0,0,kRenderNormal,0)         set_user_maxspeed(id, 320.0)         set_user_maxspeed(target,320.0)         emit_sound(id, CHAN_VOICE, "ah.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         client_print(id,print_center,"Time To Stop")         message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},id);         write_short(~0);         write_short(~0);         write_short(1<<12);         write_byte(0);         write_byte(0);         write_byte(0);         write_byte(0);         message_end();         message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},target);         write_short(~0);         write_short(~0);         write_short(1<<12);         write_byte(0);         write_byte(0);         write_byte(0);         write_byte(0);         message_end();         return PLUGIN_HANDLED     }     if(!is_user_alive(id))     {         afeed[id]=false         set_task(1.0,"fadeout",id)         return PLUGIN_HANDLED     }     if(!is_user_alive(target))     {         afeed[id]=false         set_task(1.0,"fadeout",id)         return PLUGIN_HANDLED     }     new health = get_user_health(id)     if(health>=300)     {         afeed[id]=false         set_task(1.0,"fadeout",id)         return PLUGIN_HANDLED     }     new healtht = get_user_health(target)     if(healtht<=10)     {         afeed[id]=false         set_task(1.0,"fadeout",id)         return PLUGIN_HANDLED     }     set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderTransAlpha,100)     set_user_rendering(target,kRenderFxGlowShell,255,0,0,kRenderTransAlpha,50)     message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},id);     write_short(~0);     write_short(~0);     write_short(1<<12);     write_byte(200);     write_byte(0);     write_byte(0);     write_byte(30);     message_end();     message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},target);     write_short(~0);     write_short(~0);     write_short(1<<12);     write_byte(200);     write_byte(0);     write_byte(0);     write_byte(30);     message_end();     set_user_maxspeed(id, 1.0)     set_user_maxspeed(target,1.0)     set_task(0.5,"heal",id)     return PLUGIN_HANDLED } public heal(id) {     new armor = get_user_armor(id)     new health = get_user_health(id)     new health2 = get_user_health(target)     new newarmor = armor + 10     new newhealth = health + 5     new newhealthz = health2 - 2     set_user_armor(id,newarmor)     set_user_health(id,newhealth)     set_user_health(target,newhealthz)     set_task(1.0,"fadeout",id)     return PLUGIN_HANDLED } public make_blood_info(id) {     if(!afeed[id])     {         return PLUGIN_HANDLED     }     else     {               new from_origin[3], to_origin[3];         get_user_origin(id,from_origin);         get_user_origin(target,to_origin);                 from_origin[2] += 0.0; // raised         to_origin[2] += 0.0; // raised                 // ...         message_begin(MSG_BROADCAST,SVC_TEMPENTITY)         write_byte(0)         write_coord(from_origin[0]);         write_coord(from_origin[1]);         write_coord(from_origin[2]);         write_coord(to_origin[0]);         write_coord(to_origin[1]);         write_coord(to_origin[2]);         write_short(beamSpr); // sprite index         write_byte(0); // start frame         write_byte(30); // frame rate in 0.1's         write_byte(20); // life in 0.1's         write_byte(25); // line width in 0.1's         write_byte(50); // noise amplititude in 0.01's         write_byte(200); // red         write_byte(10); // green         write_byte(10); // blue         write_byte(100); // brightness         write_byte(50); // scroll speed in 0.1's         message_end();     }     return PLUGIN_HANDLED


All times are GMT -4. The time now is 00:44.

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