Jump to content
MakeWebGames

Recommended Posts

Posted

i have a problem with my new cons they only work if i manually do them. thay all come up with errors like these Notice: Undefined property: User::$speedoffense in /home/mafiasfi/public_html/classes.php on line 740

Notice: Undefined property: User::$speedoffense in /home/mafiasfi/public_html/classes.php on line 742

Notice: Undefined index: ban in /home/mafiasfi/public_html/classes.php on line 792

Notice: Undefined index: lastchase in /home/mafiasfi/public_html/classes.php on line 928

Notice: Undefined index: pet in /home/mafiasfi/public_html/classes.php on line 979

Notice: Undefined index: cost in /home/mafiasfi/public_html/classes.php on line 991

Notice: Undefined index: friends in /home/mafiasfi/public_html/classes.php on line 1007

Notice: Undefined index: enemys in /home/mafiasfi/public_html/classes.php on line 1009

Notice: Undefined index: sbban in /home/mafiasfi/public_html/classes.php on line 1013

Posted

<?

include 'dbcon.php';

include 'classes.php';

$randN = rand(1,25);

$ng = mysql_query("SELECT * FROM numbergame WHERE number = {$randN} LIMIT 1") or mysql_error();

$g = mysql_fetch_array($ng);

Send_Event($g['userid'],"<font color=green>Congratulations, You have won 25 points in the number game!</font>");

mysql_query("UPDATE `grpgusers` SET `points` = `points` + 25 WHERE `id` = '{$g['userid']}' LIMIT 1") or mysql_error();

mysql_query("UPDATE `numbergame` SET `userid` = 0") or mysql_error();

Posted

hour cron

<?

include 'dbcon.php';

include 'classes.php';

$randN = rand(1,25);

$ng = mysql_query("SELECT * FROM numbergame WHERE number = {$randN} LIMIT 1") or mysql_error();

$g = mysql_fetch_array($ng);

Send_Event($g['userid'],"<font color=green>Congratulations, You have won 25 points in the number game!</font>");

mysql_query("UPDATE `grpgusers` SET `points` = `points` + 25 WHERE `id` = '{$g['userid']}' LIMIT 1") or mysql_error();

mysql_query("UPDATE `numbergame` SET `userid` = 0") or mysql_error();

 

// kill of the hour

$kf = mysql_query("SELECT * FROM `grpgusers` ORDER BY `hkills` DESC LIMIT 1") or mysql_error();

$kh = mysql_fetch_array($kf);

$kill_class = new User($kh['id']);

$amountofkills = $kh['hkills'];

$killsid = $kh['id'];

$reskill = "0";

Send_Event($killsid,"<font color=orange>Congratulations, You are the mobster of the hour and won 100 points!</font>");

mysql_query("UPDATE `grpgusers` SET `points` = `points` + 100, `hkills` = '$reskill' WHERE `id` = '{$kh['id']}' LIMIT 1") or mysql_error();

$inskills= mysql_query("INSERT INTO `hourfame` (`who`, `kills`)".

"VALUES ('$killsid', '$amountofkills')") or mysql_error();

$resetthekills= mysql_query("UPDATE `grpgusers` SET `hkills` = 0") or mysql_error();

//other stuff

$result = mysql_query("SELECT * FROM `grpgusers`");

$line = mysql_fetch_array($result, MYSQL_ASSOC);

$updates_user = new User($line['id']);

$result3 = mysql_query("SELECT*FROM `gangs` WHERE `crimetime` > '0'");

$worked3 = mysql_fetch_array($result3);

$updates_gang = new Gang($worked3['id']);

$newfreezehrs = $updates_user->freezehrs - 1;

$newfreezehrs = ($newfreezehrs < 0) ? 0 : $newfreezehrs;

$newmailbanhrs = $updates_user->mailbanhrs - 1;

$newmailbanhrs = ($newmailbanhrs < 0) ? 0 : $newmailbanhrs;

$newforumbanhrs = $updates_user->forumbanhrs - 1;

$newforumbanhrs = ($newforumbanhrs < 0) ? 0 : $newforumbanhrs;

$newgangcrime = $updates_gang->time - 1;

$result = mysql_query("UPDATE `grpgusers` SET `sbbanhrs`='".$newsbbanhrs."', `forumbanhrs`='".$newforumbanhrs."', `mailbanhrs`='".$newmailbanhrs."', `freezehrs`='".$newfreezehrs."' WHERE `id`='".$updates_user->id."'");

$result = mysql_query("UPDATE `gangs` SET `crimetime`='".$newgangcrime."' WHERE `crimetime`!='0'");

?>

Posted

part of database.php

//Function to handle database errors.

function db_error($query, $errno, $error) {

die('<font color="#000000">' . $errno . ' - ' . $error . '

 

' . $query . '

 

<font color="#ff0000">[sTOP]</font>

 

</font>');

}

//Function to query the database.

function db_query($query, $link = 'db_link') {

global $$link;

 

$result = mysql_query($query, $$link) or db_error($query, mysql_errno(), mysql_error());

 

return $result;

Posted

Ok...

First they are saying do this -

<?php
error_reporting(0); 
$conn = mysql_connect("localhost","mafiasti_loot","123xyz");
$db = mysql_select_db("mafiasti_grpg");
?> 

Second –

Please use the bbcode tags to post code so for php –

[.php]

Code here

[./php]

Without the dots.

Posted
errors gone from crons but still not working any ideas

Well it wouldn’t all you did was turned error reporting off. As originally, stated Post the cron file so we can look.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...