General > Developers Corner
Show player count on server in advert
Lolomat:
Hey,
how is the addon called wich allows to use a command like !darkrp to join on another server?
UnderYouFive:
What do you mean Lolomat? Are you asking how a ! command makes you join another server?
Lolomat:
@UnderYouFive
yeah :)
UnderYouFive:
--- Code: ---function darkrpCommand( pl, text, teamonly )
if (text == "!darkrp") then
pl:SendLua( [[ LocalPlayer():ConCommand( 'connect Your IP here' ) ]] )
for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has joined darkrp your server name via !darkrp" )
end
end
end
hook.Add( "PlayerSay", "Chat", darkrpCommand )
--- End code ---
Enjoy :)
Lolomat:
@UnderYouFive
thanks, but how do i add it to my server.
I tried it putting in garrysmod/addons/ulx/lua/ulx/modules/sh/joinotherserver.lua like this:
--- Code: ---CATEGORY_NAME = "Join other server"
function tttCommand( pl, text, teamonly )
if (text == "!ttt2") then
pl:SendLua( [[ LocalPlayer():ConCommand( 'ttt2.fickschnitzel.cf' ) ]] )
for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " ist nun auf Fickschnitzel TTT Server #2 via !ttt2" )
end
end
end
hook.Add( "PlayerSay", "User", tttcomand )
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version