Difference between revisions of "SendServerCommand"

From WolfWiki
Jump to: navigation, search
m (fixes)
m
 
(18 intermediate revisions by 8 users not shown)
Line 1: Line 1:
et.trap_SendServerCommand() has the following commands:
+
__NOEDITSECTION__
 +
et.trap_SendServerCommand() is used to send a command from the server to one or more clients. The first argument is the slot number of the client the command will be sent to. If it's equal to -1, the command will be broadcast to all clients.
  
==Prining==
+
The following commands can be issued with this function:
 +
 
 +
==Printing==
 
===Print===
 
===Print===
:"'''print''' \"''Message''\n\""
+
* "'''print''' \"''Message''\n\""
:'''print''' will print the ''Message'' in the clients console.
+
:'''print''' prints ''Message'' to the client's console.
  
 
===Center Print MoO===  
 
===Center Print MoO===  
:"'''cpm''' \"''Message''\n\""<br>
+
* "'''cpm''' \"''Message''\n\""<br>
:'''cpm''' will print the ''Message'' in the clients anoucement area and console
+
:'''cpm''' prints ''Message'' to the client's annoucement area and console.
  
 
===Center Print===
 
===Center Print===
:"'''cp''' \"''Message''\n\""<br>
+
* "'''cp''' \"''Message''\n\""<br>
:'''cp''' will print the ''Message'' in the center of the clients screen.
+
:'''cp''' prints ''Message'' to the center of the client's screen.
 +
 
 +
===Banner Print===
 +
* "'''b''' ''locations'' \"''Message''\n\""<br>
 +
:'''b''' prints ''Message'' to the client's banner ''locations''<br>
 +
:the ''locations'' can be a number from 0 to 248
 +
:For compatibility, the old-style locations (from 0-4) are also supported.<br>
 +
:8 - player chat area<br>               
 +
:16 - left popup area (not recommended)<br>
 +
:32 - centered above the chat area<br>
 +
:64 - console only<br>
 +
:128 - banner area (recommended)(top of screen)
  
 
===Scores Print===
 
===Scores Print===
:"'''sc''' \"''Message''\n\""<br>
+
* "'''sc''' \"''Message''\n\""<br>
:'''sc''' will print the ''Message'' in the clients console and write to the statsdump file.
+
:'''sc''' prints ''Message'' to the client's console and writes it to the statsdump file.
  
 
==Chatting==
 
==Chatting==
 
===Chat===
 
===Chat===
:"'''c''' ''ClienNum'' \"''Message''\""<br>
+
* "'''c''' ''ClientNum'' \"''Message''\""<br>
:'''c''' will print a global chat message ''Message'' on behalf of client ''ClienNum''.
+
:'''c''' prints ''Message'' as a global chat message on behalf of the client specified by ''ClientNum''.
 +
 
  
 
===Team Chat===
 
===Team Chat===
:"'''tc''' ''ClienNum'' \"''Message''\" ''X-Location'' ''Y-Location'' ''Z-Location''"<br>
+
* "'''tc''' ''ClientNum'' \"''Message''\" ''X-Location'' ''Y-Location'' ''Z-Location''"<br>
:'''tc''' will print a team chat message ''Message'' on behalf of client ''ClienNum'',<br>
+
:'''tc''' prints ''Message'' as a team chat message on behalf of the client specified by ''ClientNum'',<br>
:the ''X,Y,Z-Location's'' are optional parematers the represent the clients location,<br>
+
:the ''X,Y,Z-Location's'' are optional parematers that represent the client's location,<br>
:if the ''X,Y,Z-Location's'' are left out then the message will be printed whitout an location.
+
:if the ''X,Y,Z-Location's'' are left out then the message will be printed without a location.
  
 
===Fireteam Chat===
 
===Fireteam Chat===
:"'''bc''' ''ClienNum'' \"''Message''\" ''X-Location'' ''Y-Location'' ''Z-Location''".<br>
+
* "'''bc''' ''ClientNum'' \"''Message''\" ''X-Location'' ''Y-Location'' ''Z-Location''".<br>
:'''bc''' will print a fireteam chat message ''Message'' on behalf of client ''ClienNum'',<br>
+
:'''bc''' prints ''Message'' as a fireteam chat message on behalf of the client specified by ''ClientNum'',<br>
:the ''X,Y,Z-Location's'' parematers the represent the clients location.
+
:the ''X,Y,Z-Location's'' are parematers that represent the client's location.
 +
 
 +
