[Request] Arcade Point System Smf Shop Mod

Started by 0mfg wtf man, March 25, 2012, 10:11:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0mfg wtf man

Hello everyone,

I'm fairly new to SMF, but i have worked with it a little in the past.

I'm trying to create a Online arcade center for my college. A place where all the students can go and play games, but i wanna make it so that when they play games they can win gold ( Credits for the shop). With the gold i want them to be able to go to the shop, and buy new games for them to play.

Now in order to do this i would have to
- Put permissions on arcade games.
- Have a submit system that converted all scores to a equal amount in all games.
  I would even be happy with a system that gave you gold after every game you play.
- Have an item in the shop that once you buy it you are given a permission to access the game.

I was checking out the arena feature in the Arcade. This feature allows you to play against others in a game, but it has its own point system that evens out the whole group. I thought that might be something that can be used for the point system.

I found this mod that people were working on in the past. A mod for an item called Arcadepass.php, this pass allowed you into the Arcade. This mod also makes it so you get points for getting the high score of a game, but i can't seem to get it working.

I have been messing around with this mod, but i'm not getting any where. I was wondering if anyone wanted to help me or could lead me to what i need to do to get this done.

0mfg wtf man

I get an error saying
Database Error:
Unknown column 'cash' in 'field list'
File: /home/unknown/public_html/website/Sources/Subs-Arcade.php
Line: 1485


This is the code in Sources/Subs-Arcade.php that is causing the error.
updateGame($game['id'], array('champion' => $member['id'], 'champion_score' => $score['id']));
global $user_info, $modSettings;
// Arcade & Shop mod
if (isset($modSettings['shopPointsPerHighscore']) && $modSettings['shopPointsPerHighscore'] > 0)
{

$points = $modSettings['shopPointsPerHighscore'];

// Give the user their points
$result_shop = $smcFunc['db_query']('', '
UPDATE {db_prefix}members
SET cash = cash + {int:points}
WHERE id_member = {int:member}
LIMIT 1',
array(
'member' => $user_info['id'],
'points' => $points,

)
);


When installing the SMF Shop Arcade Integration Mod, there were failures all from the Sources/shop/shopAdmin.php
I tried to go in and fix it, but there were no trace of the code that i needed to add in or replace.

These are all the failed
Fail 1
Code: (Find) [Select]

$newSettings['shopPointLimit'] = (float) $_POST['pointlimit'];

Code: (Add After) [Select]

$newSettings['shopPointsPerHighscore'] = (float) $_POST['perhighscore'];



Fail 2
Code: (Find) [Select]

(isset($_POST['enablestats']) ? $newSettings['shop_Enable_Stats'] = '1' : $newSettings['shop_Enable_Stats'] = '0');

Code: (Add After) [Select]

(isset($_POST['arcadepassenabled']) ? $newSettings['shopEnableArcadePass'] = '1' : $newSettings['shopEnableArcadePass'] = '0');


Fail 3
Code: (Find) [Select]

'enablestats' => array('shop_Enable_Stats'),

Code: (Add After) [Select]

'arcadepassenabled' => array('shopEnableArcadePass'),



Fail 4
Code: (Find) [Select]

'pointlimit' => array('shopPointLimit'),

Code: (Add After) [Select]

'perhighscore' => array('shopPointsPerHighscore'),




I attached the ShopAdmin.php



0mfg wtf man

I fixed this error by replacing cash with money.
Database Error:
Unknown column 'cash' in 'field list'
File: /home/unknown/public_html/website/Sources/Subs-Arcade.php
Line: 1485

This is the fixed code. Now every time someone gets a high score it gives them money, but I'm not sure what it is basing it off of.
updateGame($game['id'], array('champion' => $member['id'], 'champion_score' => $score['id']));
global $user_info, $modSettings;
// Arcade & Shop mod
if (isset($modSettings['shopPointsPerHighscore']) && $modSettings['shopPointsPerHighscore'] > 0)
{

$points = $modSettings['shopPointsPerHighscore'];

// Give the user their points
$result_shop = $smcFunc['db_query']('', '
UPDATE {db_prefix}members
SET money = money + {int:points}
WHERE id_member = {int:member}
LIMIT 1',
array(
'member' => $user_info['id'],
'points' => $points,

)
);


--------------------------------------------------------------------------------------------------------------------
Update.  :juggle:

Users are now able to get money from getting the high score on games. I'm not sure how it calculates how much it should give yet, but now I'm trying to figure out another way i can get cash to users. I was considering the Arena.

I noticed that no one has made any modifications to the arena feature in Smf Arcade. I'm trying to figure out how i can make the arena features notice the winner and present it to the shoutbox and then give them credit for winning with cash for the shop.

Underdog from http://askusaquestion.net has already created a Shoutbox Announcer, this Announcer shouts out in the Shoutbox a user that placed a new high score in a game. Now if we could only modify it so it shouts out someone that has won in the arena. Also i was think we should change it to Tournament instead of arena. I'm not very experience in PHP, so it has been very hard to figure this out considering the ArcadeArena.php does not have any feature that presents a winner.

I attached the shoutbox announcer and the ArcadeArena.php


Skhilled

Welcome to Doc Skillz, 0mfg wtf man.

This forum is basically for teaching people how to use SMF, I'm not a coder. I am a former admin for SMF Arcade and remember the SMF Shop Arcade Integration Mod and Arcade Pass were for SMF 1.1.x version, I think. Or very early SMF 2 RC1 or so. Both of those would need to probably be rewritten to work with SMF 2 since there were a lot of code and database changes.

There were also many changes to SMF Shop since those 2 hacks were made. I can't help you with those, maybe Underdog can.

You never stated which arcade, and smf version you are using. For the SP Shout block, Underdog can probably help you out with that. Just point him to the topic here. He is an admin here and I am an admin on his forum.

0mfg wtf man

Will do. Ya I found you guys yesterday. I think it is awesome what you guys have going on here. I would love to help with the activity here.

I'm running on
- SMF 2.0.2
- SMF Shop 3.2
- SMF Arcade 2.5 RC1

Ya I was already going to try and get a hold of Underdog, but his website requires pre activation from him before i am able to be a member... I didn't know he was a admin on here. So that is great. I have no way to contact him so next time you talk to him that would be great if you could pass the word. I will send him a Personal Message on here asap.

Edit: Sorry, I clicked on the wrong thing and is the reason for the edit.

Skhilled

I'll activate you on his forum if he doesn't. I pm'd him there about it. ;)

I wasn't paying attention and started writing something in the above post and saved it before I realized it was the wrong post. LOL

0mfg wtf man


March 27, 2012

Ya if you could activate me that would be awesome!

And it is all good, is there any other developers then Underdog on your forum?

Skhilled

I think UD already approved you.

Nope, he is the only one so far.