예제 #1
0
         $cmdInfo['_cmd'] = $result['cmd'];
         /**
          * Send it and execute the command if possible
          * 
          * Also checks if cmd != false, cmd==false means it's only the prefix
          * e.g. !
          */
         if ($cmdInfo['cmd'] != false && !empty($cmdInfo['cmd'])) {
             $igc->executeCommand($cmdInfo);
         }
     } else {
         /**
          * Send response => Not enough rights
          */
         $igc->logCmd($cmdInfo);
         $ct->send(' ' . $cmdInfo['origin']['name'] . ' , you haven\'t got enough rights to use command: ' . $pieces[0]);
     }
 } else {
     /**
      * Send response => Command not found / disabled
      * 
      * Uncomment this if you want, it's running fine, but because
      * you probably run ModManager IGA and this tool at the same time
      * it's not really handy...
      * 
      * e.g. Modmanager uses !k to kick, this tool will display 'Command !k does not exist [...]'
      * or if the commands are the same, the command will be executed twice
      */
     //$igc->logCmd($cmdInfo);
     //$ct->send('Command |ccc| ' . $pieces[0]  . ' |ccc| does not exist or the command has been disabled!');
 }
예제 #2
0
     }
     break;
     /**
      * Send servermessage
      */
 /**
  * Send servermessage
  */
 case 'sendSrvMsg':
     if (isset($_POST['vars']['msg']) && !empty($_POST['vars']['msg'])) {
         if ($userInfo['rights_server'] == 'yes') {
             // Connect to server
             $rc->connect($cn, $cs);
             $cn = $rc->init();
             if ($cn) {
                 $ct->send($_POST['vars']['msg']);
                 $response['status'] = 'OK';
                 $response['msg'] = $lang['tool_server_msg_sent'];
                 $log->insertActionLog($userInfo['user_id'], 'Sent servermessage: ' . $_POST['vars']['msg']);
             } else {
                 $response['msg'] = $lang['msg_serverdown'] . ' ' . date($settings['cp_date_format_full'], $settings['server_last_stream']);
             }
         } else {
             $response['msg'] = $lang['msg_cmd_noaccess'];
         }
     } else {
         $response['msg'] = $lang['msg_cmd_missingvars'];
     }
     break;
     /**
      * Delete from in-game commands
예제 #3
0
        }
        // END WEAPONS
    }
    // END PLAYER
    /**
     * IN-GAME ADMIN MESSAGES
     * 
     * - Displays a message with the currently in-game admins
     */
    if ($settings['tool_am'] > 0 && time() - $settings['tool_am_last'] >= $settings['tool_am']) {
        if (count($admins) > 0) {
            $message = replace($settings['tool_am_msg'], array('%admins%' => implode(', ', $admins)));
        } else {
            $message = replace($settings['tool_am_msg_alt']);
        }
        $ct->send($message);
        updateSetting('tool_am_last', time());
    }
    /**
     * THE SMALL ADVERTISMENT
     * I would really appreciate it if you enable this! :3
     */
    if ($settings['iga_ad'] > 0 && time() - $settings['iga_ad_last'] >= $settings['iga_ad']) {
        $ct->send(replace($settings['iga_ad_msg']));
        updateSetting('iga_ad_last', time());
    }
    /**
     * Display message
     */
    die('[' . date($settings['cp_date_format_full']) . '] Executed' . PHP_EOL);
} else {