===Global Message===
 +
* "'''chat''' \"''Message''\""<br>
 +
:'''chat''' prints ''Message'' like global message via rcon (''qsay'' command).
  
 
==Voice Chat==
 
==Voice Chat==
 
===Global Voice Chat===
 
===Global Voice Chat===
:"'''vchat''' 0 ''ClientNum'' 50 ''Vsay-String'' ''Vsay-Number'' \"''Custom-Message''\"".<br>
+
* "'''vchat''' ''VoiceOnly'' ''ClientNum'' 50 ''Vsay-String'' ''Vsay-Number'' \"''Custom-Message''\"".<br>
:'''vchat''' will global voice chat ''Vsay-String'' on behalf of client ''ClienNum''.<br>
+
:'''vchat''' sends a global voice chat ''Vsay-String'' on behalf of the client specified by ''ClientNum''.<br>
:''Vsay-Number'' is normaly random but i can be stable using /vsay <''Vsay-Number''> <''Vsay-String''>,<br> ''Vsay-Number'' represend the vsay nummer of Vsay inside the .voice files.<br>
+
:''Vsay-Number'' is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay <''Vsay-Number''> <''Vsay-String''>),<br> ''Vsay-Number'' represents the vsay number of Vsay as listed in the .voice files.<br>
:''Custom-Message'' is normaly \"\" (empty) else its the chat message that will be drawn .
+
:''Custom-Message'' is by default \"\" (empty), otherwise it's the message that gets printed in the chat area.
 +
:if ''VoiceOnly'' is 0 it will print a chat message on behalf of ''ClientNum'' contaning the message<br>
 +
:if ''VoiceOnly'' is 1 it will only do the sound but not the message
  
 
===Team Voice Chat===
 
===Team Voice Chat===
:"'''vtchat''' 0 ''ClientNum'' 50 ''Vsay-String'' ''Vsay-Number'' ''Y-Location'' ''Z-Location'' \"''Custom-Message''\""<br>
+
* "'''vtchat''' ''VoiceOnly'' ''ClientNum'' 50 ''Vsay-String'' ''X-Location'' ''Y-Location'' ''Z-Location'' ''Vsay-Number'' \"''Custom-Message''\""<br>
:'''vchat''' will team voice chat ''Vsay-String'' on behalf of client ''ClienNum''.<br>
+
:'''vchat''' sends a team voice chat ''Vsay-String'' a on behalf of client ''ClienNtum''.<br>
:''Vsay-Number'' is normaly random but i can be stable using /vsay <''Vsay-Number''> <''Vsay-String''>,<br> ''Vsay-Number'' represend the vsay nummer of Vsay inside the .voice files.<br>
+
:''Vsay-Number'' is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay <''Vsay-Number''> <''Vsay-String''>),<br> ''Vsay-Number'' represents the vsay number of Vsay as listed in the .voice files.<br>
 
:the ''X,Y,Z-Location's'' parematers the represent the clients location.<br>
 
:the ''X,Y,Z-Location's'' parematers the represent the clients location.<br>
:''Custom-Message'' is normaly \"\" (empty) else its the chat message that will be drawn.  
+
:''Custom-Message'' is by default \"\" (empty), otherwise it's the message that gets printed in the chat area.
 +
:if ''VoiceOnly'' is 0 it will print a chat message on behalf of ''ClientNum'' contaning the message<br>
 +
:if ''VoiceOnly'' is 1 it will only do the sound but not the message
  
 
===Fireteam Voice Chat===
 
===Fireteam Voice Chat===
:"'''vtchat''' 0 ''ClientNum'' 50 ''Fireteam-String'' ''Vsay-Number'' ''Y-Location'' ''Z-Location'' \"''Custom-Message''\""<br>
+
* "'''vtchat''' ''VoiceOnly'' ''ClientNum'' 50 ''Fireteam-String'' ''X-Location'' ''Y-Location'' ''Z-Location'' ''Vsay-Number'' \"''Custom-Message''\""<br>
 
:'''vchat''' will team voice chat ''Vsay-String'' on behalf of client ''ClienNum''.<br>
 
:'''vchat''' will team voice chat ''Vsay-String'' on behalf of client ''ClienNum''.<br>
:''Vsay-Number'' is normaly random but i can be stable using /vsay <''Vsay-Number''> <''Fireteam-Vsay-String''>,<br> ''Vsay-Number'' represend the vsay nummer of Vsay inside the .voice files.<br>
+
:''Vsay-Number'' is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay <''Vsay-Number''> <''Vsay-String''>),<br> ''Vsay-Number'' represents the vsay number of Vsay as listed in the .voice files.<br>
 
:the ''X,Y,Z-Location's'' parematers the represent the clients location.<br>
 
:the ''X,Y,Z-Location's'' parematers the represent the clients location.<br>
:''Custom-Message'' is normaly \"\" (empty) else its the chat message that will be drawn.
+
:''Custom-Message'' is by default \"\" (empty), otherwise it's the message that gets printed in the chat area.
 +
:if ''VoiceOnly'' is 0 it will print a chat message on behalf of ''ClientNum'' contaning the message<br>
 +
:if ''VoiceOnly'' is 1 it will only do the sound but not the message
  
 
==Fireteam==
 
==Fireteam==
 
===Application===
 
===Application===
:"'''application''' ''Number''"
+
* "'''application''' ''Number''"
:'''application''' will show up the fireteam invation message's<br>
+
:'''application''' shows a fireteam invation message to the client.<br>
:if ''Number'' > -1 the "accept .. application to join your fireteam" shows up in this case ''Number'' is the ClientNum of applying client.<br>
+
:if ''Number'' > -1 - the "accept ... application to join your fireteam" message shows up. In this case ''Number'' is the ClientNum of the applying client.<br>
:if ''Number'' == -1 the "your aplication has been submitted" shows up.<br>
+
:if ''Number'' == -1 - the "your aplication has been submitted" message shows up.<br>
:if ''Number'' == -2 the "your aplication fialed" shows up.<br>
+
:if ''Number'' == -2 - the "your aplication failed" message shows up.<br>
:if ''Number'' == -3 the "your aplication has been approved" shows up.<br>
+
:if ''Number'' == -3 - the "your aplication has been approved" message shows up.<br>
:if ''Number'' == -4 the "your aplication reply has been send" shows up.
+
:if ''Number'' == -4 - the "your aplication reply has been sent" message shows up.
  
 
===Proposition===
 
===Proposition===
:"'''proposition''' ''Number'' ''Number2''"
+
* "'''proposition''' ''Number'' ''Number2''"
:'''proposition''' will show up the fireteam proposition message's.<br>
+
:'''proposition''' shows a fireteam proposition message to the client.<br>
:if ''Number'' > -1 the "accept .. proposition to invite .. to your fireteam" shows up, in this case ''Number'' is the ClientNum of proposed client and, ''Number2'' is the ClientNum of proposing.<br>
+
:if ''Number'' > -1 - the "accept ... proposition to invite ... to your fireteam" message shows up. In this case ''Number'' is the ClientNum of the proposed client, and ''Number2'' is the ClientNum of the proposing player.<br>
:if ''Number'' == -1 the "your proposition has been submitted" shows up.<br>
+
:if ''Number'' == -1 - the "your proposition has been submitted" message shows up.<br>
:if ''Number'' == -2 the "your proposition was rejected" shows up.<br>
+
:if ''Number'' == -2 - the "your proposition was rejected" message shows up.<br>
:if ''Number'' == -3 the "your proposition was accepted" shows up.<br>
+
:if ''Number'' == -3 - the "your proposition was accepted" message shows up.<br>
:if ''Number'' == -4 the "your proposition reply has been send" shows up.<br>
+
:if ''Number'' == -4 - the "your proposition reply has been sent" message shows up.<br>
''Number2'' is an optional paramater only used when ''Number'' > -1.
+
:''Number2'' is an optional paramater only used when ''Number'' > -1.
  
 
===Invitation===
 
===Invitation===
:"'''invitation''' ''Number''"
+
* "'''invitation''' ''Number''"
:'''invitation''' will show up the fireteam invation message's.<br>
+
:'''invitation''' shows the fireteam invation message to the client.<br>
:if ''Number'' > -1 the "accept .. invitation to join your fireteam" shows up in this case ''Number'' is the ClientNum of applying client.<br>
+
:if ''Number'' > -1 - the "accept .. invitation to join your fireteam" message shows up. In this case ''Number'' is the ClientNum of the applying client.<br>
:if ''Number'' == -1 the "your invitation has been submitted" shows up.<br>
+
:if ''Number'' == -1 - the "your invitation has been submitted" message shows up.<br>
:if ''Number'' == -2 the "your invitation rejected" shows up.<br>
+
:if ''Number'' == -2 - the "your invitation rejected" message shows up.<br>
:if ''Number'' == -3 the "your invitation was accepted" shows up.<br>
+
:if ''Number'' == -3 - the "your invitation was accepted" message shows up.<br>
:if ''Number'' == -4 the "your invitation reply has been send" shows up.
+
:if ''Number'' == -4 - the "your invitation reply has been sent" message shows up.
  
 
==Others==  
 
