Jump to content
  • 0

ban player from events


luizinhomt

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

Good evening everyone, does anyone know a way to ban players from server events only? if he is banned when he clicks on some event e.g. bg or events that require interaction with an NPC and he cannot enter the map and the message appears that he has been banned and needs to wait so many minutes to be able to participate. thank you all
 

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  15
  • Reputation:   3
  • Joined:  01/29/24
  • Last Seen:  

create a column in account table named 'event_ban' or something.

create a @eventban command that will receive a character name and a number of days as parameter, find the account and update the event_ban column inserting that number of days

create a trigger in the database to decrease all event_ban by -1 at midnight, limit to 0 so it wont get a negative number.

create a check on your NPC events to see if user event_ban > 0, close the dialog.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

Hi, the database part can be done, but I'm not able to create an NPC to do the banning function and also the condition to put in the event NPCs to search the bank, could you be so kind and share an example of how I can do it?

Edited by luizinhomt
edit
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

@sfj209jfo-p Can you give an example of how I can do it, thank you very much

Edited by luizinhomt
Edit
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  15
  • Reputation:   3
  • Joined:  01/29/24
  • Last Seen:  

sorry i dont know how.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

Here is an example. I haven't tested.

EventBan.txt

U can use a command to ban player from event in minutes. Different events can have different IDs. And u have a function u can call to check if player is banned or not.

 

Rynbef~

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

@Rynbef Thank you very much, I will test

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

@Rynbef please know how to solve this problem 

errobanevento.png

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

Im sorry. My mistake. I declared a atcommand but just call it and don't bind it and get arg just works for functions for atcommands we do need .@atcmd_parameters$[]

Pls try again.

EventBan.txt

 

Maybe use dispbottom instead of mes. But I forget changed yet.

 

Rynbef~

Edited by Rynbef
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

I've updated to make more comfortable.

I added an unban command and changed to dispbottom.

EventBan.txt

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

It's perfect, very good friend, my only problem now is that even though the character is banned, it appears that he is not banned

errobanevento2.png

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

I'll check the SQL query later. Have to sleep now.

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

thank you very much have a good rest

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

Okay I ve cleaned up the code a bit and add additional checks and returns. Idk if rA able to use big integer in SQL. So changed everything to use Integer. When the time is over and the function CheckEventBan is called it will deleted directly now. To cleanup the database.

Pls delete the database and add the new with normal integer. If u ban a player check if they added to the database.

EventBan.txt

 

Rynbef~

Edited by Rynbef
Structure
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

Hi @Rynbef , thank you very much for responding, I'm still having the same problem, even though the banned character doesn't appear to be banned, I looked, the database is saving correctly and this error is appearing in the console

Is it possible to place a dispbottom for the player who was banned warning that he was banned for a certain event time? Thank you very much in advance

errobanevento.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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.

×
×
  • Create New...