Raised This Month: $ Target: $400
 0% 

[solved]Lightning (target problem) , ScreenShake


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 08-26-2008 , 11:12   [solved]Lightning (target problem) , ScreenShake
Reply With Quote #1

I need some help with my lightning code

PHP Code:
public castlight(id)
{
    new 
Float:fOrigin[3], Float:fVelocity[3]
    
entity_get_vector(id,EV_VEC_originfOrigin)
    
VelocityByAim(id35fVelocity)
    
    new 
iOrigin[3]
    
FVecIVec(fOriginiOrigin)
    
    
lightning(iOriginiTargetOrigin)
}

lightning(vec1[3], vec2[3]) 

   
//Lightning 
   
message_beginMSG_BROADCAST,SVC_TEMPENTITY
   
write_byte(0
   
write_coord(vec1[0]) 
   
write_coord(vec1[1]) 
   
write_coord(vec1[2]) 
   
// Here is the Problem
   
write_coord(vec2[0])
   
write_coord(vec2[1])
   
write_coord(vec2[2])
   
// Here is the Problem
   
write_shortlight 
   
write_byte// framestart 
   
write_byte// framerate 
   
write_byte// life 
   
write_byte20 // width 
   
write_byte30 // noise 
   
write_byte255 // r, g, b 
   
write_byte255 // r, g, b 
   
write_byte255 // r, g, b 
   
write_byte200 // brightness 
   
write_byte200 // speed 
   
message_end() 

The problem is I cant figure out how to make the lightning go to the spot where you are aiming at . ( So this also needs to work if I aint aim at a person )

My next problem :

I need to shake somebodys screen when he/she gets hit but I cant get this right :

PHP Code:
/* plugin init */
ScreenShake get_user_msgid("ScreenShake")
/**********/

/* Calling like this */

screen_shake(victim)

/**************/

public screen_shake(id)
{
    
message_begin(MSG_BROADCASTScreenShake, { 505050 }, id);
    
write_short(8<<12);
    
write_short(5<<12);
    
write_short(4<<12);
    
write_byte(100);
    
write_byte(100);
    
write_byte(100);
    
write_byte(100);
    
message_end();

It doesnt crash me ore the server its just doing nothing .

Can sombody help me with this .
Thanks already cause I know you guys can (;
__________________
I am out of order!

Last edited by grimvh2; 08-26-2008 at 11:54.
grimvh2 is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-26-2008 , 11:27   Re: Lightning (target problem) , ScreenShake
Reply With Quote #2

For problem 2 - ScreenShake: try this:
PHP Code:
new ScreenShake
public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("Damage""evn_damage""b""2!0""3=0""4!0");
    
ScreenShake get_user_msgid("ScreenShake")
}
public 
evn_damage(victim)
{
    new 
attacker get_user_attacker(victim);
    if(
get_user_team(victim) != get_user_team(attacker))
        
screen_shake(victim);
}
public 
screen_shake(index)
{
    if(
is_user_connected(index))
    {
        
message_begin(MSG_ONE,ScreenShake,{0,0,0},index);
        
write_short(1<<13);
        
write_short(1<<13);
        
write_short(1<<13);
        
message_end();
    }

__________________

anakin_cstrike is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-26-2008 , 11:28   Re: Lightning (target problem) , ScreenShake
Reply With Quote #3

Use mode 3 of get_user_origin

http://www.amxmodx.org/funcwiki.php?...igin&go=search
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 08-26-2008 , 11:47   Re: Lightning (target problem) , ScreenShake
Reply With Quote #4

Thx connor , that should normmaly work ( I hope )

,

for the screenshake : you dind had to give me the event and all , but thanks

also I just found a plugin that does same effect .

edit : thx connor , tested and working
edit2: Screenshake also working .

Thanks guys , that was really fast .
__________________
I am out of order!

Last edited by grimvh2; 08-26-2008 at 11:54.
grimvh2 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 03:14.


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