Имаш ли такъв модул ? ако имаш ми пиши на скайп : sharky_971 да ми го дадеш ако може и ще ти кажа колко точки да сложиш
<?php
$query = mssql_query('SELECT Class FROM Character WHERE Name="' . $character_name . '"');
$row = mssql_fetch_row($query);
switch($row[0])
{
case 0:
case 1:
$points_per_reset=900; // dw,sm
break;
case 16:
case 17:
$points_per_reset=800; // dk,bk
break;
case 32:
case 33:
$points_per_reset=700; // elf,me
break;
case 48:
$points_per_reset=600; // mg
break;
case 64:
$points_per_reset=500; // dl
break;
}
PHP:<?php $query = mssql_query('SELECT Class FROM Character WHERE Name="' . $character_name . '"'); $row = mssql_fetch_row($query); switch($row[0]) { case 0: case 1: $points_per_reset=900; // dw,sm break; case 16: case 17: $points_per_reset=800; // dk,bk break; case 32: case 33: $points_per_reset=700; // elf,me break; case 48: $points_per_reset=600; // mg break; case 64: $points_per_reset=500; // dl break; }
Tова ти е бърза конфигурация. Дай самата функция трябва да е нещо като това://Web Config
$pkclearmoney = '0'; // PK CLEAR MONEY
$resetlevel = '330'; // RESET LEVEL
$resetpoints = '550'; // RESET POINTS
$resettype = 'reset'; // RESET TYPE keep/bonus/reset
$resetmoney = '0'; // RESET MONEY
$maxresets = '100'; //MAX RESETS
$maxlevel = '350'; // MAX LEVEL
$resetclearinv = 'no'; // ClEAR INVENTORY yes/no
$resetclearskill = 'no'; // CLEAR SKILLS yes/no
$maxstats = '32767'; //MAX STATS
Как да я вкарам по точно ? пробвах като я поставих под тези и нищо не стана :\
function reset_character(){
blablalbal
}
<?
include "../config.php";
$character = secure($_POST['char']);
$account = secure($_SESSION['user']);
check_inject();
global $resetlevel;
global $resettype;
global $resetpoints;
global $resetmoney;
global $maxresets;
$charq = mssql_query("Select clevel,leveluppoint,money,Resets from Character where name='$character'");
$char = mssql_fetch_row($charq);
$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }
$newresets = $char[3] + 1;
$newmoney = $char[2] - $resetmoney * $char[3];
$newpoints = $newresets * $resetpoints;
$moneyforres = $resetmoney * $newresets;
if(empty($character)) { echo"<tr><td align='center' color='red'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] < $resetlevel) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got $resetlevel to reset !</td></tr>"; $error=1; }
if($char[2] < $moneyforres) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to reset !</td></tr>"; $error=1; }
if($newresets > $maxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character have reached the maximum resets !</td></tr>"; $error=1; }
if($error != 1) {
echo"<tr><td align='center' color='green'><span class='online'>Character $character has successfuly reset !</span></td></tr>";
if($resettype == keep) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'");}
elseif($resettype == bonus) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");}
elseif($resettype == reset) {$mssql = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',Money='$newmoney',clevel='1',Experience='0',LevelUpPoint='$newpoints', Resets='$newresets' where name='$character'");}
}}
?>
<?
include "../config.php";
$character = secure($_POST['char']);
$account = secure($_SESSION['user']);
check_inject();
global $resetlevel;
global $resettype;
global $resetpoints;
global $resetmoney;
global $maxresets;
//new
$novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' AccountID='$account'"));
//new
$charq = mssql_query("Select clevel,leveluppoint,money,Resets from Character where name='$character'");
$char = mssql_fetch_row($charq);
$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }
$newresets = $char[3] + 1;
$newmoney = $char[2] - $resetmoney * $char[3];
$newpoints = $newresets * $resetpoints;
$moneyforres = $resetmoney * $newresets;
//new
if($novaclass == 0 or 1) { $resetpoints = 500;} // Reset points for SM
if($novaclass == 16 or 17) {$resetpoints = 650;} // Reset points for BK
if($novaclass == 32 or 33) {$resetpoints = 480;} // Reset points for Elf
if($novaclass == 48) {$resetpoints = 820;} // Reset points for Magic Gladiator
if($novaclass == 64) {$resetpoints = 920;} // Reset points for Dark Lord
//new
if(empty($character)) { echo"<tr><td align='center' color='red'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] < $resetlevel) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got $resetlevel to reset !</td></tr>"; $error=1; }
if($char[2] < $moneyforres) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to reset !</td></tr>"; $error=1; }
if($newresets > $maxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character have reached the maximum resets !</td></tr>"; $error=1; }
if($error != 1) {
echo"<tr><td align='center' color='green'><span class='online'>Character $character has successfuly reset !</span></td></tr>";
if($resettype == keep) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'");}
elseif($resettype == bonus) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");}
elseif($resettype == reset) {$mssql = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',Money='$newmoney',clevel='1',Experience='0',LevelUpPoint='$newpoints', Resets='$newresets' where name='$character'");}
}}
?>
Mисля, че трябва да стане така:
Поправете ме, ако грешаPHP:<?php include "../config.php"; $character = secure($_POST['char']); $account = secure($_SESSION['user']); check_inject(); global $resetlevel; global $resettype; global $resetpoints; global $resetmoney; global $maxresets; //new $novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' AccountID='$account'")); //new $charq = mssql_query("Select clevel,leveluppoint,money,Resets from Character where name='$character'"); $char = mssql_fetch_row($charq); $statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'"); $statusa = mssql_num_rows($statusaq); if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); } $newresets = $char[3] + 1; $newmoney = $char[2] - $resetmoney * $char[3]; $newpoints = $newresets * $resetpoints; $moneyforres = $resetmoney * $newresets; //new // if($novaclass == 0 or 1) if($novaclass == 0 or $novaclass == 1) { $resetpoints = 500;} // Reset points for SM if($novaclass == 16 or $novaclass == 17) {$resetpoints = 650;} // Reset points for BK if($novaclass == 32 or $novaclass == 33) {$resetpoints = 480;} // Reset points for Elf if($novaclass == 48) {$resetpoints = 820;} // Reset points for Magic Gladiator if($novaclass == 64) {$resetpoints = 920;} // Reset points for Dark Lord //new if(empty($character)) { echo"<tr><td align='center' color='red'><b>Error:</b> Please select Character !</td></tr>"; $error=1; } else{ if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; } if($char[0] < $resetlevel) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got $resetlevel to reset !</td></tr>"; $error=1; } if($char[2] < $moneyforres) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to reset !</td></tr>"; $error=1; } if($newresets > $maxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character have reached the maximum resets !</td></tr>"; $error=1; } if($error != 1) { echo"<tr><td align='center' color='green'><span class='online'>Character $character has successfuly reset !</span></td></tr>"; if($resettype == keep) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'");} elseif($resettype == bonus) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");} elseif($resettype == reset) {$mssql = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',Money='$newmoney',clevel='1',Experience='0',LevelUpPoint='$newpoints', Resets='$newresets' where name='$character'");} }} ?>
//new
$novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' AccountID='$account'"));
//new
//new
$novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' [COLOR="Red"]and[/COLOR] AccountID='$account'"));
//new
Не знам.. При мен работи и без "and".трябва да еCode://new $novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' AccountID='$account'")); //new
на пръв поглед това ми направи впечатлениеCode://new $novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' [COLOR="Red"]and[/COLOR] AccountID='$account'")); //new
Aми изтрий го от там това $resetpoints = '550'; // RESET POINTS
* и в функцията global $resetpoints;
<?php
include "../config.php";
$character = secure($_POST['char']);
$account = secure($_SESSION['user']);
check_inject();
global $resetlevel;
global $resettype;
//global $resetpoints;
global $resetmoney;
global $maxresets;
$charq = mssql_query("Select clevel,leveluppoint,money,Resets,Class from Character where name='$character'");
$char = mssql_fetch_row($charq);
switch($char[4])
{
case 0:
case 1:
$resetpoints=900; // dw,sm
break;
case 16:
case 17:
$resetpoints=800; // dk,bk
break;
case 32:
case 33:
$resetpoints=700; // elf,me
break;
case 48:
$resetpoints=600; // mg
break;
case 64:
$resetpoints=500; // dl
break;
}
$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }
$newresets = $char[3] + 1;
$newmoney = $char[2] - $resetmoney * $char[3];
$newpoints = $newresets * $resetpoints;
$moneyforres = $resetmoney * $newresets;
if(empty($character)) { echo"<tr><td align='center' color='red'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] < $resetlevel) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got $resetlevel to reset !</td></tr>"; $error=1; }
if($char[2] < $moneyforres) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to reset !</td></tr>"; $error=1; }
if($newresets > $maxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character have reached the maximum resets !</td></tr>"; $error=1; }
if($error != 1) {
echo"<tr><td align='center' color='green'><span class='online'>Character $character has successfuly reset !</span></td></tr>";
if($resettype == keep) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'");}
elseif($resettype == bonus) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");}
elseif($resettype == reset) {$mssql = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',Money='$newmoney',clevel='1',Experience='0',LevelUpPoint='$newpoints', Resets='$newresets' where name='$character'");}
}}
?>
function reset_character()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);
check_inject();
global $resetlevel;
global $resettype;
global $resetpoints;
global $resetmoney;
global $maxresets;
$charq = mssql_query("Select clevel,leveluppoint,money,Resets from Character where name='$character'");
$char = mssql_fetch_row($charq);
$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }
$newresets = $char[3] + 1;
$newmoney = $char[2] - $resetmoney * $char[3];
$newpoints = $newresets * $resetpoints;
$moneyforres = $resetmoney * $newresets;
if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] < $resetlevel) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got $resetlevel to reset !</td></tr>"; $error=1; }
if($char[2] < $moneyforres) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to reset !</td></tr>"; $error=1; }
if($newresets > $maxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character have reached the maximum resets !</td></tr>"; $error=1; }
if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character has successfuly reset !</span></td></tr>";
if($resettype == keep) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'");}
elseif($resettype == bonus) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");}
elseif($resettype == reset) {$mssql = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',Money='$newmoney',clevel='1',Experience='0',LevelUpPoint='$newpoints', Resets='$newresets' where name='$character'");}
}}}