AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   player looking @ eachother (https://forums.alliedmods.net/showthread.php?t=17890)

pdoubleopdawg 09-11-2005 04:58

player looking @ eachother
 
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!") }

FeuerSturm 09-11-2005 09:34

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 :wink:

Xanimos 09-11-2005 14:49

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

nightscreem 09-11-2005 15:08

what is viewcone?

Xanimos 09-12-2005 00:00

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.


All times are GMT -4. The time now is 14:34.

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