Raised This Month: $ Target: $400
 0% 

[solved]Lightning (target problem) , ScreenShake


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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