Mirage Source
http://web.miragesource.net/forums/

Semi-Advanced Warn System Difficulty 2/5 (C&P)
http://web.miragesource.net/forums/viewtopic.php?f=183&t=4859
Page 1 of 82

Author:  Nean [ Thu Dec 18, 2008 6:59 am ]
Post subject:  Semi-Advanced Warn System Difficulty 2/5 (C&P)

Okay, so the other day, I got bored and tried to write one from scratch, needless to say it was a success. I'm pretty confident in it, as it seemed to work quite well, though I'd appreciate it if someone with a bit more knowledge than I, took a look at it to see if there was any potential bugs or problems. The good thing about this is, that it keeps track of the players warn level. So all you need to do is /warn the player. First warning sends a text warn. Second a kick, and the third a good ol' ban. Enjoy, and remember I need some constructive criticism.

Server Side

SPOILER: (click to show)
Find
Code:
CQuit


Under it add:

Code:
CSetWarn


Then Find:

Code:
Sub SetPlayerPK(ByVal Index As Long, ByVal PK As Long)
    Player(Index).Char(TempPlayer(Index).CharNum).PK = PK
End Sub


Under it add:
Code:
Function GetPlayerWarn(ByVal Index As Long) As Long
    GetPlayerWarn = Player(Index).Char(TempPlayer(Index).CharNum).Warn
End Function

Sub SetPlayerWarn(ByVal Index As Long, ByVal Warn As Long)
    Player(Index).Char(TempPlayer(Index).CharNum).Warn = Warn
End Sub


Then Find
Code:
         Case Else
            GoTo ErrorHandle ' packet not found


Above it add:

Code:
        Case CSetWarn
            HandleSetWarn Index, Parse


Then Find:
Code:
' :::::::::::::::::::::::
' :: Set sprite packet ::
' :::::::::::::::::::::::
Private Sub HandleSetSprite(ByVal Index As Long, ByRef Parse() As String)
Dim N As Long

    ' Prevent hacking
    If GetPlayerAccess(Index) < ADMIN_MAPPER Then
        Call HackingAttempt(Index, "Admin Cloning")
        Exit Sub
    End If
   
    ' The sprite
    N = CLng(Parse(1))
   
    Call SetPlayerSprite(Index, N)
    Call SendPlayerData(Index)
    Exit Sub
End Sub


And under that add:
Code:
' :::::::::::::::::::::::
' :: Set Warn packet ::
' :::::::::::::::::::::::
Sub HandleSetWarn(ByVal Index As Long, _
                  ByRef Parse() As String)
    Dim N As Long

    N = FindPlayer(Parse(1))
   
    If N > 0 Then
        If N <> Index Then

            Select Case GetPlayerWarn(N) + 1

                Case 1
                    Call SetPlayerWarn(N, 1)
                    'Call SetPlayerWarn(n, GetPlayerWarn(n) + 1)
                    Call PlayerMsg(Index, "You have received your first warning, for breaking the rules. Your second will result in a kick!", Blue)

                Case 2
                    Call SetPlayerWarn(N, GetPlayerWarn(N) + 1)
                    Call AlertMsg(Index, "You have received your second warning. Your third will result in a ban")

                Case 3
                    Call SetPlayerWarn(N, GetPlayerWarn(N) + 1)
                    Call BanIndex(N, Index)
            End Select

        Else
            Call PlayerMsg(Index, "You can't warn yourself!", BrightRed)
        End If

    Else
        Call PlayerMsg(Index, "Player Isn't Online!", BrightRed)
    End If

End Sub


Then in the player rec find:
Code:
PK As Byte


Under that add:
Code:
Warn As Byte


Client Side

