Results 1 to 13 of 13
  1. #1
    Caesar1928's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    45
    Reputation
    10
    Thanks
    14

    [Fab] How to partially stop begging on your server!

    Alright this is pretty straight forward so navigate to wServer/networking/handlers/PlayerTextHandler.cs
    Now find the else statement that contains
    Code:
                        if (client.Player.Muted)
                        {
                            client.Player.SendInfo("{\"key\":\"server.muted\"}");
                            return;
                        }
    and just add this after it
    Code:
                        if (packet.Tex*****ntains("need") && packet.Tex*****ntains("items") ||
                        packet.Tex*****ntains("free") && packet.Tex*****ntains("items") ||
                        packet.Tex*****ntains("give") && packet.Tex*****ntains("items"))
                        {
                            client.Player.SendError("Don't beg!");
                            return;
                        }
    feel free to edit the if statement to your needs (:
     
    Me

  2. The Following User Says Thank You to Caesar1928 For This Useful Post:

    HGAEHaeheadhetdhtertherh (04-22-2016)

  3. #2
    NotKierze's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    105
    Reputation
    10
    Thanks
    21
    Quote Originally Posted by Caesar1928 View Post
    Alright this is pretty straight forward so navigate to wServer/networking/handlers/PlayerTextHandler.cs
    Now find the else statement that contains
    Code:
                        if (client.Player.Muted)
                        {
                            client.Player.SendInfo("{\"key\":\"server.muted\"}");
                            return;
                        }
    and just add this after it
    Code:
                        if (packet.Tex*****ntains("need") && packet.Tex*****ntains("items") ||
                        packet.Tex*****ntains("free") && packet.Tex*****ntains("items") ||
                        packet.Tex*****ntains("give") && packet.Tex*****ntains("items"))
                        {
                            client.Player.SendError("Don't beg!");
                            return;
                        }
    feel free to edit the if statement to your needs (:
     
    Me
    lol. This is pretty awful if i wrote
    who wants a free *item*
    it would tell me not to beg xD

  4. #3
    Riigged's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    no
    Posts
    3,845
    Reputation
    401
    Thanks
    10,255
    My Mood
    Devilish
    Wouldnt this only work if a player used all the words combined? Since your using && instead of || (or)
    Do like items && free || give && please blah blah blah etc. Also add like "this is based on keywords so if you werent begging just ignore" to the send message maybe
    Last edited by Riigged; 12-06-2015 at 09:24 AM.

  5. #4
    Caesar1928's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    45
    Reputation
    10
    Thanks
    14
    Quote Originally Posted by NotKierze View Post
    lol. This is pretty awful if i wrote
    who wants a free *item*
    it would tell me not to beg xD
    Like I said
    feel free to edit the if statement to your needs (:
    - - - Updated - - -

    Quote Originally Posted by Riigged View Post
    Wouldnt this only work if a player used all the words combined? Since your using && instead of || (or)
    Do like items && free || give && please blah blah blah etc. Also add like "this is based on keywords so if you werent begging just ignore" to the send message maybe
    I did do "need" and "items" or "free" and "items" or "give" and "items"

  6. #5
    Riigged's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    no
    Posts
    3,845
    Reputation
    401
    Thanks
    10,255
    My Mood
    Devilish
    Oh im on mobile so all i say was && lol had to scroll to right to see the ||

    - - - Updated - - -

    and instead of telling it to senderror, have it just not send the text at all if they say the combination of keywords
    Last edited by Riigged; 12-06-2015 at 02:14 PM.

  7. #6
    Caesar1928's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    45
    Reputation
    10
    Thanks
    14
    Quote Originally Posted by Riigged View Post
    Oh im on mobile so all i say was && lol had to scroll to right to see the ||

    - - - Updated - - -

    and instead of telling it to senderror, have it just not send the text at all if they say the combination of keywords
    It already wont send because it's in PlayerTextHandler and I said return so the players message will never send and it will send them the error

  8. #7
    NotKierze's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    105
    Reputation
    10
    Thanks
    21
    you could do an array like
    string[] begWords = {"Item", "Free", "Plz" }
    would make the code shorter mate.

  9. #8
    FlutterM4rk's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    365
    Reputation
    16
    Thanks
    228
    My Mood
    Sleepy
    Quote Originally Posted by NotKierze View Post
    you could do an array like
    string[] begWords = {"Item", "Free", "Plz" }
    would make the code shorter mate.
    'oryx *plz* drop me loot'
    'lol just got some literally *free* stuff from this dungeon'

  10. #9
    NotKierze's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    105
    Reputation
    10
    Thanks
    21
    Quote Originally Posted by FlutterM4rk View Post
    'oryx *plz* drop me loot'
    'lol just got some literally *free* stuff from this dungeon'
    well i guess we cannot stop begging then.

  11. #10
    FlutterM4rk's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    365
    Reputation
    16
    Thanks
    228
    My Mood
    Sleepy
    Quote Originally Posted by NotKierze View Post
    well i guess we cannot stop begging then.
    we might not but someone might, it's not worth the effort though

  12. The Following User Says Thank You to FlutterM4rk For This Useful Post:

    NotKierze (12-08-2015)

  13. #11
    Riigged's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    no
    Posts
    3,845
    Reputation
    401
    Thanks
    10,255
    My Mood
    Devilish
    Quote Originally Posted by FlutterM4rk View Post
    'oryx *plz* drop me loot'
    'lol just got some literally *free* stuff from this dungeon'
    if someone is bothered to, they can hurt their brain writing a shitload of combinations that would only be said by a beggar begging for items
    doubt anyone wants to g thru that work tho

     








  14. #12
    BlackRayquaza's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    574
    Reputation
    10
    Thanks
    186
    My Mood
    In Love
    Or just ban them.
    YEP cock

  15. #13
    noone2016's Avatar
    Join Date
    Jan 2016
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    164
    My Mood
    Amused
    With the right word combos this might work

Similar Threads

  1. [Tutorial] How to put unlimited slots in your server of TeamSpeak 3 on Windows
    By dreek1 in forum CrossFire Tutorials
    Replies: 1
    Last Post: 09-14-2016, 12:42 AM
  2. Replies: 10
    Last Post: 04-08-2009, 10:48 PM
  3. How Do You Put Pics On Your Signature?
    By alfonso951 in forum Flaming & Rage
    Replies: 13
    Last Post: 01-23-2009, 06:44 AM
  4. How do I stop being DC?
    By JessieHooker in forum Debate Fort
    Replies: 3
    Last Post: 12-24-2008, 12:36 PM
  5. how do u stop
    By bk93kevpro in forum Combat Arms Hacks & Cheats
    Replies: 2
    Last Post: 10-11-2008, 04:47 PM

Tags for this Thread