- Joined
- Feb 3, 2010
- Messages
- 429
- Reaction score
- 81
Незнам изобщо на някой дали ще му трябва, но на мен ми дотрябва, защото немога да си fix Server Files Модула е както в Самото Mu избираш кой искаш,ако си ГМ(GuildMaster) и ти го маха от Guild-a, ако не си GM ти дава само себе си да махнеш
Модула е тестван само от мен Играчите още не са го пробвали, но мисля че работи идеално
Модула е тестван само от мен Играчите още не са го пробвали, но мисля че работи идеално
PHP:
<?
if (eregi(".php", $_SERVER['SCRIPT_NAME'])) { header("Location: ../index.php"); }
//start checksymbols function
function checksymbols($string)
{
$length=strlen($string);
for($i=0;$i<=$length-1;$i++){
if (!((($string[$i]>='a')&&($string[$i]<='z'))||(($string[$i]>='A')&&($string[$i]<='Z'))||(($string[$i]>='0')&&($string[$i]<='9'))||($string[$i]=='-')||($string[$i]=='_'))){
$result=1;
}
}
return $result;
}
//end checksymbols function
$account=htmlspecialchars(trim($_SESSION['Username']), ENT_QUOTES);
//start Get Character function
if (!(isset($_POST['select']))){
$character=$_SESSION['selectedchar'];
}
else{
$character=htmlspecialchars(trim($_POST['select']), ENT_QUOTES);
$_SESSION['selectedchar']=$character;
}
//end Get Character function
//start Delete Guild Function
if (isset($_POST['DeleteFromGuild'])){
$char=htmlspecialchars(trim($_POST['DropChar']), ENT_QUOTES);
$guild=mssql_fetch_row(mssql_query("Select G_Name From GuildMember Where Name='$character'"));
$guildmembers=mssql_query("Select G_Master From Guild Where G_Name='$guild[0]'");
$gm=mssql_fetch_row($guildmembers);
if ($gm[0]!=$char){
$delete=mssql_query("Delete From GuildMember Where Name='$char'");
}
else{
$delete=mssql_query("Delete From GuildMember Where G_Name='$guild[0]'");
$delete1=mssql_query("Delete From Guild Where G_Master='$char'");
}
}
//end Delete Guild Function
//start Select Character
$char=mssql_fetch_row(mssql_query("Select GameID1,GameID2,GameID3,GameID4,GameID5 From AccountCharacter Where id='$account'"));
$selectedchar=$_SESSION['selectedchar'];
echo'
<form name="Character" method="Post">
<label for="select">Character</label>
<select onchange="this.form.submit();" name="select" id="select">
';
$guild1=mssql_fetch_row(mssql_query("Select G_Name From GuildMember Where Name='$selectedchar'"));
if (!(isset($selectedchar))){$selectedchar="Select Character";}
echo"<option value='$selectedchar'>$selectedchar</option>";
for($i=0;$i<=5;$i++){
$guild=mssql_fetch_row(mssql_query("Select G_Name From GuildMember Where Name='$char[$i]'"));
if ((!empty($char[$i]))&&(!empty($guild[0]))){
echo"<option value='$char[$i]'>$char[$i] [Guild: $guild[0]]</option>";
}
}
echo'
</select><br>
</form>
';
//end Select Character
//start main function
$guild=mssql_fetch_row(mssql_query("Select G_Name From GuildMember Where Name='$character'"));
$guildmaster=mssql_fetch_row(mssql_query("Select G_Master From Guild Where G_Name='$guild[0]'"));
$onlinecheck=mssql_fetch_row(mssql_query("Select ConnectStat From MEMB_STAT Where memb___id='$account'"));
$checkchar=mssql_fetch_row(mssql_query("Select AccountID From Character Where Name='$character'"));
//start Errors
$error=0;
if (!isset($_SESSION['selectedchar'])){echo"xaa";
$error=1;
}
elseif (empty($guild[0])){
echo"<p class='red'>No Guild</p>";
$error=1;
}
elseif (checksymbols($character)==1){
echo"<pre class='red'>Use Only Numbers or Letters!</pre>";
$error=1;
}
elseif ($onlinecheck[0]!=0){
echo "<pre class='red'>Your Account is Online!</pre>";
$error=1;
}
elseif ($checkchar[0]!=$account){
echo "<p class='red'>This isn't your Character!</p>";
$error=1;
}
//end Errors
if($error!=1){
//start Choose Character For Drop
if ($guildmaster[0]==$character){
$guildmembers=mssql_query("Select Name From GuildMember Where G_Name='$guild[0]'");
echo"<form method='Post' name='LeaveGuild'><table>
<tr><th>#</th><th>Character Name</th><th>Choose</th></tr>";
for ($i=0;$i<mssql_num_rows($guildmembers);$i++){
$gm=mssql_fetch_row($guildmembers);
$numb=$i+1;
echo"<tr><td>$numb</td><td>$gm[0]</td><td><input type='radio' value='$gm[0]' name='DropChar'/></td></td>";
}
echo"</table>
<input type='submit' name='DeleteFromGuild' value='Drop'/>
</form>";
}
else{
$guildmembers=mssql_query("Select Name From GuildMember Where G_Name='$guild[0]'");
echo"<form method='Post' name='LeaveGuild'><table>
<tr><th>#</th><th>Character Name</th><th>Choose</th></tr>";
for ($i=0;$i<mssql_num_rows($guildmembers);$i++){
$gm=mssql_fetch_row($guildmembers);
$numb=$i+1;
echo"<tr><td>$numb</td><td>$gm[0]</td><td>";if ($gm[0]==$character){echo"<input type='radio' value='$gm[0]' name='DropChar'/></td></td>";}
}
echo"</table>
<input type='submit' name='DeleteFromGuild' value='Drop'/>
</form>";
}
//end Choose Character For Drop
}
//end main function
?>
Last edited: