AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Kill-Look (https://forums.alliedmods.net/showthread.php?t=20649)

BetaX 11-12-2005 23:38

Kill-Look
 
OK, first plugin here...

Right now, the plugin can be used by everyone (not restricted from people with no-admin) and it runs only once, meaning you have to type it in while looking at someone to kill them.

This is not practical.

I want it to allow the person to run around and be able to kill people.

Here's the Source.

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Look-Kill" #define VERSION "1.2" #define AUTHOR "BetaX" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("amx_killlook","handle_look",ADMIN_KICK,"Kills anyone you look at. :O") } public handle_look(id) {     new entid, entbody;     get_user_aiming (id,entid,entbody,99999);     user_kill (entid,0);     return PLUGIN_HANDLED; }

XxAvalanchexX 11-12-2005 23:48

Re: Kill-Look
 
Quote:

Originally Posted by BetaX
Right now, the plugin can be used by everyone

Right now it appears that the command requires ADMIN_KICK to use.

Quote:

Originally Posted by BetaX
I want it to allow the person to run around and be able to kill people.

Simply bind a key to amx_killlook.

v3x 11-12-2005 23:49

Code:
public handle_look(id,level,cid) {     // check the player's access     if(!cmd_access(id,level,cid,0))         return PLUGIN_HANDLED;     new entid, entbody;     get_user_aiming (id,entid,entbody,99999);     // make sure the player is alive and is on the opposite team of the person using the command     if(is_user_alive(entid) && (get_user_team(id) != get_user_team(entid))         user_kill(entid,0);     return PLUGIN_HANDLED; }

XxAvalanchexX 11-12-2005 23:49

Was editing my post about cmd_access when v3x posted, nevermind.

v3x 11-12-2005 23:52

I didn't see your post at the time ;]

BetaX 11-12-2005 23:52

Thanks guys, but this still doesn't fix the fact that it doesn't kill more than once and only if you enter it when looking at them.

Binding it seems like the easy way out. :)

I tried making a while loop... but that doesn't work.

XxAvalanchexX 11-13-2005 01:05

You want to make it kill whoever you look at no matter what?

Code:
#include <fakemeta>  public plugin_init() {     register_forward(FM_TraceLine,"fw_traceline");  }  public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id) {     if(is_user_alive(id)) {        new hit = get_tr(TR_pHit);        if(is_user_alive(hit)) user_kill(hit,0);     }  }


All times are GMT -4. The time now is 23:54.

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