• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Modern AAC] [Command] Adding Levels

Paxton

Banned User
Joined
Feb 23, 2008
Messages
4,110
Reaction score
48
Location
London, UK
This is how it works.

You put something like this /level Paxton,300 and it will give level 300 to Paxton, you put this in the command line below footer do not put this into the CMD line in admin panel, this is the wrong command line!

Create folder called level in: commands/scripts

inside this folder, create file called command.php and paste this there:

PHP:
<?php
	/*
	 * @description: Command for Modern AAC to add levels
	 * @author: Paxton
	 * @rev: 1.0
	*/
	
	$name = @$args[0];
	$level = @(int)$args[1];
	if(empty($name) || empty($level)) die('Two arguments are required.<br/>');
	$CI =& get_instance();
	$CI->load->database();
	$id = $CI->db->query("SELECT id FROM players WHERE name = \"".$name."\"")->result_array();
	if(empty($id)) die('Could not find character.<br/>');
	$CI->db->query("UPDATE players SET level = $level WHERE id = ".$id[0]['id']);
	die('Level '.$level.' has been given to '.ucwords($name).'<br/>');

Now open commands/commands.php

and paste this at the end:

PHP:
$commands['/level'] = array('access'=>5, 'path'=>'level/command.php');

Thats done, and now like I said in the command line below the footer, write something like: /level Paxton,350

You can set the access in commands.php to something different, default is admin.

Thanks
 
o, these are the commands you were talking about :D
 
As I saw that the script was not adding level, but for modifying the amount they arise.
I changed the line 15 to modify the level where it increases and does not change.
Example:
I have level 15 when you add another 15 will be 30.

Modify this in line 15:
PHP:
$CI->db->query("UPDATE players SET level = $level WHERE id = ".$id[0]['id']);
To:
PHP:
$CI->db->query("UPDATE `players` SET `level` = `level` + $level WHERE id = ".$id[0]['id']);

For added Magic Level
Modify this in line 15:
PHP:
`level` = `level`
To:
PHP:
`maglevel` = `maglevel`

Thanks PAXTON for Release ^^
 
Last edited:

Similar threads

Back
Top