Jump to content
MakeWebGames

why dont i get any events when sending crystals or money?


Recommended Posts

Posted

Crystals:

 

<?php
include "globals.php";
$_GET['ID'] = abs(intval($_GET['ID']));
if(!$set['sendcrys_on'])
{
die("Sorry, the game owner has disabled this feature.");
}
$_GET['ID'] = abs((int) $_GET['ID']);
$_POST['crystals'] = abs((int) $_POST['crystals']);
if(!((int)$_GET['ID']))
{
print "<font color=white>Invalid User ID";
}
else if($_GET['ID'] == $userid)
{
print "<font color=white>Haha, what does sending knifes to yourself do anyway?";
}
else
{
if((int) $_POST['crystals'])
{
if($_POST['crystals'] > $ir['crystals'])
{
print "<censored>ing die abuser.";
}
else
{
$db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid=$userid");
$db->query("UPDATE users SET crystals=crystals+{$_POST['crystals']} WHERE userid={$_GET['ID']}");
print "You sent {$_POST['crystals']} knifes to ID {$_GET['ID']}.";
event_add($_GET['ID'],"You received {$_POST['crystals']} knifes from {$ir['username']}.",$c);
$it=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}");
$er=$db->fetch_row($it);
$db->query("INSERT INTO crystalxferlogs VALUES ('', $userid, {$_GET['ID']}, {$_POST['crystals']}, unix_timestamp(), '{$ir['lastip']}', '{$er['lastip']}')");
}
}
else
{
print "<h1> <font color=white>Sending Knifes</h1>
<font color=white>You are sending knifes to ID: [b]{$_GET['ID']}[/b].

<font color=white>You have [b]".number_format($ir['crystals'])."[/b] knifes you can send.
<form action='sendknifes.php?ID={$_GET['ID']}' method='post'>
<font color=white>Knifes: <input type='text' name='crystals' />

<input type='submit' value='Send' /></form>";
print "<h1><font color=white>Latest 5 Transfers</h1>
<table width=75% border=2> <tr style='background:gray'>  <th>Time</th> <th>User From</th> <th>User To</th> <th>Amount</th> </tr>";
$q=$db->query("SELECT cx.*,u1.username as sender, u2.username as sent FROM crystalxferlogs cx LEFT JOIN users u1 ON cx.cxFROM=u1.userid LEFT JOIN users u2 ON cx.cxTO=u2.userid WHERE cx.cxFROM=$userid ORDER BY cx.cxTIME DESC LIMIT 5");
while($r=$db->fetch_row($q))
{
if($r['cxFROMIP'] == $r['cxTOIP']) { $m="<span style='color:red;font-weight:800'>MULTI</span>"; } else { $m=""; }
print "<tr> <td>" . date("F j, Y, g:i:s a",$r['cxTIME']) . "</td><td>{$r['sender']} [{$r['cxFROM']}] </td><td>{$r['sent']} [{$r['cxTO']}] </td> <td> {$r['cxAMOUNT']} knifes</td> </tr>";
}
print "</table>";
}
}
$h->endpage();
?>

 

Cash:

 

<?php
include "globals.php";
$_GET['ID'] = abs(intval($_GET['ID']));
$_GET['ID'] = abs((int) $_GET['ID']);
$_POST['money'] = abs((int) $_POST['money']);
if(!((int)$_GET['ID']))
{
print "<font color=white>Invalid User ID</font>";
}
else if($_GET['ID'] == $userid)
{
print "<font color=white>Haha, what does sending money to yourself do anyway?</font>";
}
else
{
if((int) $_POST['money'])
{
if($_POST['money'] > $ir['money'])
{
print "<font color=white><censored>ing die abuser.</font>";
}
else
{
$db->query("UPDATE users SET money=money-{$_POST['money']} WHERE userid=$userid");
$db->query("UPDATE users SET money=money+{$_POST['money']} WHERE userid={$_GET['ID']}");
print "You sent \${$_POST['money']} to ID {$_GET['ID']}.";
event_add($_GET['ID'],"You received \${$_POST['money']} from {$ir['username']}.",$c);
$it=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}");
$er=$db->fetch_row($it);
$db->query("INSERT INTO cashxferlogs VALUES ('', $userid, {$_GET['ID']}, {$_POST['money']}, unix_timestamp(), '{$ir['lastip']}', '{$er['lastip']}')");
}
}
else
{
print "<h1><font color=white>Sending Money</h1>
You are sending money to ID: [b]{$_GET['ID']}[/b].

You have [b]\$".number_format($ir['money'])."[/b] you can send.
<form action='sendcash.php?ID={$_GET['ID']}' method='post'>
Amnt: <input type='text' name='money' />

<input type='submit' value='Send' /></form>";
print "<h3>Latest 5 Transfers</h3>
<table width=75% border=2> <tr style='background:gray'>  <th>Time</th> <th>User From</th> <th>User To</th> <th>Amount</th> </tr>";
$q=$db->query("SELECT cx.*,u1.username as sender, u2.username as sent FROM cashxferlogs cx LEFT JOIN users u1 ON cx.cxFROM=u1.userid LEFT JOIN users u2 ON cx.cxTO=u2.userid WHERE cx.cxFROM=$userid ORDER BY cx.cxTIME DESC LIMIT 5");
while($r=$db->fetch_row($q))
{
if($r['cxFROMIP'] == $r['cxTOIP']) { $m="<span style='color:red;font-weight:800'>MULTI</span>"; } else { $m=""; }
print "<tr> <td>" . date("F j, Y, g:i:s a",$r['cxTIME']) . "</td><td>{$r['sender']} [{$r['cxFROM']}] </td><td>{$r['sent']} [{$r['cxTO']}] </td> <td> \${$r['cxAMOUNT']}</td> </tr>";
}
print "</table>";
}
}
$h->endpage();
?>

 

can anyone please recode them so it would send out a event of how much u got?

thanks Nicholas

Posted

Re: why dont i get any events when sending crystals or money?

To add an even you'll need to look up the function "event_add()"

make sure you fill it with the correct parameters and you'll be fine! This function can be found in the global_func.php file

You'll have to add the line somewhere in the success field of your processing.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...