Доработка AloneIslands.ru

Gangstar

Новичок
Репутация
0 / 51
Елочка *wink*
Скрипт выдает подарки методом Random, Это означает то что как повезет так повезет =)
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><center>
<img src='images/elka.gif' border="0" />

<input type=button onClick="location='main.php?year=1'" style='width: 150;' value="Получить Подарок" title="Чтоб получить подарок, нажмите на кнопку" class=login>


<?
if ($year=='1')
{
$podarok = rand(1,3);
if ($podarok=='1')
{
$pod = '`inv`=CONCAT("'.$pers['inv'].'","bot_nap=2=|bot_nap=2=|bot_nap=2=|bot_nap=2=|bot_nap=2=|bot_nap=2=|bot_nap=2
=|bot_nap=2=|bot_nap=2=|")';
$msg = 'Приманку для Ботов 9 шт.';
}
else if ($podarok=='2')
{
$pod = '`dmoney`='.$pers['dmoney'].'+"29"';
$msg = '29 у.е';
}
else if ($podarok=='3')
{
$pod = '`money`='.$pers['money'].'+"2009"';
$msg = '2009 LM';
}
if ($pers['podarok']=='0')
{
mysql_query ("UPDATE `users` SET ".$pod." , `podarok` = '1' WHERE `user`='".$pers["user"]."'");
echo"<font color=green>Администрация Last-World поздравляет Вас с Новым годом, желает Вам благополучия и вручает подарок :)

Вы получили в подарок: ".$msg."
</font>";
}
else
{
echo"<font color=red>Вы уже получили подарок</font>";
}
}
?>
</center></div>

P.S. Для работы скрипта вам надо создать в ДБ новую запись для даного скрипта надо Поле=podarok , Тип=int , Длины/Значения=11 , По умолчанию=0

Природа!
Ну че погнали...


Вот скрипт работающей природы(Вертикаль горизонталь диагональ)
Для работы всей природы надо зделать следуйщее
Открываем "inc/goloc.php"
Шаг 1
И меняем это
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$up = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".$x."_".($y-1)."_'"));
$down = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".$x."_".($y+1)."_'"));
$right = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x+1)."_".($y)."_'"));
$left = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x-1)."_".($y)."_'"));
if (@$up["name"]) $up = 1; else $up=0;
if (@$down["name"]) $down = 1; else $down=0;
if (@$right["name"]) $right = 1; else $right=0;
if (@$left["name"]) $left = 1; else $left=0;
if ($_GET["go_nature"]=='down' and $down==1) $y+=1;
if ($_GET["go_nature"]=='up' and $up==1) $y-=1;
if ($_GET["go_nature"]=='left' and $left==1) $x-=1;
if ($_GET["go_nature"]=='right' and $right==1) $x+=1;</div>
На это
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$up = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".$x."_".($y-1)."_'"));
$down = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".$x."_".($y+1)."_'"));
$right = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x+1)."_".($y)."_'"));
$left = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x-1)."_".($y)."_'"));
$lup = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x-1)."_".($y-1)."_'"));
$rup = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x+1)."_".($y-1)."_'"));
$rdown = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x+1)."_".($y+1)."_'"));
$ldown = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x-1)."_".($y+1)."_'"));
if (@$up["name"]) $up = 1; else $up=0;
if (@$down["name"]) $down = 1; else $down=0;
if (@$right["name"]) $right = 1; else $right=0;
if (@$left["name"]) $left = 1; else $left=0;
if (@$lup["name"]) $lup = 1; else $lup=0;
if (@$rup["name"]) $rup = 1; else $rup=0;
if (@$rdown["name"]) $rdown = 1; else $rdown=0;
if (@$ldown["name"]) $ldown = 1; else $ldown=0;
if ($_GET["go_nature"]=='up' and $up==1) $y-=1;
if ($_GET["go_nature"]=='down' and $down==1) $y+=1;
if ($_GET["go_nature"]=='left' and $left==1) $x-=1;
if ($_GET["go_nature"]=='right' and $right==1) $x+=1;
if ($_GET["go_nature"]=='lup' and $lup==1) $x-=1;
if ($_GET["go_nature"]=='rup' and $rup==1) $x+=1;
if ($_GET["go_nature"]=='lup' and $lup==1) $y-=1;
if ($_GET["go_nature"]=='rup' and $rup==1) $y-=1;
if ($_GET["go_nature"]=='rdown' and $rdown==1) $x+=1;
if ($_GET["go_nature"]=='ldown' and $ldown==1) $x-=1;
if ($_GET["go_nature"]=='rdown' and $rdown==1) $y+=1;
if ($_GET["go_nature"]=='ldown' and $ldown==1) $y+=1;</div>

