Thanks valkyr and crapshoot. It will help me to spam some 2.55 players. 
Config a private msg for people comming in
I setup a NQ server to test itā¦
protocol is actually there on ClientConnect but gets stripped out somewhere between then and ClientBegin (I kinda thought it must be, otherwise how would the server know to reject a client with a protocol mismatch?).
Not that Iām sure itāll actually work, like you say, but anyway.
et_ClientConnect isnāt an optimal solution solution in my eyes. On many first connects the player has to dowload maps or custom pk3s. Iām not sure if cpm is displayed if the client triggers a download ā¦
If the mod accepts the connection, it should return nil. Otherwise, the mod should return a string describing the reason the client connection was rejected.
So this function is called at the very bginning of a connect, so i wonder indeed if a clien would be able to see this message toughā¦
But since the cpm isnāt created yet ( i suppose) the message canāt be printed, someone has to test if it will be placed in a queue en be displayed when it is possible, or just never displayedā¦
Grtz
Rebel
Nice!!
So now we have to wait if ThaMasta thinks that this is what he wanted =D
Congratz to evryone:D
Grtz
The reason it works is because, like you say, commands are normally sent into a queue (buffer) :
et.trap_SendConsoleCommand( when, command ) takes when the command is executed as an argument, from the list of predefined constants :
[ul]
[li]et.EXEC_NOW
[/li][li]et.EXEC_INSERT
[/li][li]et.EXEC_APPEND
[/li][/ul]
and this documentation on the Quake 3 source, tells us that EXEC_APPEND is the ānormal caseā (commands get added to the end of the buffer)⦠So et.trap_SendServerCommand will use that method.
[QUOTE=valkyr;227805]
protocol is actually there on ClientConnect but gets stripped out somewhere between then and ClientBegin (I kinda thought it must be, otherwise how would the server know to reject a client with a protocol mismatch?).
Not that Iām sure itāll actually work, like you say, but anyway.[/QUOTE]
oops, my mistake. you are correct. it is there until ClientUserinfoChanged is called.
here is basically a merge of both of our scripts:
-- command to deliver the text
printCommand = "cpm"
-- greeting text for 2.60 users. note the string is followed by username
greetingText = "Welcome to the server"
-- a message for users on old versions
upgradeText = "Please upgrade to version 2.60"
function et_ClientConnect( clientNum, firstTime, isBot )
if firstTime == 0 or isBot == 1
then return nil
end
-- get the clients userinfo string
local userInfo = et.trap_GetUserinfo(clientNum)
-- welcome users using the latest protocol
if et.Info_ValueForKey( userInfo, "protocol" ) == "84" then
et.trap_SendServerCommand(clientNum, string.format("%s \" %s %s", printCommand, greetingText, et.Info_ValueForKey( userInfo, "name" )))
return nil
end
-- ask the others to update (or whatever)
et.trap_SendServerCommand(clientNum, string.format("%s \" %s", printCommand, upgradeText))
return nil
end
Hello, everybody, I am new here. Here is something might be helpful for you.www.zstar.hk www.edgei-ds.cn (many movies to download)www.tigersupermall.com
