Jump to content
McKay Development

How can I send a message and then remove the account from my friendlist?


Schmaniel

Recommended Posts

I want to kick every user that is not in one of my groups.
therefore I added a sleep inbetween the chatMessage and the removeFriend.

Both are working, but not simultaneously. The user is getting kicked without the message being sent.

 

function sleep(milliseconds) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
    if ((new Date().getTime() - start) > milliseconds){
      break;
    }
  }
}
    
user.chatMessage(`${row.SteamID64}`, "You are getting kicked, because you are not in one of our groups anymore");
sleep(5000);
user.removeFriend(`${row.SteamID64}`);

 

Link to comment
Share on other sites

  • 1 month later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...