Шаг 2

Открываем "js/nature.js"
И меняем это
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>function show_nature(x,y,up,down,right,left){
if (up==1) up = 'onclick = "location=\'main.php?go_nature=up\'" style=\'cursor:hand\'';
if (down==1) down = 'onclick = "location=\'main.php?go_nature=down\'" style=\'cursor:hand\'';
if (left==1) left = 'onclick = "location=\'main.php?go_nature=left\'" style=\'cursor:hand\'';
if (right==1) right = 'onclick = "location=\'main.php?go_nature=right\'" style=\'cursor:hand\'';
document.write('<table border="0" cellspacing="0" cellpadding="0" style="border-style: solid; border-width: 1px"> <tr> <td width="60" height="60"background="../images/map/'+(x-3)+'_'+(y-2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-2)+'_'+(y-2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-1)+'_'+(y-2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+0)+'_'+(y-2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+1)+'_'+(y-2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+2)+'_'+(y-2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+3)+'_'+(y-2)+'.jpg"> </td> </tr> <tr> <td width="60" height="60"background="../images/map/'+(x-3)+'_'+(y-1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-2)+'_'+(y-1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-1)+'_'+(y-1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+0)+'_'+(y-1)+'" '+up+'> </td> <td width="60" height="60"background="../images/map/'+(x+1)+'_'+(y-1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+2)+'_'+(y-1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+3)+'_'+(y-1)+'.jpg"> </td> </tr> <tr> <td width="60" height="60"background="../images/map/'+(x-3)+'_'+(y-0)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-2)+'_'+(y-0)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-1)+'_'+(y-0)+'" '+left+'> </td> <td width="60" height="60"background="../images/map/'+(x+0)+'_'+(y-0)+'" class=fader> </td> <td width="60" height="60"background="../images/map/'+(x+1)+'_'+(y-0)+'" '+right+'> </td> <td width="60" height="60"background="../images/map/'+(x+2)+'_'+(y-0)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+3)+'_'+(y-0)+'.jpg"> </td> </tr> <tr> <td width="60" height="60"background="../images/map/'+(x-3)+'_'+(y+1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-2)+'_'+(y+1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-1)+'_'+(y+1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+0)+'_'+(y+1)+'" '+down+'> </td> <td width="60" height="60"background="../images/map/'+(x+1)+'_'+(y+1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+2)+'_'+(y+1)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+3)+'_'+(y+1)+'.jpg"> </td> </tr> <tr> <td width="60" height="60"background="../images/map/'+(x-3)+'_'+(y+2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-2)+'_'+(y+2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x-1)+'_'+(y+2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+0)+'_'+(y+2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+1)+'_'+(y+2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+2)+'_'+(y+2)+'.jpg"> </td> <td width="60" height="60"background="../images/map/'+(x+3)+'_'+(y+2)+'.jpg"> </td> </tr></table>');</div>На это
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>function show_nature(x,y,up,down,right,left,c1,c2,c3,c4,f,fc){
if (f!='') f=' style="cursor:hand" title="'+f+'" '+fc;
if (up==1) up = 'class=go_yes title=Переход... onclick = "location=\'main.php?go_nature=up\'" style=\'cursor:hand\'';
if (down==1) down = 'class=go_yes title=Переход... onclick = "location=\'main.php?go_nature=down\'" style=\'cursor:hand\'';
if (left==1) left = 'class=go_yes title=Переход... onclick = "location=\'main.php?go_nature=left\'" style=\'cursor:hand\'';
if (right==1) right = 'class=go_yes title=Переход... onclick = "location=\'main.php?go_nature=right\'" style=\'cursor:hand\'';
if (c1==1) c1 = 'class=go_yes title=Переход... onclick = "location=\'main.php?go_nature=lup\'" style=\'cursor:hand\'';
if (c2==1) c2 = 'class=go_yes title=Переход... onclick = "location=\'main.php?go_nature=rup\'" style=\'cursor:hand\'';
if (c3==1) c3 = 'class=go_yes title=Переход... onclick = "location=\'main.php?go_nature=rdown\'" style=\'cursor:hand\'';
if (c4==1) c4 = 'class=go_yes title=Переход... onclick = "location=\'main.php?go_nature=ldown\'" style=\'cursor:hand\'';
document.write('<table border="0" cellspacing="0" cellpadding="0" style="border-style: solid; border-width: 1px">
<tr> <td width="80" height="80">
'+(x-3)+'_'+(y-2)+'.png
</td> <td width="80" height="80">
'+(x-2)+'_'+(y-2)+'.png
</td><td width="80" height="80">
'+(x-1)+'_'+(y-2)+'.png
</td><td width="80" height="80">
'+(x+0)+'_'+(y-2)+'.png
</td> <td width="80" height="80">
'+(x+1)+'_'+(y-2)+'.png
</td> <td width="80" height="80">
'+(x+2)+'_'+(y-2)+'.png
</td> <td width="80" height="80">
'+(x+3)+'_'+(y-2)+'.png
</td> </tr> <tr> <td width="80" height="80">
'+(x-3)+'_'+(y-1)+'.png
</td> <td width="80" height="80">
'+(x-2)+'_'+(y-1)+'.png
</td> <td width="80" height="80">
'+(x-1)+'_'+(y-1)+'.png
</td> <td width="80" height="80">
'+(x+0)+'_'+(y-1)+'.png
</td> <td width="80" height="80">
'+(x+1)+'_'+(y-1)+'.png
</td> <td width="80" height="80">
'+(x+2)+'_'+(y-1)+'.png
</td> <td width="80" height="80">
'+(x+3)+'_'+(y-1)+'.png
</td> </tr> <tr> <td width="80" height="80">
'+(x-3)+'_'+(y-0)+'.png
</td> <td width="80" height="80">
'+(x-2)+'_'+(y-0)+'.png
</td> <td width="80" height="80">
'+(x-1)+'_'+(y-0)+'.png
</td> <td width="80" height="80" '+f+'>
'+(x+0)+'_'+(y-0)+'.png
</td> <td width="80" height="80">
'+(x+1)+'_'+(y-0)+'.png
</td> <td width="80" height="80">
'+(x+2)+'_'+(y-0)+'.png
</td> <td width="80" height="80">
'+(x+3)+'_'+(y-0)+'.png
</td> </tr>
<tr> <td width="80" height="80">
'+(x-3)+'_'+(y+1)+'.png
</td> <td width="80" height="80">
'+(x-2)+'_'+(y+1)+'.png
</td> <td width="80" height="80">
'+(x-1)+'_'+(y+1)+'.png
</td> <td width="80" height="80">
'+(x+0)+'_'+(y+1)+'.png
</td> <td width="80" height="80">
'+(x+1)+'_'+(y+1)+'.png
</td> <td width="80" height="80">
'+(x+2)+'_'+(y+1)+'.png
</td> <td width="80" height="80">
'+(x+3)+'_'+(y+1)+'.png
</td> </tr> <tr> <td width="80" height="80">
'+(x-3)+'_'+(y+2)+'.png
</td> <td width="80" height="80">
'+(x-2)+'_'+(y+2)+'.png
</td> <td width="80" height="80">
'+(x-1)+'_'+(y+2)+'.png
</td> <td width="80" height="80">
'+(x+0)+'_'+(y+2)+'.png
</td> <td width="80" height="80">
'+(x+1)+'_'+(y+2)+'.png
</td> <td width="80" height="80">
'+(x+2)+'_'+(y+2)+'.png
</td> <td width="80" height="80">
'+(x+3)+'_'+(y+2)+'.png
</td> </tr></table>');
}</div>
Обратите внимание на формат файла и размер рисунка! Поменяйте на свои если это требуеться!

Шаг 3

Открываем "inc/locations/out.php"
И меняем это
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$up = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".$x."_".($y-1)."_'"));
$down = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".$x."_".($y+1)."_'"));
$right = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x+1)."_".($y)."_'"));
$left = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x-1)."_".($y)."_'"));
if (@$up["name"] and $t>=$pers["waiter"]) $up = 1; else $up=0;
if (@$down["name"] and $t>=$pers["waiter"]) $down = 1; else $down=0;
if (@$right["name"] and $t>=$pers["waiter"]) $right = 1; else $right=0;
if (@$left["name"] and $t>=$pers["waiter"]) $left = 1; else $left=0;</div>
и это
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>show_nature(<?= $x;?>,<?=$y;?>,<?=$up;?>,<?=$down;?>,<?=$right;?>,<?=$left;?>);</div>
на это
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$up = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".$x."_".($y-1)."_'"));
$down = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".$x."_".($y+1)."_'"));
$right = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x+1)."_".($y)."_'"));
$left = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x-1)."_".($y)."_'"));
$lup = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x-1)."_".($y-1)."_'"));
$rup = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x+1)."_".($y-1)."_'"));
$rdown = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x+1)."_".($y+1)."_'"));
$ldown = mysql_fetch_array (mysql_query("SELECT name FROM locations WHERE id='p_".($x-1)."_".($y+1)."_'"));
if (@$up["name"] and $t>=$pers["waiter"]) $up = 1; else $up=0;
if (@$down["name"] and $t>=$pers["waiter"]) $down = 1; else $down=0;
if (@$right["name"] and $t>=$pers["waiter"]) $right = 1; else $right=0;
if (@$left["name"] and $t>=$pers["waiter"]) $left = 1; else $left=0;
if (@$lup["name"] and $t>=$pers["waiter"]) $lup = 1; else $lup=0;
if (@$rup["name"] and $t>=$pers["waiter"]) $rup = 1; else $rup=0;
if (@$rdown["name"] and $t>=$pers["waiter"]) $rdown = 1; else $rdown=0;
if (@$ldown["name"] and $t>=$pers["waiter"]) $ldown = 1; else $ldown=0;</div>
и это
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>show_nature(<?= $x;?>,<?=$y;?>,<?=$up;?>,<?=$down;?>,<?=$right;?>,<?=$left;?>,<?=$lup;?>,<?=$rup;?>,<?=$rdown;?>,<?=$ldown;?>);</div>

Шаг 4

Делаем чтоб были выдны места прохадимости!
Открываем "main.css"
И в самом конце скрипта встоавляем это.
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>.go_yes {
filter:alpha(opacity=85);
-moz-opacity: 0.85;
-khtml-opacity: 0.85;
opacity: 0.85;
}</div>

На этом мой гид завершон!
P.S. На забываем о спасибо *wink*
 
зачем стока запросов в базу?
это же нагрузка хорошая причем
 
И в прямь лучше через IN выбрать
 
зачем стока запросов в базу?
это же нагрузка хорошая причем
Это идет проверка перехода ну другую локацию!
Ну имееться в виду можно туда пройти или та локация не создана
 
кто может поестнить концепцию алхима и шахтерства?)
 
походу это можно запостить на говнокод ру, там много подобных шмериковских штук хD
 
Сверху