Print Page | Close Window

Jail System

Printed From: Mirage Source
Category: Tutorials
Forum Name: Temporary Archive (Read Only)
Forum Discription: Temporary 3.0.3 archive tutorials, will be deleted when converted.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=183
Printed Date: 20 December 2006 at 5:53pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Jail System
Posted By: Sync
Subject: Jail System
Date Posted: 11 February 2006 at 3:20pm
[size=18px>JAIL SYSTEM
[size=9px]/jail <playername> command

i dunno who create this code  :shock:

::::::::::::::::
::::CLIENT::::
::::::::::::::::
Add this code at the bottom of modclienttcp


Sub JailPlayer(ByVal Name As String)
Dim Packet As String

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


Modgamelogic


             ' Jailing Player
             If LCase(Mid(MyText, 1, 5)) = "/jail" Then
                 If Len(MyText) > 6 Then
                 MyText = Mid(MyText, 7, Len(MyText) - 6)
                 Call JailPlayer(MyText)
                 End If
                 MyText = ""
                 Exit Sub
             End If

:::::::::::::::
:::SERVER:::
:::::::::::::::

HandleData :


    ' ::::::::::::::::::::::::
    ' :: Jail player packet ::
    ' ::::::::::::::::::::::::
    If LCase(Parse(0)) = "jailplayer" Then
    Dim m As String
    
    ' Prevent hacking
    If GetPlayerAccess(Index) < ADMIN_MAPPER Then
        Call HackingAttempt(Index, "Admin Cloning")
    Exit Sub
    End If

    ' Find the map number and player to jail
    N = FindPlayer(Parse(1))
    m = 100 ' Map number......
    X = 5     ' X of that map
    Y = 4     ' Y of that map


    ' Send the message that player has been jailed
    If Not Trim(GetPlayerName(N)) = "GameMaster" Then
    If N <> Index Then
    If N > 0 Then
        Call PlayerWarp(N, m, X, Y)
        Call PlayerMsg(N, "You have been jailed by " & GetPlayerName(Index) & ".", Black)
        Call GlobalMsg(GetPlayerName(N) & " has been jailed by " & GetPlayerName(Index) & ".", Black)
        Call AddLog(GetPlayerName(Index) & " has jailed " & GetPlayerName(N) & GetPlayerMap(Index) & ".", ADMIN_LOG)
    Else
        Call PlayerMsg(Index, "Player is not online.", Black)
    End If
    Else
        Call PlayerMsg(Index, "You cannot jail yourself!", Black)
    End If
    Else
        Call PlayerMsg(Index, "You cannot jail GameMaster!", Black)
    End If
       
  Exit Sub
End If


guess that is done  :P[size=18px]



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info