![]() |
|
|
|
#1
|
||||
|
||||
|
A mod I'm using, which includes a change in cash, is reporting an error;
Fatal error: Call to undefined function changecash() in /home/u973139355/public_html/slotmachine.php on line 51 The line in question is: Code:
changecash($reward, $GLOBALS['username'], $GLOBALS['money']); Code:
<?php
include("functions/functions.php");
//***************//
// START SCRIPT //
//***************//
if($isloggedin == "yes"){
// If we are logged in, we check if a user with our username voted for this adoptable today...
// Adoptable is not frozen, end isfrozen else check
$act = $_GET['act'];
if($act == 'confirm'){
$slot1 = rand(1,6);
$slot2 = rand(1,6);
$slot3 = rand(1,6);
$slot4 = rand(1,6);
$slot5 = rand(1,6);
$slot6 = rand(1,6);
if($slot1 == 1 && $slot2 == 1 && $slot3 == 1 && $slot4 == 1 && $slot5 == 1 && $slot6 == 1){
$reward = 10;
}elseif($slot1 == 2 && $slot2 == 2 && $slot3 == 2 && $slot4 == 1 && $slot5 == 1 && $slot6 == 1){
$reward = 20;
}elseif($slot1 == 3 && $slot2 == 3 && $slot3 == 3 && $slot4 == 1 && $slot5 == 1 && $slot6 == 1){
$reward = 30;
}elseif($slot1 == 4 && $slot2 == 4 && $slot3 == 4 && $slot4 == 4 && $slot5 == 4 && $slot6 == 4){
$reward = 40;
}elseif($slot1 == 5 && $slot2 == 5 && $slot3 == 5 && $slot4 == 5 && $slot5 == 5 && $slot6 == 5){
$reward = 50;
}elseif($slot1 == 6 && $slot2 == 6 && $slot3 == 6 && $slot4 == 6 && $slot5 == 6 && $slot6 == 6){
$reward = 60;
}elseif($slot1 == 1 && $slot2 == 2 && $slot3 == 3 && $slot4 == 4 && $slot5 == 5 && $slot6 == 6){
$reward = 100;
}else{
$reward = 0;
}
if($reward > 1){
$rewardmessage = "Congratulations, you have gained ".$reward." ". grabanysetting('cost') ."!";
}else{
$rewardmessage = "Sorry, you didnt win a prize this time, try again later.";
}
changecash($reward, $GLOBALS['username'], $GLOBALS['money']);
$article_content = $article_content . "<div align='center'><br /><img src='".$slot1.".png'><img src='".$slot2.".png'><img src='".$slot3.".png'><br />".$rewardmessage."<br />You now have {$GLOBALS['money']} ".grabanysetting('cost')."</div>";
}
else{
$article_title = "Slot Machine!";
$article_content = "Welcome at the slot machine!, here you can win various prizes!<br /><br /><a href='slotmachine.php?act=confirm'>Use the slot machine!</a>";
}
}
else{
$article_title = "Sorry!";
$article_content = "Sorry, as a guest you cant use the slotmachine!, please register or log in.";
}
// End the ID is not blank and is numeric else check
//***************//
// OUTPUT PAGE //
//***************//
echo showpage($article_title, $article_content, $date);
?>
__________________
|
|
#2
|
||||
|
||||
|
I am pretty sure the changecash() function is located in file functions_users.php, you need to include this library file.
__________________
![]() Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
|
#3
|
||||
|
||||
|
oohhhh... darn it, that was probably it. I'll go change that and see if it works.
EDIT: That works... thanks for your help again. D: One day I'll learn all the stupid things I do.
__________________
Last edited by AlexC; 05-18-2012 at 06:03 AM. |
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New PM not working | SapphirePhoenix | Questions and Supports | 6 | 11-25-2015 10:20 PM |
| Nothing seems to be working? | Starrunner | Questions and Supports | 12 | 09-22-2013 05:36 PM |
| Email Not Working | blueskyler | Questions and Supports | 0 | 12-19-2011 02:34 PM |
| Conditions not working | SilverDragonTears | Questions and Supports | 7 | 10-28-2011 06:18 PM |
| Ad HTML not working | AlkseeyaKC | Questions and Supports | 2 | 07-01-2011 07:13 AM |
What's New? |
What's Hot? |
What's Popular? |