Mirage Source

Free ORPG making software.
It is currently Sat Apr 27, 2024 10:30 am

All times are UTC


Forum rules


Make sure your tutorials are kept up to date with the latest MS4 releases.



Post new topic Reply to topic  [ 1149 posts ]  Go to page 1, 2, 3, 4, 5 ... 46  Next
Author Message
 Post subject: Staff Online Feature
PostPosted: Wed Sep 24, 2008 11:01 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
So, once again, I was bored. To test myself, I made this. How it works, is when you type /staff, it displays all the people that have > 0 access, that are online. Once more, this is just a rip and edit, of an already existing feature (Whos Online). Yeah, I know. I'm a n00b. When this is done, just type /staff, and it displays what staff members are online! GASP. Amazing rite? :roll:
SPOILER: (click to show)
Server Side:
Find:
Code:
Sub SendWhosOnline(ByVal Index As Long)
Dim s As String
Dim n As Long, i As Long

    For i = 1 To MAX_PLAYERS
        If IsPlaying(i) Then
            If i <> Index Then
                s = s & GetPlayerName(i) & ", "
                n = n + 1
            End If
        End If
    Next i
           
    If n = 0 Then
        s = "There are no other players online."
    Else
        s = Mid$(s, 1, Len(s) - 2)
        s = "There are " & n & " other players online: " & s & "."
    End If
       
    Call PlayerMsg(Index, s, WhoColor)
End Sub


Now above that add:
Code:
Sub SendWhosStaff(ByVal Index As Long)
Dim s As String
Dim n As Long, i As Long

    For i = 1 To MAX_PLAYERS
        If IsPlaying(i) Then
           If GetPlayerAccess(i) > 0 Then
                s = s & GetPlayerName(i) & ", "
                n = n + 1
            End If
        End If
    Next i
           
    If n = 0 Then
        s = "There are no staff members online."
    Else
        s = Mid$(s, 1, Len(s) - 2)
        s = "There is " & n & " staff members online: " & s & "."
    End If
       
    Call PlayerMsg(Index, s, WhoColor)
End Sub


Now find:
Code:
CWhosOnline


Above it add:
Code:
CWhosStaff


Now find:
Code:
' :::::::::::::::::::::::
        ' :: Who online packet ::
        ' :::::::::::::::::::::::
        Case CWhosOnline
            Call SendWhosOnline(Index)
            Exit Sub


Above it add:
Code:
        ' :::::::::::::::::::::::
        ' :: Whos staff packet ::
        ' :::::::::::::::::::::::
        Case CWhosStaff
            Call SendWhosStaff(Index)
            Exit Sub


Client Side:

Find:
Code:
Sub SendWhosOnline()
Dim Packet As String

    Packet = CWhosOnline & END_CHAR
    Call SendData(Packet)
End Sub


Above it add:
Code:
Sub SendWhosStaff()
Dim Packet As String

    Packet = CWhosStaff & END_CHAR
    Call SendData(Packet)
End Sub


Now Find:
Code:
CWhosOnline


Above it add:
Code:
CWhosStaff


Now find:
Code:
                ' Whos Online
                Case "/who"
                    SendWhosOnline


Above it add:
Code:
                ' Staff Online
                Case "/staff"
                    SendWhosStaff


And thats it. I hope you enjoyed it.... Yeah.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Sep 24, 2008 11:10 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
You should really try and do something from scratch.

It's alright to copy stuff, but then look through it and understand exactly how it works and repeat the steps to yourself. Like:

"Alright so this code loops through every player, checks their access, if it's greater than 0 blah blah blah"

Why do you think Elysium and rip offs of MS were so shitty? Because all they did was copy shit and didn't try to improve it and so on.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Sep 24, 2008 11:18 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
GIAKEN wrote:
You should really try and do something from scratch.

It's alright to copy stuff, but then look through it and understand exactly how it works and repeat the steps to yourself. Like:

"Alright so this code loops through every player, checks their access, if it's greater than 0 blah blah blah"

Why do you think Elysium and rip offs of MS were so shitty? Because all they did was copy shit and didn't try to improve it and so on.


Yeah, I know. But I'm horrible at coding from scratch, and I never really think of anything to code, until I see something like the whos online, and then, I think "hey, this would be a good basis for this". I'm new at this, and I don't really seem to be getting better at coding from scratch. I do understand how most of this works, I'm just not very creative.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Sep 24, 2008 11:22 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
It doesn't take creativity really...only when thinking of things to do.

Your creativity came into play with the command, then you decide how it should be done. Example: Player types /staff, send packet to server, server processes and does the loop through the accesses, put results in playermsg, done.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Sep 24, 2008 11:24 pm 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
This won't work in the latest version of MS4.


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Thu Sep 25, 2008 5:30 pm 
Offline
Banned
User avatar

Joined: Mon Jun 05, 2006 9:22 pm
Posts: 394
Location: USA
Change it so that when a staff member logs in their name is added to an array or something, then jsut grab from the array. MUCH faster than searching through every player. ;)


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 01, 2021 8:01 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruhttp://magnetotelluricfield.ruhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruинфоhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.rutaskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruсайтhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:07 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Econ


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:08 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
58.39


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:09 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Bett


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:10 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Bett


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:11 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Pass


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:12 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Dash


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:13 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
XVII


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:15 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Edit


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:16 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Sand


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:17 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
MPEG


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:18 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
SOCO


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:19 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Prem


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:20 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Clas


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:21 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Wind


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:22 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Turb


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:23 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Peer


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:25 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Loui


Top
 Profile  
 
 Post subject: Re: Staff Online Feature
PostPosted: Wed Dec 29, 2021 9:26 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489171
Deko


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1149 posts ]  Go to page 1, 2, 3, 4, 5 ... 46  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group