51 lines
2.2 KiB
PHP
51 lines
2.2 KiB
PHP
<?
|
|
if(!defined('GAME'))
|
|
{
|
|
die();
|
|
}
|
|
|
|
if($p['sex']==1)
|
|
{
|
|
$uu = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['logingo']).'" LIMIT 1'));
|
|
if(isset($uu['id']))
|
|
{
|
|
if($uu['align']>1 && $uu['align']<2 && $u->info['admin']==0)
|
|
{
|
|
$uer = 'Âû íå ìîæåòå èñïîëüçîâàòü äàííîå çàêëÿòèå íà Ïàëàäèíîâ.<br>';
|
|
}elseif($uu['align']>3 && $uu['align']<4 && $u->info['admin']==0)
|
|
{
|
|
$uer = 'Âû íå ìîæåòå èñïîëüçîâàòü äàííîå çàêëÿòèå íà Òàðìàíîâ.<br>';
|
|
}elseif($uu['admin']>0 && $u->info['admin']==0)
|
|
{
|
|
$uer = 'Âû íå ìîæåòå íàêëàäûâàòü ñíÿòèå çàïðåòà ïåðåäà÷ íà Àíãåëîâ';
|
|
}elseif($uu['city']!=$u->info['city'] && $p['citym1']==0){
|
|
$uer = 'Ïåðñîíàæ íàõîäèòñÿ â äðóãîì ãîðîäå';
|
|
}elseif($uu['id']==$u->info['id'] && $u->info['admin']==0){
|
|
$uer = 'Âû íå ìîæåòå ñìåíèòü ïîë ñàìîìó ñåáå';
|
|
}else{
|
|
$usx = array(0=>1,1=>0,'0-0'=>'ìóæñêîé','0-1'=>'æåíñêèé');
|
|
$uu['sex'] = $usx[$uu['sex']];
|
|
$upd = mysql_query('UPDATE `users` SET `obraz` = "0.gif",`sex` = "'.$uu['sex'].'" WHERE `id` = "'.$uu['id'].'" LIMIT 1');
|
|
if($upd)
|
|
{
|
|
$sx = '';
|
|
if($u->info['sex']==1)
|
|
{
|
|
$sx = 'à';
|
|
}
|
|
$rtxt = '[img[items/male.png]] '.$rang.' "'.$u->info['cast_login'].'" ñìåíèë'.$sx.' ïîë ïåðñîíàæà "'.$uu['login'].'" íà '.$usx['0-'.$uu['sex']].'';
|
|
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");
|
|
$rtxt = $rang.' "'.$u->info['login'].'" ñìåíèë'.$sx.' ïîë ñïåðñîíàæà íà '.$usx['0-'.$uu['sex']].'.';
|
|
mysql_query("INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".$uu['id']."','".$_SERVER['REMOTE_ADDR']."','".$u->info['city']."','".time()."','".$rtxt."','".$u->info['login']."',0)");
|
|
$uer = 'Âû óñïåøíî ñìåíèëè ïîë ïåðñîíàæà "'.$uu['login'].'" íà '.$usx['0-'.$uu['sex']].'.';
|
|
}else{
|
|
$uer = 'Íå óäàëîñü èñïîëüçîâàòü äàííîå çàêëÿòèå';
|
|
}
|
|
}
|
|
}else{
|
|
$uer = 'Ïåðñîíàæ íå íàéäåí â ýòîì ãîðîäå';
|
|
}
|
|
}else{
|
|
$uer = 'Ó Âàñ íåò ïðàâ íà èñïîëüçîâàíèå äàííîãî çàêëÿòèÿ';
|
|
}
|
|
?>
|