ETMods.net

N!tmod, a Wolfenstein: Enemy Territory Modification!

You are not logged in.

Announcement

You can donate to help us keeping services online.

#1 05-Apr-13 17:42:45

flipside1993
Member
Registered: 05-Apr-13
Posts: 10

Nicknames in Custom Commands

Hi there,


After long research I have found out that the only way to get players other than yourself involved in custom command is to use the [1] flag.

What's annoying about that is that it copies exactly what the executor of the command wrote. For example if my name is flipside on the server and someone will use a command on me typing !owned flip, the text will look like this:

I owned you, flip!

Is it somehow possible to get the server into seeing what player is meant and copying his name in the exact same fashion it actually is? So that my example would look like this: !owned flip would print 'I owned you, flipside!'


Also I've been wondering for a while how you would create a command that would make the server send a message to ONLY the player I want it to see. For example, !invite flip would send a message to me saying something: Congratulations, you have been invited to join our clan! But only I could see it.


If anyone can help me out on this I'd appreciate it big time.

Offline

#2 05-Apr-13 18:51:10

Dragonji
Member
From: Poland
Registered: 19-Aug-10
Posts: 88
Website

Re: Nicknames in Custom Commands

flipside1993 wrote:

After long research I have found out that the only way to get players other than yourself involved in custom command is to use the [1] flag.

What's annoying about that is that it copies exactly what the executor of the command wrote. For example if my name is flipside on the server and someone will use a command on me typing !owned flip, the text will look like this:

I owned you, flip!

Is it somehow possible to get the server into seeing what player is meant and copying his name in the exact same fashion it actually is? So that my example would look like this: !owned flip would print 'I owned you, flipside!'

There's a great thread on mygamingtalk.com, nicely supported by silEnT mod devs: http://mygamingtalk.com/forums/topic/23 … -questions

Why do I post this? Lua is something you should start working with.

flipside1993 wrote:

Also I've been wondering for a while how you would create a command that would make the server send a message to ONLY the player I want it to see. For example, !invite flip would send a message to me saying something: Congratulations, you have been invited to join our clan! But only I could see it.


If anyone can help me out on this I'd appreciate it big time.

et.trap_SendConsoleCommand(et.EXEC_APPEND, string.format("m %s ^8Congratulations, you've been invited to join our clan!\n", userslot)) //sending private msg from the console

Last edited by Dragonji (05-Apr-13 18:51:42)

Offline

#3 05-Apr-13 20:07:19

flipside1993
Member
Registered: 05-Apr-13
Posts: 10

Re: Nicknames in Custom Commands

Well, I don't fancy learning a whole new type of language just for adding a handful of commands. I don't have the time to anyway. Could you please create a sample file of what I could use for my said issues and how I could combine it with custom shrubbot commands? I remember our server running a few scripts that worked with simple / commands so /rules would give you a list of rules etc. But this should be clearly defined for admins and not for everyone.

Last edited by flipside1993 (05-Apr-13 20:10:10)

Offline

#4 06-Apr-13 11:11:38

Dragonji
Member
From: Poland
Registered: 19-Aug-10
Posts: 88
Website

Re: Nicknames in Custom Commands

At first I would like someone to confirm one thing as I'm not sure if it is available in N!tmod too.

In silEnT, if we've got a custom command defined like this:

[command]
command = sayname
exec = sayname [1] [i]
desc = Say a player's name
levels = 2 4 5

et.trap_Argc() equals 3
et.trap_Argv(0) = sayname
et.trap_Argv(1) = [1] which is a string entered by user
et.trap_Argv(2) = [i] which is a slot number of the player who called the command

If this is all available in N!tmod, I may write something useful for ya.

Offline

#5 07-Apr-13 21:59:18

flipside1993
Member
Registered: 05-Apr-13
Posts: 10

Re: Nicknames in Custom Commands

No one?

Offline

#6 07-Apr-13 22:21:06

Micha
Member
From: Germany
Registered: 11-Feb-13
Posts: 38
Website

Re: Nicknames in Custom Commands

Should be possible with lua

Offline

#7 07-Apr-13 23:17:19

flipside1993
Member
Registered: 05-Apr-13
Posts: 10

Re: Nicknames in Custom Commands

I figured that by reading Dragonji's post ...

Offline

#8 24-Apr-13 18:48:06

Dragonji
Member
From: Poland
Registered: 19-Aug-10
Posts: 88
Website

Re: Nicknames in Custom Commands

ROFL, ppl are really helpful providing so much info these days.

Offline

#9 02-May-13 13:00:09

N!trox*
Administrator
Registered: 30-Mar-10
Posts: 1,098

Re: Nicknames in Custom Commands

Dragonji wrote:

At first I would like someone to confirm one thing as I'm not sure if it is available in N!tmod too.

In silEnT, if we've got a custom command defined like this:

[command]
command = sayname
exec = sayname [1] [i]
desc = Say a player's name
levels = 2 4 5

et.trap_Argc() equals 3
et.trap_Argv(0) = sayname
et.trap_Argv(1) = [1] which is a string entered by user
et.trap_Argv(2) = [i] which is a slot number of the player who called the command

If this is all available in N!tmod, I may write something useful for ya.

Sorry for the (really) late reply...

It's working as you described, except for one thing:
In the current version [i] has no effect, but in the next build it will be replaced by the slot number of the player who used the command.


iluvnitmod.png

Offline

#10 03-May-13 14:14:47

Dragonji
Member
From: Poland
Registered: 19-Aug-10
Posts: 88
Website

Re: Nicknames in Custom Commands

TY for info Nitrox.

Offline

#11 03-May-13 19:08:16

flipside1993
Member
Registered: 05-Apr-13
Posts: 10

Re: Nicknames in Custom Commands

Better late than never. I'm glad you're going to add this feature in the next build.

Offline

Board footer

Powered by FluxBB