General > Developers Corner

Show player count on server in advert

<< < (3/4) > >>

UnderYouFive:
Oh sorry, I forgot to tell you haha. You need to put it in your "garry'smod/lua/autorun" folder.

Lolomat:
In garrysmod/lua/autorun/client/joinotherserver.lua or garrysmod/lua/autorun/server/joinotherserver.lua ?

UnderYouFive:
No just put it in the autorun folder  "garry'smod/lua/autorun"

Lolomat:
I dropped it in garrysmod/lua/autorun/server/joinotherserver.lua
 It is looking like this:

--- Code: ---function tttCommand( pl, text, teamonly )
    if (text == "!ttt2") then
    pl:SendLua( [[ LocalPlayer():ConCommand( 'connect ttt2.fickschnitzel.cf' ) ]] )
    for k, v in pairs(player.GetAll()) do v:ChatPrint( "Spieler " .. pl:Nick() .. " ist nun auf Fickschnitzel TTT Server #2 via !ttt2" )

end
end
end
hook.Add( "PlayerSay", "User", tttCommand )
--- End code ---

This is how i made it work for me. :)
Thanks for the code.

UnderYouFive:
So does it work when you use !ttt2? Do you join the server?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version