SPOILER: (click to show)
Find:
Code:
Case "/setaccess"
                    If GetPlayerAccess(MyIndex) < ADMIN_CREATOR Then
                        AddText "You need to be a high enough staff member to do this!", AlertColor
                        GoTo Continue
                    End If
                   
                    If UBound(Command) < 2 Then
                        AddText "Usage: /setaccess (name) (access)", AlertColor
                        GoTo Continue
                    End If
                   
                    If IsNumeric(Command(1)) = True Or IsNumeric(Command(2)) = False Then
                        AddText "Usage: /setaccess (name) (access)", AlertColor
                        GoTo Continue
                    End If
                   
                    SendSetAccess Command(1), CLng(Command(2))


Under it add:
Code:
                    Case "/warn"
                    If GetPlayerAccess(MyIndex) < ADMIN_CREATOR Then
                        AddText "You need to be a high enough staff member to do this!", AlertColor
                        GoTo Continue
                    End If
                   
                    If UBound(Command) < 1 Then
                        AddText "Usage: /warn (name)", AlertColor
                        GoTo Continue
                    End If
                   
                    If IsNumeric(Command(1)) = True Then
                        AddText "Usage: /warn (name)", AlertColor
                        GoTo Continue
                    End If
                   
                    SendSetWarn Command(1)
     


Then find:
Code:
Sub SendSetAccess(ByVal Name As String, ByVal Access As Byte)
Dim Packet As String

    Packet = CSetAccess & SEP_CHAR & Name & SEP_CHAR & Access & END_CHAR
    Call SendData(Packet)
End Sub


Under it add:
Code:
Sub SendSetWarn(ByVal Name As String)
Dim Packet As String

    Packet = CSetWarn & SEP_CHAR & Name & END_CHAR
    Call SendData(Packet)
End Sub


Then find:
Code:
CQuit


Under it add:
Code:
CSetWarn

That should be it. Give it a whirl, and drop me some feed back.