==Others==  
 
===Complaining===
 
===Complaining===
:"'''complaint''' ''Number''"<br>
+
* "'''complaint''' ''Number''"<br>
:'''complaint''' will make the complain vote showup.<br>
+
:'''complaint''' shows the complaint vote message to the client.<br>
:if ''Number'' > 1 the vote will show up, in this case ''Number'' is the ClientNum of the Teamkilling player.<br>
+
:if ''Number'' > 1 - the vote shows up. In this case ''Number'' is the ClientNum of the teamkilling player.<br>
:if ''Number'' == -1 the complain filled message shows up.<br>
+
:if ''Number'' == -1 - the "complaint filed" message shows up.<br>
:if ''Number'' == -2 the complain dismissed message shows up.
+
:if ''Number'' == -2 - the "complaint dismissed" message shows up.
  
 
===Spawning===
 
===Spawning===
:"'''setspawnpt''' ''number''"<br>
+
* "'''setspawnpt''' ''Number''"<br>
:"'''setspawnpt''' sets the client game selected spawnpoint to number ''number''.
+
:'''setspawnpt''' sets the client game selected spawnpoint to number ''number''.
 +
 
 +
===Kicking===
 +
* "'''disconnect''' \"''reason''\""<br>
 +
:'''disconnect''' will disconnect the client it has been send with a "Server disconnected" message<br>
 +
:''reason'' is an optional parameter to show a reason after "Server disconnected"
 +
'''note:''' use trap_DropClient instead.
 +
 
 +
===Configstrings===
 +
* "'''cs''' ''Number'' \"''String''\""<br>
 +
: '''cs''' will set the clients configstringnumber ''Number'' to the ''String''
 +
'''Note:''' Setting individual players configstrings this way is probably a Bad Idea.
 +
 
 +
===Shaders===
 +
* "'''remapShader''' \"''OldShader''\" \"''NewShader''\" ''#''"<br>
 +
: '''remapShader''' replaces any texture ''OldShader'' with ''NewShader''<br>
 +
: ''#'' is the Timeoffset, which currently should be left as ''0''.
 +
 
 +
[[Category:ETPro]]
 +
[[Category:ETPro:Mods]]

Latest revision as of 23:06, 16 June 2007

et.trap_SendServerCommand() is used to send a command from the server to one or more clients. The first argument is the slot number of the client the command will be sent to. If it's equal to -1, the command will be broadcast to all clients.

The following commands can be issued with this function:

Printing

Print

  • "print \"Message\n\""
print prints Message to the client's console.

Center Print MoO

  • "cpm \"Message\n\""
cpm prints Message to the client's annoucement area and console.

Center Print

  • "cp \"Message\n\""
cp prints Message to the center of the client's screen.

  • "b locations \"Message\n\""
b prints Message to the client's banner locations
the locations can be a number from 0 to 248
For compatibility, the old-style locations (from 0-4) are also supported.
8 - player chat area
16 - left popup area (not recommended)
32 - centered above the chat area
64 - console only
128 - banner area (recommended)(top of screen)

Scores Print

  • "sc \"Message\n\""
sc prints Message to the client's console and writes it to the statsdump file.

Chatting

Chat

  • "c ClientNum \"Message\""
c prints Message as a global chat message on behalf of the client specified by ClientNum.


Team Chat

  • "tc ClientNum \"Message\" X-Location Y-Location Z-Location"
tc prints Message as a team chat message on behalf of the client specified by ClientNum,
the X,Y,Z-Location's are optional parematers that represent the client's location,
if the X,Y,Z-Location's are left out then the message will be printed without a location.

Fireteam Chat

  • "bc ClientNum \"Message\" X-Location Y-Location Z-Location".
bc prints Message as a fireteam chat message on behalf of the client specified by ClientNum,
the X,Y,Z-Location's are parematers that represent the client's location.

Global Message

  • "chat \"Message\""
chat prints Message like global message via rcon (qsay command).

Voice Chat

