[Release]Administrators- Generate NX ON demand
basically the generate nx script with the 24 hour thing editted out for admins to give players these codes when players earn it.
edit it a little with ur database stuffs, give credits, and were all happy.
Code:
<?php
include("top.php");
if($_SESSION['id']){ //take this line out if you dont require logging in to use this.
if($_SESSION['admin']){ //take this line out if you dont require people to login as an administator to use this.
/* ----------
WRITTEN BY MyEnterpriseAdmin
This script solution is for admins to generate nx codes on demand for their users.
Dont let your players get to this or they will get rich fast.
---------- */
/*DATABASE CONFIG: Please fill this out correctly or script will not work. */
$DB_host = ""; //Host; usually localhost
$DB_user = ""; //User
$DB_pass = ""; //Password
$DB_db = ""; // Database name
/*DATABASE CONNECT */
$connect = mysql_connect($DB_host,$DB_user,$DB_pass);
$db = mysql_select_db($DB_db);
extract($_GET); /*So we can use all GET variables without $_GET[] */
$IP = $_SERVER['REMOTE_ADDR'];
/* FUNCTION FOR GENERATING CODES
BY BAVILO FROM ODINMS.DE FORUMS */
function createNXCode() {
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 13) {
$num = rand() % 33;
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
/* MAIN PAGES */
switch($go)
{
case "give": /* Give them NX */
{
//Generate and give code
$code = createNXCode();
$ins = mysql_query('INSERT INTO nxcode (code, valid, type, item ) VALUES ("'.$code.'", "1", "3", "20000")') or die(mysql_error());
if($ins)
{
echo "Your code is: <font style='font-size:25px;'><b>$code</b></font>";
echo "<br>Write this down, and use this in the Cash Shop!<br>";
echo "<br>Or give it to a Account Holder if they purchased/earned Nexon Cash.<br>";
echo "<br>If you lost your code, use the MySQL command SELECT * FROM nxcode n; to view a list of all generated NX codes, and to see which ones are used, or just regenerate a code.<br>Script by MyEnterprise";
}
else
{
echo "Error generating NX code.";
}
}
break;
break;
default: /* Show the form here, etc. */
?>
<form action="<?=$PHP_SELF;?>?go=give" method="POST">
<input type='submit' value='Generate 20,000 NX Code'>
</form>
<?php
break;
}
}
}else{
echo "You are not logged in yet!";
}
include("end.php");
?>
Re: Administrators- Generate NX ON demand
Re: Administrators- Generate NX ON demand
nice release, useful, good job
Re: [Release]Administrators- Generate NX ON demand
Quote:
Originally Posted by
maplepuppet
Why did you come back to RageZone?
What kind of question is that?
Nice release by the way. It seems useful in the future when there are private servers like GMS.