game/_incl_data/class/magic/addmoney.php
2022-06-07 00:30:34 +03:00

54 lines
2.7 KiB
PHP

<?
if(!defined('GAME'))
{
die();
}
if( $itm['magic_inci'] == 'addmoney' ) {
if( $u->info['align'] != 2 ) {
if( $itm['4price'] > 0 ) {
$u->info['money4'] += $itm['4price'];
mysql_query('UPDATE `users` SET `money4` = `money4` + "'.$itm['4price'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}elseif( $itm['2price'] > 0 ) {
$u->info['money2'] += $itm['2price'];
mysql_query('UPDATE `users` SET `money2` = `money2` + "'.$itm['2price'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}elseif( $itm['1price'] > 0 ) {
$u->info['money'] += $itm['1price'];
mysql_query('UPDATE `users` SET `money` = `money` + "'.$itm['1price'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}elseif( $itm['price4'] > 0 ) {
$u->info['money4'] += $itm['price4'];
mysql_query('UPDATE `users` SET `money4` = `money4` + "'.$itm['price4'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}elseif( $itm['price2'] > 0 ) {
$u->info['money2'] += $itm['price2'];
mysql_query('UPDATE `users` SET `money2` = `money2` + "'.$itm['price2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}elseif( $itm['price1'] > 0 ) {
$u->info['money'] += $itm['price1'];
mysql_query('UPDATE `users` SET `money` = `money` + "'.$itm['price1'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}
//
if( $itm['4price'] > 0 ) {
$u->error = 'Âû óñïåøíî îáíàëè÷èëè ÷åê íà '.$u->zuby($itm['4price'],1).'';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
}elseif( $itm['2price'] > 0 ) {
$u->error = 'Âû óñïåøíî îáíàëè÷èëè ÷åê íà '.$itm['2price'].' åêð.';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
}elseif( $itm['1price'] > 0 ) {
$u->error = 'Âû óñïåøíî îáíàëè÷èëè ÷åê íà '.$itm['1price'].' êð.';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
}elseif( $itm['price4'] > 0 ) {
$u->error = 'Âû óñïåøíî îáíàëè÷èëè ÷åê íà '.$u->zuby($itm['price4'],1).'';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
}elseif( $itm['price2'] > 0 ) {
$u->error = 'Âû óñïåøíî îáíàëè÷èëè ÷åê íà '.$itm['price2'].' åêð.';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
}elseif( $itm['price1'] > 0 ) {
$u->error = 'Âû óñïåøíî îáíàëè÷èëè ÷åê íà '.$itm['price1'].' êð.';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
}else{
$u->error = 'Áàãîâûé ÷åê! Íàïèøèòå Àäìèíèñòðàöèè!';
}
}else{
$u->error = 'Õàîñíèêè íå ìîãóò îáíàëè÷èâàòü ÷åê!';
}
}
?>