Global Voice Chat

  • "vchat VoiceOnly ClientNum 50 Vsay-String Vsay-Number \"Custom-Message\"".
vchat sends a global voice chat Vsay-String on behalf of the client specified by ClientNum.
Vsay-Number is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay <Vsay-Number> <Vsay-String>),
Vsay-Number represents the vsay number of Vsay as listed in the .voice files.
Custom-Message is by default \"\" (empty), otherwise it's the message that gets printed in the chat area.
if VoiceOnly is 0 it will print a chat message on behalf of ClientNum contaning the message
if VoiceOnly is 1 it will only do the sound but not the message

Team Voice Chat

  • "vtchat VoiceOnly ClientNum 50 Vsay-String X-Location Y-Location Z-Location Vsay-Number \"Custom-Message\""
vchat sends a team voice chat Vsay-String a on behalf of client ClienNtum.
Vsay-Number is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay <Vsay-Number> <Vsay-String>),
Vsay-Number represents the vsay number of Vsay as listed in the .voice files.
the X,Y,Z-Location's parematers the represent the clients location.
Custom-Message is by default \"\" (empty), otherwise it's the message that gets printed in the chat area.
if VoiceOnly is 0 it will print a chat message on behalf of ClientNum contaning the message
if VoiceOnly is 1 it will only do the sound but not the message

Fireteam Voice Chat

  • "vtchat VoiceOnly ClientNum 50 Fireteam-String X-Location Y-Location Z-Location Vsay-Number \"Custom-Message\""
vchat will team voice chat Vsay-String on behalf of client ClienNum.
Vsay-Number is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay <Vsay-Number> <Vsay-String>),
Vsay-Number represents the vsay number of Vsay as listed in the .voice files.
the X,Y,Z-Location's parematers the represent the clients location.
Custom-Message is by default \"\" (empty), otherwise it's the message that gets printed in the chat area.
if VoiceOnly is 0 it will print a chat message on behalf of ClientNum contaning the message
if VoiceOnly is 1 it will only do the sound but not the message

Fireteam

Application

  • "application Number"
application shows a fireteam invation message to the client.
if Number > -1 - the "accept ... application to join your fireteam" message shows up. In this case Number is the ClientNum of the applying client.
if Number == -1 - the "your aplication has been submitted" message shows up.
if Number == -2 - the "your aplication failed" message shows up.
if Number == -3 - the "your aplication has been approved" message shows up.
if Number == -4 - the "your aplication reply has been sent" message shows up.

Proposition

  • "proposition Number Number2"
proposition shows a fireteam proposition message to the client.
if Number > -1 - the "accept ... proposition to invite ... to your fireteam" message shows up. In this case Number is the ClientNum of the proposed client, and Number2 is the ClientNum of the proposing player.
if Number == -1 - the "your proposition has been submitted" message shows up.
if Number == -2 - the "your proposition was rejected" message shows up.
if Number == -3 - the "your proposition was accepted" message shows up.
if Number == -4 - the "your proposition reply has been sent" message shows up.
Number2 is an optional paramater only used when Number > -1.

Invitation

  • "invitation Number"
invitation shows the fireteam invation message to the client.
if Number > -1 - the "accept .. invitation to join your fireteam" message shows up. In this case Number is the ClientNum of the applying client.
if Number == -1 - the "your invitation has been submitted" message shows up.
if Number == -2 - the "your invitation rejected" message shows up.
if Number == -3 - the "your invitation was accepted" message shows up.
if Number == -4 - the "your invitation reply has been sent" message shows up.

Others

Complaining

  • "complaint Number"
complaint shows the complaint vote message to the client.
if Number > 1 - the vote shows up. In this case Number is the ClientNum of the teamkilling player.
if Number == -1 - the "complaint filed" message shows up.
if Number == -2 - the "complaint dismissed" message shows up.

Spawning

  • "setspawnpt Number"
setspawnpt sets the client game selected spawnpoint to number number.

Kicking

  • "disconnect \"reason\""
disconnect will disconnect the client it has been send with a "Server disconnected" message
reason is an optional parameter to show a reason after "Server disconnected"

note: use trap_DropClient instead.

Configstrings

  • "cs Number \"String\""
cs will set the clients configstringnumber Number to the String

Note: Setting individual players configstrings this way is probably a Bad Idea.

Shaders

  • "remapShader \"OldShader\" \"NewShader\" #"
remapShader replaces any texture OldShader with NewShader
# is the Timeoffset, which currently should be left as 0.