Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEBUG <- true;
- function debugPrint( text )
- {
- if(DEBUG == false)
- return;
- printl(text);
- }
- function InputUse() //Name and case is important!! In this case the function is set to run automatically on the Use input.
- {
- debugPrint("You pressed the button.");
- if(activator.GetClassname() == "player")
- {
- player <- activator; //or just use the activator handle directly bellow
- if(player.IsNoclipping() == true)
- {
- ScriptPrintMessageChatAll("You pressed the button while in noclip!");
- SendToConsole("noclip"); //this will probably affect all other players!
- EntFireByHandle(player, "SetHealth", "0", 0, player, player);
- }
- else
- {
- ScriptPrintMessageChatAll("You pressed the button while not noclipping.")
- }
- }
- else
- {
- //Something used the button but it wasn't a player.
- }
- debugPrint("InputUse() has been executed.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement