Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

2 questions


Necromancer
 Share

Recommended Posts

Is there a way to add a kill/death menu for a certain player? Like on the Online Players menu if you click on one player it will show their level kills/death?

Question 2:
Is there a way so that when it sends a packet it will send 3 instead of 1 that are closely named to the other one? Sorta like a hack tool thingy.
Link to comment
Share on other sites

Q1: Yes but from the beggining of the game you would have to LOG all kills and deaths.

OnDeathSub, increment an INI value
OnKillSub (or whatever it is), increment an INI value

btw, i'd recommend a custom menu instead of source; even though source is faster custom menu's are easier to alter.
custom menu retrieves values.

DONE.
Link to comment
Share on other sites

Ok, i'm finished.

Go into server.vbp
go into modgamelogic and search for
"If Damage >= GetPlayerHP(Victim) Then"
in subattackplayer

add right under this line:
```
Dim attkills As String
            Dim vicdeaths As String
            attkills = GetVar(App.Path & "\profiles\" & GetPlayerName(Attacker) & ".ini\", "Stats", "Kills")
            vicdeaths = GetVar(App.Path & "\profiles\" & GetPlayerName(Victim) & ".ini\", "Stats", "Deaths")
            Call PutVar(App.Path & "\profiles\" & GetPlayerName(Attacker) & ".ini\", "Stats", "Kills", attkills + 1)
            Call Putvar(App.Path & "\profiles\" & GetPlayerName(Victim) & ".ini\", "Stats", "Deaths", defdeaths + 1)

```
below the code
"If Map(GetPlayerMap(Victim)).Moral <> MAP_MORAL_NO_PENALTY Then"
in sub npcattackplayer
add
```
Dim vicdeaths As String
            vicdeaths = GetVar(App.Path & "\profiles\" & GetPlayerName(Victim) & ".ini\", "Stats", "Deaths")
            Call Puutvar(App.Path & "\profiles\" & GetPlayerName(Victim) & ".ini\", "Stats", "Deaths", defdeaths + 1)

```
add below the code "If Damage >= MapNPC(MapNum, MapNpcNum).HP Then"
in sub attacknpc
```
Dim attkills As String
            attkills = GetVar(App.Path & "\profiles\" & GetPlayerName(Attacker) & ".ini\", "Stats", "Kills")
            Call Putvar(App.Path & "\profiles\" & GetPlayerName(Attacker) & ".ini\", "Stats", "Deaths", attkills + 1)

```
Create a folder called "profiles" in your server.

Now the winsock.

in subhandledata
below the line "Select Case LCase$(Parse(0))"
add this case:
```
Case "getprofilestats"
            Dim deaths As String
            Dim kills As String
            deaths = GetVar(App.Path & "\profiles\" & Parse(1) & ".ini\", "Stats", "Deaths")
            kills = GetVar(App.Path & "\profiles\" & Parse(1) & ".ini\", "Stats", "Kills")
            Call SendDataToAll("playerstats" & SEP_CHAR & Parse(1) & SEP_CHAR & Parse(2) & SEP_CHAR & deaths & SEP_CHAR & kills & END_CHAR)
            Exit Sub
```
Thats the server….

the client!

in mod handle data below "casestring = LCase$(parse(0))"
add this:
```
If casestring = "playerstats" Then
        If parse(2) = GetPlayerName(MyIndex) Then
        frmMirage.playerprof.Visible = True
        frmMirage.lblprofiledeaths.Caption = parse(3)
        frmMirage.lblprofilekills.Caption = parse(4)
        frmMirage.lblstatplayer.Caption = parse(1)
        End If
    End If
```
now, to trigger and get a player's stats you use the code:
```
Call SendData("getprofilestats" & SEP_CHAR & *playeryouwanttogetstatsof* & SEP_CHAR & Getplayername(myindex) & END_CHAR)

```

In frmmirage of the client now add a picture box called "playerprof"
a label inside of it called "lblstatplayer"
another label called "lblprofilekills"
another called "lblprofiledeaths"

lblstatplayer is the name of the player you have stats on.
lblprofilekills are player kills
lblprofiledeaths are profile deaths
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...