Commands through buttons

Cookie^

L2: Junior Member
Jan 26, 2014
75
2
Hello there, I was wondering.

How would I be able to make a button that when it gets damaged it executes a command?

Something like hitting a button and toggling 'sv_cheats' on/off?

Thanks for your time! :)
 

henke37

aa
Sep 23, 2011
2,075
515
Have you used the I/O system before? If you have then you clearly wasn't paying attention.
 

Egan

aa
Feb 14, 2010
1,375
1,720
You can use the entities point_clientcommand to do client things like +forward, and point_servercommand to do things the server operator would do like sv_cheats. Although I warn that if you toggle sv_cheats on a public map then it can potentially damage the server. There are a few commands players can type in, with sv_cheats on, that can crash the server, which isn't good in a public map!
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
You need a point_servercommand entity somewhere in your map, and name it something like 'ServerCommand" or "Console"

Then have your button do "OnPressed>ServerCommand>Command>[yourcommand]>[time]"

Do NOT use quotation marks in commands, so all you would type would be sv_cheats 1
 

Cookie^

L2: Junior Member
Jan 26, 2014
75
2
You can use the entities point_clientcommand to do client things like +forward, and point_servercommand to do things the server operator would do like sv_cheats. Although I warn that if you toggle sv_cheats on a public map then it can potentially damage the server. There are a few commands players can type in, with sv_cheats on, that can crash the server, which isn't good in a public map!

Thanks, I used sv_cheats as an example btw :)