Posted on Saturday 3rd January 2009 at 10:47 PM | |
zerocool Newbie |
Hi people, I wanna add a custom BBCode to the chat, but i havn't idea how to do it. The code is [dice]XdY[/dice] the X was the number of rands and the Y the max number. how i could do this? and another code is [dice=Motive]XdY[/dice] the X and Y is the same as the other code, but the Motive is a text. it will shown in a box with the infos. Thanx to all and sorry for my badly English :P |
Posted on Wednesday 7th January 200 at 09:48 PM | |
zerocool Newbie |
No one can take a look at my post? |
Posted on Wednesday 7th January 200 at 10:43 PM | |
ShadowMage Senior Member |
What do you want it exactly to do? Find a number? I'm talking about the regular [dice] [/dice] one Btw :P |
Posted on Wednesday 7th January 200 at 10:56 PM | |
zerocool Newbie |
mm yes, but a rpg dice roller, with diferent dice sides, like 4 sided dice, 6, 8, 10, etc then it will done a rand or somthing, and put the result in the database and the second code, with the coment to show a little coment on the forum like Mod-Shadow rolled a 4 sided dice and get 3. I rolled for pass the door |
Posted on Wednesday 7th January 200 at 10:59 PM | |
ShadowMage Senior Member |
Alright, I have made something like that but it's including the message in which I put before [dice] So I'll go try and make it only do the calculations then post it up on here ;D |
Posted on Wednesday 7th January 200 at 11:11 PM | |
zerocool Newbie |
ok, thaks Shadow |
Posted on Thursday 8th January 2009 at 01:20 AM | |
ShadowMage Senior Member |
Alright I got them both working now :) PHP Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<?php
|
Posted on Thursday 8th January 2009 at 03:25 PM | |
zerocool Newbie |
ok thanx Shadow but in this code PHP Code
1 2 3 4 5 6
if($motive != null){
you may change the $originalTextRolling to $originalText |
Posted on Thursday 8th January 2009 at 04:05 PM | |
ShadowMage Senior Member |
Replace the $originalTexTRolling with $originalText<br />Rolling I made a type. ALso, anywhere where it has $temp remove it. also where I have $text = str_replace("","", $text); and $countText = strlen($text); and $original = substr($text, 0, stuff delete it. I forgot to clean up the code =P This code could also be shortened a ton with single line if statements for the motive. ;D |