DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • December 16, 2018, 08:28:26 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: The meaning of PigPen  (Read 5576 times)
0 Members and 1 Guest are viewing this topic.
gilgalad
Guest
« on: May 29, 2005, 04:54:32 AM »

what s the meaning of this tittle Smiley some of my players asking this... i dont know how they get this tittle... i think with a module. can this be a odor modules effect.. sorry for this silly question Smiley
Logged
Dannic
Guest
« Reply #1 on: May 29, 2005, 07:44:39 AM »

extremely dirty and smelly.  Comes from the Charlie brown comic strip.
Logged
Freeze
Guest
« Reply #2 on: May 29, 2005, 10:46:03 AM »

Its caused by the Odor/bladder module of Lonnyl's.
Logged
gilgalad
Guest
« Reply #3 on: May 29, 2005, 02:03:21 PM »

Thankies guys, u r great Smiley
Logged
Elessa
Faerie
Mod God
*****
Offline Offline

Posts: 3598


short, sweet and to the point


View Profile
« Reply #4 on: June 01, 2005, 05:35:24 AM »

more specifically

Logged

Uuma ma ten rashwe, ta tuluva a lle

Play the latest beta version here on LoGD DragonPrime - Axebridge
josefprado
Guest
« Reply #5 on: July 03, 2006, 11:38:16 AM »

Hi,

Is there any way for the module set different classes for male and female?

I look at the code and as far as I undestood, it only insert PigPen for both, but for some languages (like latin languages) we need to have different adjectives for the two sex.

So, im portuguese we would use:

Imundo - For man
Imunda - For female

(or some kind of variation of it, but certainly we would need the 2 options)

