PDA

View Full Version : amx_all


PyRo
05-10-2005, 18:58
As far as I know this plugin is the only of its type, I had a look for a plugin that would function the same as this one, but I didn't come across one so I created this one :)

amx_all is a basic plugin that allows you to use everybody on the server as a target for a command even when the command has no @ALL paramater providing you have the correct level to access the command in the first place.

Usage (requires ADMIN_SLAY):amx_all [<command> $name <params>]

Examples:amx_all amx_kick - Would kick everybody on the server (except those with immunity)
amx_all amx_kick $name Server shutting down - Would kick everybody on the server with the message "Server shutting down" (except those with immunity)
amx_all amx_slap $name 10 - Would slap everybody on the server with 10 damage (except those with immunity)
amx_all say "Moo @ $name" - Would spam the server with "Moo @ "<Player>""
amx_all amx_psay $name This is spam - Would psay everybody on the server with "This is spam"

I hope this plugin is of use to somebody, let me know if you find any bugs and any comments, questions and suggestions are welcome :)

Pyro

nightscreem
05-10-2005, 19:13
why should we do all kick

PyRo
05-10-2005, 19:20
why should we do all kickI doubt you would, it was just an example, I was trying to keep the examples as general as possible. There are plenty of plugins on here without an @ALL paramater or similar so I thought some people might find this useful.
This should work on any command that accepts a players name as a parameter (it adds quotes around the name so spaces aren't a problem) and it will work with some others that don't (such as say).

-}NK{-Oj@eKiLLzZz
05-10-2005, 19:41
kool man sounds very helpful ima try it out

thanks!

f1del1ty.oXi
05-10-2005, 21:45
So...why do you need the $name part? Just delete it so it becomes amx_all amx_tsay "blehblehbleh", instead of making you type the name part as well.

kid741010
05-10-2005, 22:10
yeah :roll:
why should we do all kick

GHW_Chronic
05-11-2005, 00:52
So...why do you need the $name part? Just delete it so it becomes amx_all amx_tsay "blehblehbleh", instead of making you type the name part as well.

if you had "amx_heal NAME 100" and you had taken out the name part, it would do "amx_heal 10 NAME" and the function won't work. So this needs to be on there for stuff like that.

f1del1ty.oXi
05-11-2005, 01:11
Hmm...

But still, why does amx_all amx_kick work, when amx_kick needs a target as well? I understand with your example, but I still wonder if it's possible. :\

GHW_Chronic
05-11-2005, 01:21
i believe how it works is it gets the name of index 1 and puts his name in place of $name and then gets the name of index2 and puts his name in place of $name untill it gets to 32 then it stops. I haven't cherck the code, that's just how I would suspect its being done

GHW_Chronic
05-11-2005, 01:25
for (new i = 0;i<=32;i++) {
if (is_user_connected(i)) {
ok, that is the coding, as I thought, it does get every index from 0 to 32 and checks if they are conencted then runs the command on them.

Proach
05-11-2005, 03:28
w00t
ty ! helpfull ;)

PyRo
05-11-2005, 13:48
Hmm...

But still, why does amx_all amx_kick work, when amx_kick needs a target as well? I understand with your example, but I still wonder if it's possible. :\When I take the command arguments I check if they contain "$name" and if they don't I add "$name" after the command so "amx_kick" becomes "amx_kick $name" and then the plugin goes on to do "amx_kick Player1", "amx_kick Player2" all the way up to "amx_kick Player32" (providing there's 32 players on the server). I hope this makes some sense.

f1del1ty.oXi
05-11-2005, 16:37
It did when Cronic told me. I don't know what your reply was for..:x

PyRo
05-12-2005, 03:28
It did when Cronic told me. I don't know what your reply was for..:xFun and a way to pass 30 seconds of boredom :p

10can
05-21-2005, 14:21
Is there a way to just execute a command for one side like axis or allies in DoD?

For example, the axis team is spawn camping and they will not stop, so I want to type in a single command that would slay all the axis players not all the players on the server.

Thanks

PyRo
05-21-2005, 14:37
Is there a way to just execute a command for one side like axis or allies in DoD?

For example, the axis team is spawn camping and they will not stop, so I want to type in a single command that would slay all the axis players not all the players on the server.

ThanksNot at the moment, but I'll make a DoD specific version that allows you to do that that :)

SubStream
08-25-2005, 20:48
Edited: Works flawlessly

Tupla
08-25-2005, 23:56
I installed this on my server and it works great. I love using this amx_all amx_exec $name "bind F4 +revive" to bind +revive to the F4 keys of all players. +revive is the command used to revive people using the ReviversKit plugin which I use on my server as well. This allows me to bind keys for players who otherwise would never figure it out. Lots of newbs on my server so its awesome to bind keys for them all at once... Also use it to bind getclothes for the covertops plugin which allows u to steal a dead opponents clothing. Makes people happy when they don't have to learn how to bind a key themselves. EXCELLENT idea.

But you dont need this plugin.. just use this:

amx_exec @all "bind <key> +revive"

Whatever, i love this plugin ! example amx_all amx_fire $name :lol:

SubStream
08-26-2005, 10:54
--Edited--

Tupla
08-26-2005, 11:28
yah for some reason the @all commands don't seem to work for me... maybe im retarded.. i dunno

Yep :)

twistedeuphoria
12-14-2005, 14:02
Redundant. Old. Moved to Unapproved/Old Plugins forum.