jafix Posted March 7, 2017 Report Posted March 7, 2017 (edited) Is it possible to make an if statement like client.on('friendMessage', function (steamID, message) { if (message.match('!logoff') { if (steamID == 76...) { client.sendMessage(steamID, 'logging off.') client.logOff(); } else { client.sendMessage(steamID, 'Sorry, this is an owner-only command' } } }); I just quickly made this script so if there are some errors, I didn't try exactly this script but i tried a script very similar. This part was the same: if (steamID == 76...) { And if there's an option it should be easy to make allow everyone except for 1 steamid/user by just changing == in !== right. Edited March 7, 2017 by jafix Quote
Dr. McKay Posted March 8, 2017 Report Posted March 8, 2017 steamID is a SteamID object. If you want the 64-bit ID, use steamID.getSteamID64() JavaScript can't precisely track numbers that are larger than 253. You need to wrap it in quotes to make it a string for comparison. Correct regarding == and !=. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.