Does anyone know how to make this module "2 sex compliant" Smiley
(Remember that i don't know how to code Tongue)

Thanks,

Logged
shadowblack
Guest
« Reply #6 on: July 04, 2006, 01:39:35 AM »

I think you'll have to edit the module and add an "if" statement:
if ($session['user']['sex']==0){
//code for male title here
}else{
//code for female title here
}

Something like that.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #7 on: July 04, 2006, 01:46:34 AM »

you should use
Code:
if ($session['user']['sex'] == SEX_MALE)

It's correct, that SEX_MALE is equivalent to 0 but as we had to change the clanranks' values for v1.1.x all modules which used "clanrank == 2" are not compatible with this anymore.
Logged

Running for more than three years now:
josefprado
Guest
« Reply #8 on: July 04, 2006, 07:33:08 AM »

Hummmmm

I did some s**t and I'm getting this error:

Parse error: syntax error, unexpected T_CASE in /home/lddvcomb/public_html/modules/odor.php on line 111

Since I cant attach files here, I will post the code here:

Code:
<?php
//contribs - mprowler
function odor_getmoduleinfo(){
$info = array(
"name"=>"Odor",
"version"=>"1.45",
"author"=>"`#Lonny Luberts",
"category"=>"PQcomp",
"download"=>"http://www.pqcomp.com/modules/mydownloads/visit.php?cid=3&lid=11",
"vertxtloc"=>"http://www.pqcomp.com/",
"prefs"=>array(
"Odor Module User Preferences,title",
"odor"=>"Odor Level,int|0",
),
"settings"=>array(
"Odor Module Settings,title",
"newday"=>"Odor Increase on New Day,int|1",
),
);
return $info;
}

function 
odor_install(){
if (!is_module_active('odor')){
output("`4Installing Odor Module.`n");
}else{
output("`4Updating Odor Module.`n");
}
module_addhook("charstats");
module_addhook("dragonkill");
module_addhook("newday");
module_addhook("village");
module_addhook("battle-victory");
module_addhook("battle-defeat");
module_addeventhook("forest""return 100;");
return true;
}

function 
odor_uninstall(){
output("`4Installing Odor Module.`n");
return true;
}

function 
odor_dohook($hookname,$args){
global $session;
switch($hookname){
case "charstats":
if ($session['user']['alive'] == 1){
$len=0;
  $len2=0;
  $max=40;
  $odorval get_module_pref('odor');
    for ($i=0;$i<$max/2;$i+=1){
   if ($odorval>$i$len+=2;
  }
  $pct round($len $max 1000);
  $nonpct 100-$pct;
  if ($pct 100) {
   $pct 100;
   $nonpct 0;
  } elseif ($pct 0) {
   $pct 0;
   $nonpct 100;
  }
  $color "`^";
  $barcolor "#F7E827";
  $barbgcol "#777777";
  $odor "";
  $odor .= "`b$color$pct%`b";
  $odor .= "<br />";
  $odor .= "<table style='border: solid 1px #000000' bgcolor='$barbgcol' cellpadding='0' cellspacing='0' width='70' height='5'><tr><td width='$pct%' bgcolor='$barcolor'></td><td width='$nonpct%'></td></tr></table>";
  setcharstat("Vital Info","Odor",$odor);
   }
break;
case "dragonkill":
set_module_pref('odor'0);
break;
case "newday":
if (get_module_pref('odor') > 2$session['user']['charm']-=(get_module_pref('odor')-2);
set_module_pref('odor'get_module_pref('odor') + get_module_setting('newday'));
if (get_module_pref('odor')>and $session['user']['clean']<15addnews("%s`2 is pretty stinky!",$session['user']['name']);
if (get_module_pref('odor')>14 and get_module_pref('odor')<20){
output("You can hardly stand the smell of yourself!");
addnews("%s`2 smells really bad!",$session['user']['name']);
}
if (get_module_pref('odor')>19){

if (
$session['user']['sex']==SEX_MALE){
output("You have earned the title of Porquinho for being so dirty!`n");
addnews("%s `7was awarded the title of Porquinho for being so dirty!",$session['user']['name']);
$newtitle="Porquinha";
require_once("lib/names.php");
$newname change_player_title($newtitle);
$session['user']['title'] = $newtitle;
$session['user']['name'] = $newname;
}
}else{
output("You have earned the title of Porquinha for being so dirty!`n");
addnews("%s `7was awarded the title of Porquinha for being so dirty!",$session['user']['name']);
$newtitle="Porquinha";
require_once("lib/names.php");
$newname change_player_title($newtitle);
$session['user']['title'] = $newtitle;
$session['user']['name'] = $newname;
}

}


break;
case "village":
tlschema($args['schemas']['marketnav']);
   addnav($args['marketnav']);
   tlschema();
addnav("Bath House""runmodule.php?module=odor");
break;
case "battle-victory":
if (e_rand(1,3) == 3set_module_pref('odor'get_module_pref('odor') + 1);
break;
case "battle-defeat":
if (e_rand(1,3) == 3set_module_pref('odor'get_module_pref('odor') + 1);
break;
}
return $args;
}

function 
odor_runevent(){
global $session;
$op httpget('op');
if (e_rand(1,2) == and $op <> "bathe"){
output("You trip! Ohhhh! right into a mud puddle! You are covered in mud!");
set_module_pref('odor'get_module_pref('odor') + 2);
}else{
$session['user']['specialinc']="module:odor";
if ($op == ""){
output("You come across a small river, the water looks clean and fresh. What a great place to clean up!");
addnav("Bathe","forest.php?op=bathe");
addnav("Continue on Your way","forest.php?op=continue");
}
if ($op == "continue"){
$session['user']['specialinc']="";
redirect("forest.php");
}
if ($op == "bathe"){
set_module_pref('odor'0);
output("You strip down to your skivies and hop in the river. The bath leaves you feeling and smelling much better!");
$session['user']['specialinc']="";
addnav("Continue on Your way","forest.php");
}
}
}

function 
odor_run(){
global 
$session;
$op httpget('op');
page_header("Bath House");
output("`c`b`&Bath House`0`b`c`n`n");
if (
$op == ""){
output("`2You enter the bath house and notice that everything looks very damp, including the old woman tending");
output("the baths. There are curtains around all of the baths for privacy. You think a nice steamy hot bath");
output("would feel good about now. The old woman looks at you and points to a sign on the wall. The sign states");
output("that a bath will cost you `65 `2gold.`n");
addnav("Take a Bath","runmodule.php?module=odor&op=bathe");
modulehook("bathhouse",$texts);
addnav("Back to the Village","village.php");
}
if (
$op == "bathe"){
if ($session['user']['gold']<5){
output("`2You dig for the 5 gold in your pouch, but come up short. The old woman just turns away and points to the door.`n");
addnav("Back to the Village","village.php");
}else{
output("`2You hand the old woman your 5 gold and without saying a word leads you to a bath and pulls the curtain");
output("You undress and slip into the warm water and proceed to clean the grime of the forest and the village");
output("from your body. The bath feels heavenly and you could stay here forever, but just as you get settled in");
output("the old woman abruptly pulls back the curtain and gestures for you to get out. She closes the curtain and");
output("leaves you to dry off and get dressed. You feel much better after your bath!`n");
set_module_pref('odor'0);
$session['user']['gold']-=5;
addnav("Back to the Village","village.php");
}
}
//I cannot make you keep this line here but would appreciate it left in.
rawoutput("<div style=\"text-align: left;\"><a href=\"http://www.pqcomp.com\" target=\"_blank\">Bathhouse and Odor by Lonny @ http://www.pqcomp.com</a><br>");
page_footer();
}
?>
« Last Edit: July 04, 2006, 07:34:40 AM by Erugalathon » Logged
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #9 on: July 04, 2006, 07:37:51 AM »

Paste me lines 110 - 112 and I'll tell you what the error is. More than likely you forgot a closing brace }

Go back and look at the line *before* the error.

Edit: This is your own fault when your tab stops are all over the place Wink
If you are religious about making your indenting perfect you will never get lost like this - it will be obvious straight away because one of the indents will be wrong.
« Last Edit: July 04, 2006, 07:42:19 AM by SaucyWench » Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
SexyCook
Codemeister
****
Offline Offline

Posts: 430



View Profile WWW
« Reply #10 on: July 04, 2006, 07:42:50 AM »

The } on line 107 is, as far as I can see, unnecessary. You might want to use a program that highlights ) and }, I use PSPad myself.
« Last Edit: July 04, 2006, 07:44:58 AM by SexyCook » Logged
robert
Old Dog
Mod God
*****
Offline Offline

Posts: 1047


LoGD Buff!


View Profile WWW
« Reply #11 on: July 04, 2006, 07:47:29 AM »

Hummmmm

I did some s**t and I'm getting this error:

Parse error: syntax error, unexpected T_CASE in /home/lddvcomb/public_html/modules/odor.php on line 111


Using a quality php editor will help you find such minor errors.
Also, the error message told you exactly what what wrong
syntax error, unexpected T_CASE
and approx where it was
odor.php on line 111

you may find the error on that line or sometimes a few lines before

just a quick glance at the code you provide, you have a brace } on line 107 which dont belong there
Logged

josefprado
Guest
« Reply #12 on: July 04, 2006, 07:54:08 AM »

Paste me lines 110 - 112 and I'll tell you what the error is. More than likely you forgot a closing brace }

Go back and look at the line *before* the error.

Edit: This is your own fault when your tab stops are all over the place Wink
If you are religious about making your indenting perfect you will never get lost like this - it will be obvious straight away because one of the indents will be wrong.

You were completly right!

I've left some "{" lost in the process.

(Wow, know I know why my teacher said to me that I need to learn C at the college, hehehe)

it seems to be working now, I will need only to see what happens whena user turns into a PigPen if the game will define the correct class.

Thanks, to all of you!

BTW: The tabs are in the original odor.php file, they are not mine Tongue
Logged
josefprado
Guest
« Reply #13 on: July 04, 2006, 07:55:33 AM »

Using a quality php editor will help you find such minor errors.
Also, the error message told you exactly what what wrong
syntax error, unexpected T_CASE
and approx where it was
odor.php on line 111

you may find the error on that line or sometimes a few lines before

just a quick glance at the code you provide, you have a brace } on line 107 which dont belong there

Robert,

Its the first time I do something in PHP Smiley
I used notepd only, hehehe
Logged
robert
Old Dog
Mod God
*****
Offline Offline

Posts: 1047


LoGD Buff!


View Profile WWW
« Reply #14 on: July 04, 2006, 08:09:14 AM »

RE:  Its the first time I do something in PHP .....I used notepad only ....

No worries, this is good learning for you.
 - 1. Using a quality php editor 'helps you', in the links area on DP check out NotePad++ or Crimson Editor, both are freeware
 - 2. Error messages pretty much tell you whats wrong, you only need to learn to understand what they are telling you
 - 3. Now you learn why most of us here at DP suggest using a quality editor to write scripts. They will auto tab as you write the file, making the indents where needed. By using auto tabs ...most common php errors will be avoided or easily found if indented properly.
 - 4. You also learn that some authors dont use proper indents. While this practice wont break the code and it will run as it should but if used ...sure makes reading the code easier for others Wink

See how much you learn already!  Cool 
Logged

Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
77 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search