-
Notifications
You must be signed in to change notification settings - Fork 0
/
money4wote.php
52 lines (37 loc) · 1.5 KB
/
money4wote.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
################################
##### Êîíôèãóðàöèÿ ñêðèïòà #####
################################
$config['db_host'] = 'localhost';
$config['db_user'] = 'craftconomy';
$config['db_pass'] = '1234';
$config['db_name'] = 'craftconomy';
$config['db_table'] = 'cc3_balance';
$config['economy_type'] = 'craftconomy3';
$config['secret_word'] = '1234'; //Äîëæíî ñîâïàäàòü ñ ïîëåì 'ñåêðåòíîå ñëîâî' â ïðîôèëå MCTop
$config['pay_amount'] = 500;
######################################
##### Äàëüøå ÍÈ×ÅÃÎ íå ìåíÿòü!!! #####
######################################
$player = trim($_GET['player']);
$hash = trim($_GET['hash']);
$realhash = md5($config['secret_word'].$player);
if ($hash != $realhash) {
die('Access denied!');
}
$link = mysql_connect($config['db_host'], $config['db_user'], $config['db_pass']) or die('error:1.1');
mysql_select_db($config['db_name']) or die('error:1.2');
switch ($config['economy_type']) {
default: die('error:2.1'); break;
case 'iconomy':
$sql = 'UPDATE `'.trim($config['db_table']).'` SET `balance` = `balance` + \''.intval($config['pay_amount']).'\' WHERE `username` = \''.strtolower($player).'\'';
mysql_query($sql);
break;
case 'craftconomy3':
$sql = 'UPDATE `'.trim($config['db_table']).'` SET `balance` = `balance` + \''.intval($config['pay_amount']).'\' WHERE `username_id` = (SELECT `id` FROM `cc3_account` WHERE `name` = \''.strtolower($player).'\')';
mysql_query($sql);
break;
}
mysql_close();
echo 'ok';
?>