Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-17-2012, 06:00 PM
AlexC's Avatar
AlexC AlexC is offline
Moderator
 
Join Date: Dec 2009
Location: Canada
Posts: 753
Gender: Unknown/Other
Credits: 68,763
AlexC is an unknown quantity at this point
Default changecash() not working

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']);
The full page;

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);

?>
This is a modified version of the script I found on here - it was for 1.2.x but I managed to get it working for 1.3.x before. Then somehow it got all messed up and now I'm not sure how to make it work again.
__________________
Reply With Quote
  #2  
Old 05-17-2012, 10:37 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 393,307
Hall of Famer is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 05-18-2012, 05:49 AM
AlexC's Avatar
AlexC AlexC is offline
Moderator
 
Join Date: Dec 2009
Location: Canada
Posts: 753
Gender: Unknown/Other
Credits: 68,763
AlexC is an unknown quantity at this point
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -5. The time now is 01:02 PM.

Currently Active Users: 820 (0 members and 820 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636