Raised This Month: $ Target: $400
 0% 

player looking @ eachother


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 09-11-2005 , 04:58   player looking @ eachother
Reply With Quote #1

Can't get this to work..
Code:
#include <amxmodx> #include <amxmisc> #include <engine> public client_PreThink(id) {     new player,player2,body,body2,authid[33],authid2[33]     get_user_authid(id,authid,32)     get_user_aiming(id,player,body)     if(player) {         get_user_aiming(player,player2,body2)         get_user_authid(player2,authid2,32)         if(equali(authid,authid2)) {             check_function()         }     }     return PLUGIN_CONTINUE } public check_function() {     client_print(0,print_center,"ZOMG WORKZ!") }
pdoubleopdawg is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 09-11-2005 , 09:34  
Reply With Quote #2

okay, this is working:

Code:
public client_PreThink(id){     if(is_user_connected(id) == 0 || is_user_alive(id) == 0){         return PLUGIN_CONTINUE     }     new target, aim     get_user_aiming(id,target,aim)     if(is_user_connected(target) == 0 || is_user_alive(target) == 0){         return PLUGIN_CONTINUE     }     new newtarget     get_user_aiming(target,newtarget,aim)     if(id == newtarget){         // Players are aiming at each other, do stuff here!     }     return PLUGIN_CONTINUE }

you have to check if it's a valid target at what the player is aiming,
otherwise the server will crash pretty soon
FeuerSturm is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 09-11-2005 , 14:49  
Reply With Quote #3

There are new natives as of 1.5x
http://amxmodx.org/funcwiki.php?go=func&id=795
http://amxmodx.org/funcwiki.php?go=func&id=796
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 09-11-2005 , 15:08  
Reply With Quote #4

what is viewcone?
__________________
- Bye bye!
nightscreem is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 09-12-2005 , 00:00  
Reply With Quote #5

They do the same thing essentially but one is for a vector and one is for an entity.
But the Viewcone is everything you can see at that time.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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 14:34.


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