示例#1
0
 function toPlayer($payerLogin, $payeeLogin, $amount)
 {
     if ($payerLogin == $payeeLogin) {
         $this->connection->chatSendServerMessage('$F00You can\'t give planets to yourself', $payerLogin, true);
         return;
     }
     try {
         Validation::int($amount, 0);
     } catch (\Exception $e) {
         $this->connection->chatSendServerMessage('$F00The amount is incorrect', $payerLogin, true);
         return;
     }
     $billId = $this->connection->sendBill($payerLogin, (int) $amount, $payerLogin . 'To' . $payeeLogin, $payeeLogin);
     $this->connection->chatSendServerMessage('The bill has been created with the id ' . $billId, $payerLogin, true);
 }
 function decreasePlayerPenalty($playerLogin, $by, $lobbyLogin, $scriptName, $titleIdString)
 {
     \ManiaLive\Utilities\Validation::int($by);
     $result = $this->db->execute('UPDATE PlayersPenalties ' . 'SET secondsLeft = (CASE WHEN secondsLeft > %1$d THEN secondsLeft - %1$d ELSE 0 END) ' . 'WHERE playerLogin = %2$s ' . 'AND lobbyLogin = %3$s ' . 'AND scriptName = %4$s ' . 'AND titleIdString = %5$s', $by, $this->db->quote($playerLogin), $this->db->quote($lobbyLogin), $this->db->quote($scriptName), $this->db->quote($titleIdString));
 }