You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
|
|
<?php
|
|
|
|
|
|
|
|
require 'required.php';
|
|
|
|
require 'onlyloggedin.php';
|
|
|
|
|
|
|
|
$itemuuid = $VARS['itemuuid'];
|
|
|
|
$player = $VARS['giveto'];
|
|
|
|
|
|
|
|
if (is_empty($itemuuid) || !is_numeric($itemuuid) || !$database->has('inventory', ["AND" => ['itemuuid' => $itemuuid, 'playeruuid' => $_SESSION['uuid']]])) {
|
|
|
|
sendError(INVALID_ITEMID, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_empty($player) || !$database->has('players', ['nickname' => $player])) {
|
|
|
|
sendError(INVALID_NICKNAME, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
$playeruuid = $database->select('players', ['uuid'], ['nickname' => $player])[0]['uuid'];
|
|
|
|
|
|
|
|
|
|
|
|
$database->update('inventory', ['playeruuid' => $playeruuid], ['itemuuid' => $itemuuid]);
|
|
|
|
|
|
|
|
sendOK();
|