Page 1 of 1

My Rpg Type of Forum

Posted: Sun Oct 23, 2005 1:51 am
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?

Posted: Sun Oct 23, 2005 2:02 am
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

:)

Posted: Sun Oct 23, 2005 2:56 am
by dlngle
Kool thanks I'll give it a crack, I knew my syntax was bad :P