Raised This Month: $ Target: $400
 0% 

Person who is nearest to you...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 11-01-2006 , 11:04   Person who is nearest to you...
Reply With Quote #1

Code:
#include <amxmodx> #include <engine> new beam public plugin_init() {     register_plugin("Nothing","0.1","idkfa") } public plugin_precache() {     beam = precache_model("sprites/laserbeam.spr") } public client_PreThink(id) {         new aimID     new aimBody     get_user_aiming(id,aimID,aimBody)         if (aimID && get_user_team(aimID) != get_user_team(id)) {         hook_beam(id,aimID)     }     }     public hook_beam(id, aimID) {     message_begin(MSG_BROADCAST,SVC_TEMPENTITY)     write_byte(8) //TE_BEAMENTS     write_short(id)     write_short(aimID)     write_short(beam)     write_byte(0)     write_byte(1)     write_byte(0)     write_byte(25)     write_byte(10)     write_byte(100)     write_byte(100)     write_byte(255)     write_byte(127)     write_byte(0)     message_end() }

How come that it makes a laserbeam just as i spawn, and the beam isent "attached" to a player.. I just attached to the air..

See the attached pic..
Attached Thumbnails
Click image for larger version

Name:	de_dust20001.JPG
Views:	206
Size:	43.3 KB
ID:	11679  
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-01-2006 , 13:47   Re: Person who is nearest to you...
Reply With Quote #2

this is a very bad way of doing this. but you should also check if is_user_alive(aimID)

*note that this won't get the nearest person to you.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 11-01-2006 , 14:18   Re: Person who is nearest to you...
Reply With Quote #3

get_user_aiming ( index, &id, &body, [ distance ] )

must set distance to work like 9999
when i use amxx1.71.
__________________
QQ31537639
jopmako is offline
Send a message via MSN to jopmako
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 11-01-2006 , 14:25   Re: Person who is nearest to you...
Reply With Quote #4

Code:
native Float:get_user_aiming(index,&id,&body,dist=9999);

The amxmodx.inc supply a default value of 9999 if you don't insert the distance parameter otherwise you can set your own if want.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
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 04:50.


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