My Rpg Type of Forum

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply

Good first Question :$

Poll ended at Fri Nov 04, 2005 12:51 am

Yes
0
No votes
Getting there
0
No votes
No
1
100%
 
Total votes: 1

dlngle
Forum Newbie
Posts: 2
Joined: Sun Oct 23, 2005 1:09 am
Location: OZ

My Rpg Type of Forum

Post by dlngle »

Hello people this is my first post and I thought I would pose a question to all of you. I am running PunBB and none of the people on there forum know what I'm trying to do I have installed cashmod and am using that as "xp" for the game. When you submit posts the xp goes up and when you reach a certain amount of xp your level goes up now the way I thought to do this would be..

Code: Select all

//My Variables
//$cash==the xp
//$xp==xp till next level
//lvl == current level

if ($cash<"20"){
$lvl=="1";
$rxp=="20"-$cash;
}
else if ($cash>="40"){
$lvl==$lvl+1
$rxp=="20"-$cash;
}
ETC.
See I cant see how it doesn't work although i am a newb it all sounds write but the syntax is probly wrong also I'm not realy sure how to add $lvl and $xp to the database when a post is submited or a new topic.
Any help?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

change all the == for =.

Only use == if you are trying to compare values (i.e. in an IF statement.)

And the elseif should be one word

:)
dlngle
Forum Newbie
Posts: 2
Joined: Sun Oct 23, 2005 1:09 am
Location: OZ

Post by dlngle »

Kool thanks I'll give it a crack, I knew my syntax was bad :P
Post Reply