Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP][KO Panel] Restat Script (SNOXDKO)

Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
I've used the same description/introduction as in the Nation Transfer topic since incase others didn't read both topics etc.

Due to the panel being totally re-written, I've decided to release some of the older scripts from the SnoxdKO Panel. By common request I've began with Nation Transfer and Character Restat(Which will be posted momentarily).
All I ask is that the credits in the title are left intact, or the releases will stop.

There's a few things for example Killing connected users which can't be released as they communicate with another application which currently is private.
Also, you'll need to remove the logging unless you're gonna reproduce the table (I'll post the SQL for it here, later).

Both scripts are 100% as were used on SnoxdKO (I haven't modified any of it, including the comments)

Anyway, enjoy:

PHP:
<?php 
// Restat - Not really commented it much atm - I'll finish commenting later.
require('./anti_inject.php');
require('./kill_user.php');

parth1tr();
parth1('100%', 2, 'center');
echo 'Character Restat - Beta - by BlaDe @ Snoxd.net';
parth2();
parth2tr();
//ini_set('error_reporting', '1');
//ini_set('display_errors', '1');

if (isset($_SESSION['sesuser'])) {
    if ($_GET['Confirmed'] == 1) {
        $user = trim($_POST['Character']);
        $stat = trim($_POST['stat']);
        $user = test($user);
        $stat = test($stat);
        $connect = odbc_connect($dbname, $dbuser, $dbpass);

        $query = "SELECT COUNT(*) FROM RESTAT_LOG WHERE DATEDIFF(hh,[Date],GETDATE()) < 24 AND AccountID = '" . $_SESSION['sesuser'] . "'";
        $results = odbc_exec($connect, $query);
        while (odbc_fetch_row($results)) {
            $logcheck = odbc_result($results, 1);
        } 
        if ($logcheck > 0) {
            part1('100%', 1, 1, 'center');
            echo '</br>You may only use this feature once every 24hours.';
            echo '</br></br><a href="./index.php">Back</a></br>';
            part2();
            die();
        } 
        $getuser = "SELECT strCharID FROM CURRENTUSER where strAccountID = '" . $_SESSION['sesuser'] . "'";
        $getusere = odbc_exec($connect, $getuser);
        $characterID = odbc_result($getusere, 1);

        if (strlen(trim($characterID)) > 0) {
            $killed = 1;
            KillUserAndWait(trim($characterID), $connect);
        } 
        if (strlen($user) == 0) {
            part1('100%', 1, 1, 'center');
            echo '</br>You\'r Character was invalid!';
            echo '</br></br><a href="./index.php">Back</a></br>';
            part2();
            die();
        } 

        if (strlen($stat) == 0) {
            part1('100%', 1, 1, 'center');
            echo '</br>You havn\'t selected a basic stat point!';
            echo '</br></br><a href="./index.php">Back</a></br>';
            part2();
            die();
        } 
        // Anti SQL Inject poop - I'm not sure if it's even possible to manipulate the values of a combo
        // However - I'd personally rather not risk it.
        // Get the current stats n race ;o
        $query = "SELECT Strong, Cha, Dex, Intel, Sta, Points, Race, Gold, strItem FROM USERDATA WHERE strUserID ='" . $user . "'";
        $results = odbc_exec($connect, $query);
        while (odbc_fetch_row($results)) {
            $str = odbc_result($results, 1);
            $mp = odbc_result($results, 2);
            $dex = odbc_result($results, 3);
            $int = odbc_result($results, 4);
            $hp = odbc_result($results, 5);
            $rem = odbc_result($results, 6);
            $race = odbc_result($results, 7);
            $cash = odbc_result($results, 8);
            $items = odbc_result($results, 9);
        } 
        if ($cash < 500000000) {
            part1('100%', 1, 1, 'center');
            echo '</br>You havn\'t got enough money!';
            echo '</br>You must have 500 Million GP in your inventory.';
            echo '</br></br><a href="./index.php">Back</a></br>';
            part2();
            die();
        } 
     //    lame slow method by Goat
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

TY for this also.
 
Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

CREATE TABLE [dbo].[RESTAT_LOG] (
[Date] [datetime] NOT NULL ,
[AccountID] [char] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[CharID] [char] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Strong] [tinyint] NOT NULL ,
[Cha] [tinyint] NOT NULL ,
[Dex] [tinyint] NOT NULL ,
[Intel] [tinyint] NOT NULL ,
[Sta] [tinyint] NOT NULL ,
[Points] [tinyint] NOT NULL ,
[OldGold] [int] NOT NULL ,
[NewGold] [int] NOT NULL
) ON [PRIMARY]
GO

The table used.
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

I having problems with this script..

Its saying to my users, they dont have characters above level 70, But infact they do..

Thanks for any help..
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

Fixed 100%

Code:
<?php 
// Restat - Not really commented it much atm - I'll finish commenting later.
require('./anti_inject.php');

parth1tr();
parth1('100%', 2, 'center');
echo 'Character Restat';
parth2();
parth2tr();
//ini_set('error_reporting', '1');
//ini_set('display_errors', '1');

if (isset($_SESSION['sesuser'])) {
    if ($_GET['Confirmed'] == 1) {
        $user = trim($_POST['Character']);
        $stat = trim($_POST['stat']);
        $user = test($user);
        $stat = test($stat);
        $connect = odbc_connect($dbname, $dbuser, $dbpass);

        $query = "SELECT COUNT(*) FROM RESTAT_LOG WHERE DATEDIFF(hh,[Date],GETDATE()) < 24 AND AccountID = '" . $_SESSION['sesuser'] . "'";
        $results = odbc_exec($connect, $query);
        while (odbc_fetch_row($results)) {
            $logcheck = odbc_result($results, 1);
        } 
        if ($logcheck > 0) {
            part1('100%', 1, 1, 'center');
            echo '</br>You may only use this feature once every 24hours.';
            echo '</br></br><a href="./index.php">Back</a></br>';
            part2();
            die();
        } 
        $getuser = "SELECT strCharID FROM CURRENTUSER where strAccountID = '" . $_SESSION['sesuser'] . "'";
        $getusere = odbc_exec($connect, $getuser);
        $characterID = odbc_result($getusere, 1);

        if (strlen(trim($characterID)) > 0) {
            $killed = 1;
            KillUserAndWait(trim($characterID), $connect);
        } 
        if (strlen($user) == 0) {
            part1('100%', 1, 1, 'center');
            echo '</br>You\'r Character was invalid!';
            echo '</br></br><a href="./index.php">Back</a></br>';
            part2();
            die();
        } 

        if (strlen($stat) == 0) {
            part1('100%', 1, 1, 'center');
            echo '</br>You havn\'t selected a basic stat point!';
            echo '</br></br><a href="./index.php">Back</a></br>';
            part2();
            die();
        } 
        // Anti SQL Inject poop - I'm not sure if it's even possible to manipulate the values of a combo
        // However - I'd personally rather not risk it.
        // Get the current stats n race ;o
        $query = "SELECT Strong, Cha, Dex, Intel, Sta, Points, Race, Gold, strItem FROM USERDATA WHERE strUserID ='" . $user . "'";
        $results = odbc_exec($connect, $query);
        while (odbc_fetch_row($results)) {
            $str = odbc_result($results, 1);
            $mp = odbc_result($results, 2);
            $dex = odbc_result($results, 3);
            $int = odbc_result($results, 4);
            $hp = odbc_result($results, 5);
            $rem = odbc_result($results, 6);
            $race = odbc_result($results, 7);
            $cash = odbc_result($results, 8);
            $items = odbc_result($results, 9);
        } 
        if ($cash < 500000000) {
            part1('100%', 1, 1, 'center');
            echo '</br>You havn\'t got enough money!';
            echo '</br>You must have 500 Million GP in your inventory.';
            echo '</br></br><a href="./index.php">Back</a></br>';
            part2();
            die();
        } 
     //    lame slow method by Goat
 
Last edited:
Newbie Spellweaver
Joined
Sep 21, 2007
Messages
12
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

The bug with this is you can restat with your armor or weapon on... The one I made does an inventory check and makes you put everything in the warehouse. Now my only bug is the items that you can't put in the warehouse. I could do a further check on the item numbers to allow in your inventory to restat. I didnt look over you code too well but make sure uses can't lower a starting stat value to use the points in another. like making your int 10.
 
Experienced Elementalist
Loyal Member
Joined
Jun 11, 2006
Messages
214
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

hmm getting action not found Error
Action not found, Please click here
 
Last edited:
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

Moderator should remove advocates link, as its advertising his KO server.

This is just a redirect to his KO panel..
 
Experienced Elementalist
Loyal Member
Joined
Jun 11, 2006
Messages
214
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

wasnt meaning to do that was showing what happen after you restat what came up zzzz like i care if my server is showed rather not keeps hackers and dupers out .
there i edited my post happy now instead of bitching about my link how do we solve my problem.
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

wasnt meaning to do that was showing what happen after you restat what came up zzzz like i care if my server is showed rather not keeps hackers and dupers out .
there i edited my post happy now instead of bitching about my link how do we solve my problem.


Yup, same rule applys for everyone else I jusy simpily made an observation no need to be nasty about it, was I?

For your problem.


You need to put the Restat.php script in your Functions folder.

You need to edit user.php

PHP:
} elseif ($_GET['actu'] == "Restat") {
            $security = 1;
            include("./Restat.php");
        }


You need to Edit skins/default/Main.php (2 Places)

1st
PHP:
<div>
 
Experienced Elementalist
Loyal Member
Joined
Jun 11, 2006
Messages
214
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

Yup, same rule applys for everyone else I jusy simpily made an observation no need to be nasty about it, was I?

For your problem.


You need to put the Restat.php script in your Functions folder.

You need to edit user.php

PHP:
} elseif ($_GET['actu'] == "Restat") {
            $security = 1;
            include("./Restat.php");
        }


You need to Edit skins/default/Main.php (2 Places)

1st
PHP:
<div>• <a href="index.php?act=user&actu=Restat">Restat</a></div>

2nd
PHP:
<div>• <a href="index.php?act=user&actu=Restat">Restat</a></div>

However alough this script works, there is some bugs.

Not all users can use this script successfully.

Some mages, some priests try to use it and it has no effect..

And BTW it does have a check if you are wearing armours so Ignore 'cherry' said.

i did all that and still Error
Action not found, Please click here
the select character comes slect main stat click contune and the get the error page not found
 
Newbie Spellweaver
Joined
Oct 8, 2006
Messages
17
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

I having problems with this script..

Its saying to my users, they dont have characters above level 70, But infact they do..

Thanks for any help..

im getting this same problem and im using the corrections that you posted lollipop... how do you fix this?
 
Experienced Elementalist
Loyal Member
Joined
Jun 11, 2006
Messages
214
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

place the restat.php in your main www dir.
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

place the restat.php in your main www dir.

Like I said, it works only for some people..

e.g rogues, warriors..

Some priests and mages cannot use it, I looked but cannot see why..
 
Initiate Mage
Joined
Dec 24, 2007
Messages
3
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

where can i get kill_user.php and if i remove the declaration i got "action not found " error.
 
Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
Re: [Share][PHP][KO Panel] Restat Script (SNOXDKO)

change

$getuser = "SELECT strCharID FROM CURRENTUSER where strAccountID = '" . $_SESSION['sesuser'] . "'";
$getusere = odbc_exec($connect, $getuser);
$characterID = odbc_result($getusere, 1);

if (strlen(trim($characterID)) > 0) {
$killed = 1;
KillUserAndWait(trim($characterID), $connect);
}

in the condition you should die() because it wont take effect if the user is logged in.
BUT that shouldn't cause that issue, it sounds like you've done your link to the script wrong. Put this script into the root directory and link to it by ?act=restat (assuming its called restat.php)
 
Back
Top