Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[v1.3] new class->function($arg) problem.
#1
Hi there, after reading the Classes and Functions thread from Tools and member projects, i seen a function named get_description() in a class named builds();

So here i am, trying to get the description of the "main" building.

I have something like this so far:
PHP Code:
<?php
  $build 
= new builds();
  echo 
$build->get_description("main"); // trried with get_description_bydbname("main") but it doesnt return a thing.
?>

Which prints out exactly nothing... anyone has any opinions about what I am doing wrong ?
Reply
#2
falscher bereich, ein mod bitte verschieben
Keine Sigi sonst Stress
Reply
#3
Can you use english please ?
Reply
#4
oh sorry, that wasn't to you, you only open this thread in a wrong place. i asked a mod to move it.


to your problem, i'm sorry, i can't help you
Keine Sigi sonst Stress
Reply
#5
#moved
Wenn ich dir helfen konnte, bewerte mich doch bitte!

Manche Leute sagen, 20 Stunden am Tag Tetris zu summen wäre verrückt, ich frage mich nur wieso...


Reply
#6
Your mistake is, that you create a new builds object, so all variables are deleted.
Use this:
PHP Code:
require_once("include.inc.php");
// $cl_builds is defined in include/configs/buildings.php
$cl_builds->get_description("main"); 

btw: I know who you are! eddu, edduvs, eduvs, all same IP...
As I see, this is your 8. account... m1cro!
@Admins: At least 3 accounts of him are banned, I'd think about an IP ban...

Greetings
Molt
Reply
#7
Thanks for the help, i`ll check it right away.

EDIT: Umm, or i`m newb or its wrong.

I am in /actions/storage.php i want to rewrite the file because it gaves me errors like Error by division with 0 on /actions/storage.php line 31,32,33,34 and so on.

if i require the include.inc.php it will redeclare the functions, so this can't be possible.
Reply
#8
The actions/storage.php file is already included BY the game.php.
That means that you don't have to include the include.inc.php.
Try to access the $cl_builds variable without something, use $cl_builds->function(ARGS);

If you simply want to make this error invisible , write at the top of actions/storage.php "error_reporting(0);" (without " ")

Argumentreference:
Class builds
-get_description( $idofbuild )
-get_description_bydbname( $dbname )
LG
steffen
Reply




Users browsing this thread: 2 Guest(s)