Author:  Nean [ Sat Dec 20, 2008 10:26 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

No use to anyone?

Author:  Rian [ Sat Dec 20, 2008 7:37 pm ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

It's plenty useful, in fact I have a warn system that's nearly identical. ;) Here's a challenge for ya Nean, store a date on the player rec as well, and make the third warning a one day ban, and add a fourth warning that permanently bans them :D

Author:  Nean [ Sun Dec 21, 2008 1:38 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Rian wrote:
It's plenty useful, in fact I have a warn system that's nearly identical. ;) Here's a challenge for ya Nean, store a date on the player rec as well, and make the third warning a one day ban, and add a fourth warning that permanently bans them :D


Ooh. That might be tough... Even tougher it'll be to test it though, provided I can even remember. I'll try that challenge Rian, I'll try that. :D

Author:  Matt [ Sun Dec 21, 2008 1:52 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Player.bandate = date
Player.bantime = time

Then all you gotta do is..

If bandate <> date and bantime < time then
unban
end if

Author:  genusis [ Sun Dec 21, 2008 4:49 pm ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

haha this is good ^^. another thing that would work with this would be a report system. To have players type the rule breaking players name in select a report option a picture be taken of the current situation and the text be save for that player. on serverside. and make it where a admin or moderator could look at the report and be able to press yes or no and if yes it warns the player mattering on the condition of the rule. ^^.

Author:  Labmonkey [ Sun Dec 21, 2008 7:23 pm ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

How bout making it impossible to do the things in the first place to get you warned. Kind like (pardon the bad anology) locking the door, instead of calling the cops.

First make a list of everything that can get you warned/banned in your game.

Example

Spamming
Cursing (depends)
Hacking
Pissing you off


First lets look at spamming. A common type of spamming is sending the same text over and over again. This would be quite easy to check for, and is already in many games. Simply make a variable "lasttext" for the player and save their last message in it. When they send another message, if its the same, dont send it, and instead send them text saying 'you already said that'.
Also you can let people have an ignore command, so your players can simply ingore/block spammers, rendering them powerless to annoy.

Cursing, get a word filter, and make it clientside. Let people turn it on and off.

Hacking, get proper security.

Pissing you off: make an easy to access ban button client and serverside.

Author:  genusis [ Sun Dec 21, 2008 9:42 pm ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

haha sometimes there are glitches and some people like to take advantage of them and not tell you about them. the purpose of it would be allowing players to help out with the stuff you can't 100% cover.

Author:  Labmonkey [ Sun Dec 21, 2008 9:56 pm ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

The post was not directed at you genusis. It was merely something for Nean to code, seeing as he wants to program stuff.

Wait, just realized your post could have not been directed at me also, which would make me seem idiotic. So, sorry if that is the case.

But anyway, i believe ed3 has a report system, its sadscript, but you can rip it from there.

Author:  genusis [ Mon Dec 22, 2008 12:21 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

sadscript. ................... LMAO Worthless. if i was someone i would want my game to work well and fast so i would use a hardcoded one. I say no to sadscripts.

Author:  Matt [ Mon Dec 22, 2008 12:27 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

genusis wrote:
sadscript. ................... LMAO Worthless. if i was someone i would want my game to work well and fast so i would use a hardcoded one. I say no to sadscripts.


You can convert sadscript codes to be hard coded.. Good god man, stop being retarded. You wanna see something worthless? Find a mirror and stare for awhile, shit.

Author:  Labmonkey [ Mon Dec 22, 2008 1:41 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

refrains from saying "What is wrong with the mirror."

Matt posted after me, and yet cursed someone else off! <feels special>

Yea, so anyway, enough being stupid. VBScript (or sadscript) can basically, with little or no tweaks, just be copy pasted into vb6. If you really want it, what it does is have a report.txt serverside. When the server gets a message (because elysium has serverside command checking, you may move it to clientside if you want) it checks if the message starts with /report. If it does, then it takes all text after that, along with the player's name, and puts it in the report.txt. You simply check the report.txt, and see what people reported.

Author:  Nean [ Mon Dec 22, 2008 7:33 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Yeah, ignore and word censors will definitely be coded for the hell of it, when I get them done I'll make some tuts. I'm also converting most of my code to work with Elysium 3.3.2 for the hell of it...

Author:  Nean [ Wed Apr 08, 2009 4:22 pm ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

I spiffed up some of the code (fixed a few bugs), and it seems to work fine on the newest version on MS.

Author:  Joost [ Thu Apr 09, 2009 8:43 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

genusis wrote:
sadscript. ................... LMAO Worthless. if i was someone i would want my game to work well and fast so i would use a hardcoded one. I say no to sadscripts.

Kid, you're a fucking moron. Any real game uses scripting for its events. Now sadscript may not be the best way to go, bt scripting is vital in any decent game. So don't go shouting stupid things in this section again, this section is for real men to discuss things.

Author:  Robin [ Thu Apr 09, 2009 1:30 pm ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

genusis wrote:
sadscript. ................... LMAO Worthless. if i was someone i would want my game to work well and fast so i would use a hardcoded one. I say no to sadscripts.


The way Elysium and all it's decendants use Sadscript is terrible, but using it properly it can be a very powerful tool.

Also, I laughed at 'Want my game to work well and fast'. Just look around at some of the code you've posted, son.

Author:  wanai [ Wed Dec 01, 2021 8:23 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru

Author:  wanai [ Sat Jan 01, 2022 12:03 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Uncl

Author:  wanai [ Sat Jan 01, 2022 12:04 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

69.8

Author:  wanai [ Sat Jan 01, 2022 12:05 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Bett

Author:  wanai [ Sat Jan 01, 2022 12:06 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Bett

Author:  wanai [ Sat Jan 01, 2022 12:07 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Alfr

Author:  wanai [ Sat Jan 01, 2022 12:08 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Summ

Author:  wanai [ Sat Jan 01, 2022 12:09 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Feat

Author:  wanai [ Sat Jan 01, 2022 12:10 am ]
Post subject:  Re: Semi-Advanced Warn System Difficulty 2/5 (C&P)

Delp

Page 1 of 82 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/