public static function cmdUnsuspend(Player $player, $numparams, $params) { if (!Admin::CheckLevel($player, ADMIN_OPERATOR)) { return COMMAND_OK; } $acc = DB::GetAccount($params[1], 'name', 'id,banned'); if ($acc == null) { $player->Send(COLOR_ACCOUNT_NOTFOUND, '[ERROR] Account not found'); return COMMAND_OK; } else { if ($acc['banned'] == null) { $player->Send(COLOR_ACCOUNT_NOTBANNED, '[ERROR] Given account is not suspended'); return COMMAND_OK; } } $data = array(); $data['id'] = $acc['id']; $data['banned'] = null; $data['banned_by'] = null; $data['ban_date'] = null; $data['ban_expiration'] = null; DB::SaveAccount($data); Admin::Send(COLOR_UNSUSPEND, "[UNSUSPEND] {$player->name} unsuspended the account '{$params[1]}'"); Log::Append(LOG_ADMIN, "[{$player->id}] {$player->name} unsuspended '{$params[1]}'"); return COMMAND_OK; }
public static function OnPlayerConnect($playerid) { $player = Players::FindByID($playerid); if ($player == null) { return CALLBACK_BREAK; } $data = DB::GetAccount($player->name); if ($data == null) { $player->Send(COLOR_YELLOW, '[ACCOUNT REGISTRATION REQUIRED]'); $player->Send(COLOR_RED, '* Your name is not registered at ItalyMafia.'); $player->Send(COLOR_RED, '* If you want to create a new account visit'); $player->Send(COLOR_RED, '* http://panel.mafiaroleplay.net'); $player->Kick(); return CALLBACK_BREAK; } else { if ($data['banned'] != null) { if (time() < $data['ban_expiration']) { $datestr = date('r', $data['ban_expiration']); $player->Kick("* You are banned until {$datestr}: {$data['banned']}"); return CALLBACK_BREAK; } else { /* Ban expired */ $unban['id'] = $data['id']; $data['banned'] = null; $unban['banned'] = null; $data['banned_by'] = null; $unban['banned_by'] = null; $data['ban_date'] = null; $unban['ban_date'] = null; $data['ban_expiration'] = null; $unban['ban_expiration'] = null; DB::SaveAccount($unban); } } } $player->Send(COLOR_YELLOW, '* This account is registered. If it is your account then type'); $player->Send(COLOR_YELLOW, '* \'/login your_password\'. You have two minutes to login.'); $player->account = new Account($player, $data); }