Raised This Month: $51 Target: $400
 12% 

Look at this code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 07-28-2011 , 17:33   Look at this code
Reply With Quote #1

When i shoot laser the sprite doesnt show but the player loses hp. But when i miss a player the sprite shows

This is my code
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_Beam

public plugin_precache()
{
    
g_Beam precache_model("sprites/laserbeam.spr")
}
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("lasershoot""GetEnemyOrg")
}



public 
GetEnemyOrg(id)
{
    new 
originEnd[3]
    new 
origin[3]
    
get_user_origin(id,origin,0)
    
    new 
originE[3]
    
get_user_origin(id,originE,3)
    new 
EntIdBodypartdist
    get_user_aiming
(id,EntId,Bodypart)
    
    if(!
is_user_connected(EntId))
    {
    
originEnd[0] = originE[0]
    
originEnd[1] = originE[1]
    
originEnd[2] = originE[2]
    }
    else
    {
    new 
VictimOrigin[3]
    
get_user_origin(id,VictimOrigin,0)
    
originEnd[0] = VictimOrigin[0]    
    
originEnd[1] = VictimOrigin[1]
    
originEnd[2] = VictimOrigin[2]
    
set_user_health(EntId,get_user_health(EntId)-10)
    }
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(TE_BEAMPOINTS)
    
// this is where the beginning of the beam is
    
write_coord(origin[0]) // x
    
write_coord(origin[1]) // y
    
write_coord(origin[2]) // z
    // this is where the end of the beam is
    
write_coord(originEnd[0]) // x
    
write_coord(originEnd[1]) // y
    
write_coord(originEnd[2]) // z
    // this is the sprite index, as we got in plugin_precache)
    
write_short(g_Beam)
    
// this is the starting frame, it's generally best to leave this at 1
    
write_byte(1)
    
// frame rate in 0.1s
    
write_byte(10)
    
// how long it lasts in 0.1 seconds (10 for 1 second)
    
write_byte(30)
    
// line width in 0.1s
    
write_byte(10)
    
// amplitude (how much it goes off the line)
    
write_byte(0)
    
// r, g, b
    
write_byte(0)
    
write_byte(255)
    
write_byte(0)
    
// brightness
    
write_byte(255)
    
// scroll speed
    
write_byte(100)
    
message_end()


Last edited by usaexelent; 07-28-2011 at 18:43.
usaexelent is offline
Send a message via Skype™ to usaexelent
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-28-2011 , 17:40   Re: Geting aiming origin
Reply With Quote #2

Code:
get_user_origin( , , 3 )

http://www.amxmodx.org/funcwiki.php?go=func&id=162
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 07-28-2011 , 17:40   Re: Geting aiming origin
Reply With Quote #3

I googled it before you can post reply
usaexelent is offline
Send a message via Skype™ to usaexelent
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 07-28-2011 , 17:42   Re: Geting aiming origin
Reply With Quote #4

And how to make that if some one touches the laser get damage
This is my code
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_Beam

public plugin_precache()
{
    
g_Beam precache_model("sprites/zerogxplode.spr")
}
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("laser""GetEnemyOrg")
}



public 
GetEnemyOrg(id)
{
    
    new 
origin[3]
    
get_user_origin(id,origin,0)
    
    new 
originEnd[3]
    
get_user_origin(id,originEnd,3)
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(TE_BEAMPOINTS)
    
// this is where the beginning of the beam is
    
write_coord(origin[0]) // x
    
write_coord(origin[1]) // y
    
write_coord(origin[2]) // z
    // this is where the end of the beam is
    
write_coord(originEnd[0]) // x
    
write_coord(originEnd[1]) // y
    
write_coord(originEnd[2]) // z
    // this is the sprite index, as we got in plugin_precache)
    
write_short(g_Beam)
    
// this is the starting frame, it's generally best to leave this at 1
    
write_byte(1)
    
// frame rate in 0.1s
    
write_byte(10)
    
// how long it lasts in 0.1 seconds (10 for 1 second)
    
write_byte(100)
    
// line width in 0.1s
    
write_byte(10)
    
// amplitude (how much it goes off the line)
    
write_byte(10)
    
// r, g, b
    
write_byte(0)
    
write_byte(0)
    
write_byte(255)
    
// brightness
    
write_byte(255)
    
// scroll speed
    
write_byte(100)
    
message_end()

usaexelent is offline
Send a message via Skype™ to usaexelent
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 07:58.


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