Well, i did the following
Searched for
function onUse()
{
global $db_prefix, $ID_MEMBER, $item_info;
And replaeced it with
function onUse()
{
global $db_prefix, $ID_MEMBER, $item_info, $context;
Then searched for
if ($steal_amount < 50) {
And after that i added
// Who the IM will come from
$pmfrom = array(
'id' => 1071,
'name' => 'Chorineita',
'username' => 'Chorineita'
);
// Who the IM is going to
$pmto = array(
'to' => array($_POST['stealfrom']),
'bcc' => array()
);
// The subject of the message
$subject = 'You Got robbed';
// The actual message contents
$message = 'The user <b>' . $context['user']['name'] . '</b> robbed you, less than 50 points! Youu got lucky blablabla';
// Now, send!
sendpm($pmto, $subject, $message, 0, $pmfrom);
Then right before the other Return line or after
}
else {
I added practically the same
// Who the IM will come from
$pmfrom = array(
'id' => 1071,
'name' => 'Chorineita',
'username' => 'Chorineita'
);
// Who the IM is going to
$pmto = array(
'to' => array($_POST['stealfrom']),
'bcc' => array()
);
// The subject of the message
$subject = 'You Got screwed!';
// The actual message contents
$message = 'The user <b>' . $context['user']['name'] . '</b> robbed you big time! blablabla';
// Now, send!
sendpm($pmto, $subject, $message, 0, $pmfrom);
And finally i added another PM, to alert the user that someone has tried to rob him, but he didint succeed!
Search for
// If reducing Karma doesn't work, replace
// 'karmaBad = karmaBad + 10' with 'karmaGood = karmaGood - 10'
$result = db_query("
UPDATE {$db_prefix}members
SET karmaBad = karmaBad + 10
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
And right after that i added!
// Who the IM will come from
$pmfrom = array(
'id' => 1071,
'name' => 'Chorineita',
'username' => 'Chorineita'
);
// Who the IM is going to
$pmto = array(
'to' => array($_POST['stealfrom']),
'bcc' => array()
);
// The subject of the message
$subject = 'someone is trying to rob you!';
// The actual message contents
$message = 'The user <b>' . $context['user']['name'] . '</b> is trying to rob you! blablabla';
// Now, send!
sendpm($pmto, $subject, $message, 0, $pmfrom);
You have to sepcify the data on the part
$pmfrom = array(
'id' => 1071,
'name' => 'Chorineita',
'username' => 'Chorineita'
);
You could (i guess, im not sooo sure though), change the values with
$pmfrom = array(
'id' => 1,
'name' => 'Admin',
'username' => 'Admin'
);
I took the code frome another item and then changed it a bit, so that it could work with the steal.php item... it worked for me!