![]() |
I had posted the same question as Mys has posted here, in the ibProarcade support area, so in fact I have the same question.:)
But I don't have a clue how to work with hooks or how to implement them. I can understand a little what the db query does you wrote Blaine, but I don't have a clue how to implement it nore where. I would need screenshot examples or a product.xml file or something like that, cause on this territory I'm really a noob. I would already be very glad if I (for starters) only had a way that users had to pay to play with Icash credits and that I could setup in the ACP the amound of credits needed to play a game. Any help is VERY appreciated! |
ok try this, make a new plugin, hook location ibproarcade_play_game
contents somthing like this PHP Code:
heres what each individual thing does $amount is set to whatever you want your games to cost, you need to set this if (($vbulletin->userinfo[$vbulletin->options['icashf']] - $amount) < 0) { eval(standard_error(fetch_error('your_error'))); } this checks the money row, and sees if they have enough to play the game, if not, ERROR! of course you will need to make a new error phrase and edit the code to whatever you named your phrase. $vbulletin->db->query("update " . TABLE_PREFIX . "user set {$vbulletin->options['icashf']}={$vbulletin->options['icashf']}-'{$amount}' where userid='{$vbulletin->userinfo['userid']}'"); if the error passes this updates their settings and minuses the $amount from their points :D have fun ! |
Quote:
I will try to work with that. |
really looking forward to hear how Black Tiger makes out with that....
Thanks, again, Blaine! :up: |
I installed the update a first time. But it was not working correctly (we got points for a new thread but not for a reply). I tried to reinstall it and I got this:
Database error in vBulletin 3.6.4: Invalid SQL: ALTER TABLE user ADD COLUMN money decimal(15,2) DEFAULT '0' NOT NULL; MySQL Error : Duplicate column name 'money' Error Number : 1060 ??? |
ok I found the way.
nvm |
So is this working on v3.6 yet?
|
yes, this has always been working on 3.6..
2mepile was it a problem with my code? |
Working fine on 3.6.x mcqwert, no problem.
@Blaine0002: Thanks very much! This evening I have to go out, but I will try to do it like you said later tonight (around 02.00 GMT+1). I'll let you all know how it worked out. |
Quote:
Fatal error: Call to a member function on a non-object in .../public_html/forum/includes/class_dm_pollvote.php(138) : eval()'d code on line 2 |
All times are GMT. The time now is 12:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|