MyBB Community Forums

Full Version: Game Section
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Updated your package? Cause the minimum posts check didn't work ^^
Paretje Wrote:Maybe, you can base you on the MyPS compatible plugin:
http://community.gamesection.org/showthread.php?tid=204
I took a look - it only seems to pay based on a play.

I think that's a little too basic, so I wanted to implement scoring as well.
Meh - most games have a score type of DESC, so shouldn't be too much of an issue.

Thanks for the response anyway, Paretje Smile
LeX- Wrote:Updated your package? Cause the minimum posts check didn't work ^^
The minimum posts system is last updated on 24 November, what's your problem with it? Susanne has a problem with it, too. The MyPS system is last updated on 29 December.

ZiNga BuRgA Wrote:
Paretje Wrote:Maybe, you can base you on the MyPS compatible plugin:
http://community.gamesection.org/showthread.php?tid=204
I took a look - it only seems to pay based on a play.

I think that's a little too basic, so I wanted to implement scoring as well.
Meh - most games have a score type of DESC, so shouldn't be too much of an issue.

Thanks for the response anyway, Paretje Smile
Yes that's included:
function games_myps_score()
{
	global $db, $mybb;
	
	if($mybb->user['uid'] != 0)
	{
		$db->query("UPDATE ".TABLE_PREFIX."users SET myps=myps+0".$mybb->settings['myps_games_score']." WHERE uid='".$mybb->user['uid']."'");
	}
}

function games_myps_champ()
{
	global $db, $mybb;
	
	if($mybb->user['uid'] != 0)
	{
		$db->query("UPDATE ".TABLE_PREFIX."users SET myps=myps+0".$mybb->settings['myps_games_champ']." WHERE uid='".$mybb->user['uid']."'");
	}
}
Hello Paretje!

First of all I wanna say thanks for this wonderful plugin. It makes a lot of fun to compete with the others. Smile
I have a little problem, though. Sometimes, me and other users are getting the "Game doesn't exist."-Error when submitting one's hiscore. However, I couldn't really figure out why the problem occurs. It's just sometimes, not everytime. That's weird... and very annoying when you're about to break the Hiscore... and then all the efforts were useless. Sad

Hope you can help.

Cheers
Entrail Wrote:Hello Paretje!

First of all I wanna say thanks for this wonderful plugin. It makes a lot of fun to compete with the others. Smile
I have a little problem, though. Sometimes, me and other users are getting the "Game doesn't exist."-Error when submitting one's hiscore. However, I couldn't really figure out why the problem occurs. It's just sometimes, not everytime. That's weird... and very annoying when you're about to break the Hiscore... and then all the efforts were useless. Sad

Hope you can help.

Cheers

I heart that before. In 1.1.6, the Game Section became more secure. But the system isn't fully integrated. This means that you can't play 2 games at the same time, more: when you load an other page on that site during playing a game, you can't save the score anymore.
That's pretty bad because when it wants to save the score, it DOES change the page. ^^
Anyway, are you going to fix this or is there no way?
Paretje Wrote:
LeX- Wrote:Updated your package? Cause the minimum posts check didn't work ^^
The minimum posts system is last updated on 24 November, what's your problem with it? Susanne has a problem with it, too. The MyPS system is last updated on 29 December.

I don't have any problem with it since i don't use it, someone else asked for a fix ; and the code you have now looks exactly like the code i gave to that user ^^
Entrail Wrote:That's pretty bad because when it wants to save the score, it DOES change the page. ^^
Anyway, are you going to fix this or is there no way?
I'm going to fix it and release it in some days Wink (=this weekend)

LeX- Wrote:
Paretje Wrote:
LeX- Wrote:Updated your package? Cause the minimum posts check didn't work ^^
The minimum posts system is last updated on 24 November, what's your problem with it? Susanne has a problem with it, too. The MyPS system is last updated on 29 December.

I don't have any problem with it since i don't use it, someone else asked for a fix ; and the code you have now looks exactly like the code i gave to that user ^^

Indeed. The user gave me a code, and I made it like that code:
http://community.gamesection.org/showthr...42#pid2142

function games_myps_games_global()
{
	global $mybb, $db;
	
	if($mybb->input['action'] == "play")
	{
		if($mybb->user['myps'] < intval($mybb->settings['myps_games_min']))
		{
			error_no_permission();
		}
	}
}

Thank you Wink
Paretje Wrote:I'm going to fix it and release it in some days Wink (=this weekend)

That's great, thank you, I look forward to it Wink
Paretje Wrote:Yes that's included:
function games_myps_score()
{
	global $db, $mybb;
	
	if($mybb->user['uid'] != 0)
	{
		$db->query("UPDATE ".TABLE_PREFIX."users SET myps=myps+0".$mybb->settings['myps_games_score']." WHERE uid='".$mybb->user['uid']."'");
	}
}

function games_myps_champ()
{
	global $db, $mybb;
	
	if($mybb->user['uid'] != 0)
	{
		$db->query("UPDATE ".TABLE_PREFIX."users SET myps=myps+0".$mybb->settings['myps_games_champ']." WHERE uid='".$mybb->user['uid']."'");
	}
}
From the looks of that code, the same amount of money will be paid if the user gets a score of 1, or a score of 1000000.

As I've said, I think it's a little too basic, and probably somewhat unrealistic.
My plugin multiplies a admin-specifiable, game-specific, factor, which the score is multiplied by to give the resulting earnings.
	if($game['score_type'] == ASC) // is ASC actually define'd somewhere??  I presume this is just a string
		$ourscore = GAMESECT_MAXSCORE - $score;
	else
		$ourscore = $score;
	
	// add money for the score
	user_change_money($mybb->user, intval($ourscore), $game['myplaza_money_factor']);
Anyways, thanks.