From bbe1dab25c22e90fc9e7f378f3c112c5e1e2c9da Mon Sep 17 00:00:00 2001 From: artemuhi Date: Thu, 21 Mar 2024 22:33:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20pointsystemlib.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pointsystemlib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pointsystemlib.php b/pointsystemlib.php index c4ad890..159a252 100644 --- a/pointsystemlib.php +++ b/pointsystemlib.php @@ -50,9 +50,11 @@ function rmpoint($name, $point, $reason="", $force=false) { } function paypoint($byname, $toname, $point, $reason="") { $db = loaddb(); - if ($db["points"][$byname]>=$point and $point>0) { + if (($db["points"][$byname]>=$point and $point>0) and isset($db["points"][$byname], $db["points"][$toname])) { $db["points"][$byname] -= $point; $db["points"][$toname] += $point; + $db["logs"][$byname][] = date(DATE_RFC822) . ": Pay to" . $toname . ": " . $reason; + $db["logs"][$toname][] = date(DATE_RFC822) . ": Pay from" . $byname . ": " . $reason; savedb($db); return true; } else {