Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

After purchasing with us the download link will be delivered to your forum message box.


This forum is now closed and has moved to a new location! Click here to find out why.
Pages: [1] 2

AuthorTopic: Gang War Surrender does NOT work out of the box  (Read 1270 times)

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
Gang War Surrender does NOT work out of the box
« on: October 30, 2009, 01:58:21 PM »
Has anyone else had this problem?

QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Query was SELECT * FROM gangwars where warID=
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Gang War Surrender does NOT work out of the box
« Reply #1 on: October 31, 2009, 07:44:38 AM »
Yep, it hasent ever worked.
Logged
Project Choosen - 10%
Daniel - Hanson . Com

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
Re: Gang War Surrender does NOT work out of the box
« Reply #2 on: November 03, 2009, 11:19:23 AM »
and nobody cares to fix it??? ???
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Gang War Surrender does NOT work out of the box
« Reply #3 on: November 03, 2009, 11:47:54 AM »
People have fixed it, but they dont post it.
Logged
Project Choosen - 10%
Daniel - Hanson . Com

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
Re: Gang War Surrender does NOT work out of the box
« Reply #4 on: November 03, 2009, 02:15:58 PM »
ok...well then i guess im hoping someone on here can point me in the right direction. im obviously not the only schmuck!
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Gang War Surrender does NOT work out of the box
« Reply #5 on: November 04, 2009, 09:56:28 AM »
Ill give it a go, when i get back in an hour.
Logged
Project Choosen - 10%
Daniel - Hanson . Com

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
Re: Gang War Surrender does NOT work out of the box
« Reply #6 on: November 04, 2009, 04:13:53 PM »
i appreciate it...ive been slamming my head up against this for a few days...i cant figure it out. it can grab the call else where in the code, but for the surrender it has an issue and their are no differences between the ones that work
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Gang War Surrender does NOT work out of the box
« Reply #7 on: November 05, 2009, 10:42:09 AM »
Code: [Select]
<?php // remove this when adding
function gang_staff_surrender()
{
global 
$db,$ir,$c,$userid,$gangdata;
if(!isset(
$_POST['submit']))
{
print 
"<form action='yourgang.php?action=staff&act2=surrender' method='post'>
Choose who to surrender to.<br />
<input type='hidden' name='submit' value='submit' />
Gang: <select name='war' type='dropdown'>"
;
$wq=$db->query("SELECT * FROM gangwars WEHER warDECLARER=".$ir['gang']." OR warDECLARED=".$ir['gang']."");
while(
$r=$db->fetch_row($wq))
{
if(
$gangdata['gangID'] == $r['warDECLARER']) { $w="You"$f="warDECLARED"; } else { $w="Them"$f="warDECLARER"; }
$d=date('F j, Y, g:i:s a',$r['warTIME']);
$ggq=$db->query("SELECT * FROM gangs WHERE gangID=".$r[$f]."");
$them=$db->fetch_row($ggq);
print 
"<option value='".$r['warID']."'>".$them['gangNAME']."</option>";
}
print 
"</select><br />
Message: <input type='text' name='msg' /><br />
<input type='submit' value='Surrender' /></form>"
;
}
else
{
$_POST['war'] = abs((int) $_POST['war']);
$wq=$db->query("SELECT * FROM gangwars WHERE warID=."$_POST['war']."");
$r=$db->fetch_row($wq);
if(
$gangdata['gangID'] == $r['warDECLARER']) { $w="You";$f="warDECLARED"; } else { $w="Them";$f="warDECLARER"; }
$db->query("INSERT INTO surrenders VALUES('',".$_POST['war'].",".$ir['gang'].",".$r[$f].",'".$_POST['msg']."')");
$ggq=$db->query("SELECT * FROM gangs WHERE gangID=".$r[$f]."");
$them=$db->fetch_row($ggq);
$event=str_replace("'","''","<a href='gangs.php?action=view&ID=".$ir['gang']."'>".$gangdata['gangNAME']."</a> have asked to surrender the war against <a href='gangs.php?action=view&ID=".$them['gangID']."'>".$them['gangNAME']."</a>");
$db->query("INSERT INTO gangevents VALUES('',".$ir['gang'].",unix_timestamp(),'$event') , ('',".$r[$f].",unix_timestamp(),'$event')");
print 
"You have asked to surrender.";
}
}
Should work, untested.
Logged
Project Choosen - 10%
Daniel - Hanson . Com

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
Re: Gang War Surrender does NOT work out of the box
« Reply #8 on: November 05, 2009, 01:37:45 PM »
is this going to  correct the surrender accepting portion as well? or is that a whole other beast to take down?
Logged

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
Re: Gang War Surrender does NOT work out of the box
« Reply #9 on: November 05, 2009, 02:40:52 PM »
constant encapsed string in there somewhere and i couldnt find it...appreciate the effort though :)
Logged

HauntedDawg

  • Basic Member
  • *
  • Reputation Power: 12
  • HauntedDawg has no influence.
  • Offline Offline
  • Posts: 25
    • View Profile
Re: Gang War Surrender does NOT work out of the box
« Reply #10 on: November 05, 2009, 04:26:37 PM »
Your method is wrong danny.

You see, 'cause of the war's gang's get deleted, so that screw's up the list. Check into fixing the remove from gang when 0 respect and make sure to delete all war entry's at the same time.
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Gang War Surrender does NOT work out of the box
« Reply #11 on: November 06, 2009, 12:06:02 PM »
Dabs made alot of mistakes on the gang file like this: WHERE gangID=".$r[$f]); And HD, im kinda confuzed what you mean
Logged
Project Choosen - 10%
Daniel - Hanson . Com

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
Re: Gang War Surrender does NOT work out of the box
« Reply #12 on: November 06, 2009, 01:02:53 PM »
the whole thing is just messy if you ask me...its giving me a headache  >:(
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Gang War Surrender does NOT work out of the box
« Reply #13 on: November 06, 2009, 01:15:23 PM »
Rite, me is haveing another go.
Logged
Project Choosen - 10%
Daniel - Hanson . Com

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Gang War Surrender does NOT work out of the box
« Reply #14 on: November 06, 2009, 01:20:59 PM »
Code: [Select]
<?php // remove when adding
function gang_staff_surrender()
{
global 
$db,$ir,$c,$userid,$gang;
if(!isset(
$_POST['submit']))
{
echo
'<form action=\'?action=staff&act2=surrender\' method=\'post\'>
Choose who to surrender to.<br />
<input type=\'hidden\' name=\'submit\' value=\'submit\' />
Gang: <select name=\'war\' type=\'dropdown\'>'
;
$wq=$db->query("SELECT * FROM gangwars WHERE warDECLARER=".$ir['gang']." OR warDECLARED=".$ir['gang']."");
while(
$r=$db->fetch_row($wq))
{
if(
$gangdata['gangID'] == $r['warDECLARER']) { $w="You"$f="warDECLARED"; } else { $w="Them"$f="warDECLARER"; }
$d=date('F j, Y, g:i:s a',$r['warTIME']);
$them $db->fetch_row($db->query("SELECT * FROM gangs WHERE gangID=".$r[$f].""));
echo
'<option value=\''.$r['warID'].'\'>'.$them['gangNAME']'"</option>';
}
echo
'</select><br />
Message: <input type=\'text\' name=\'msg\' /><br />
<input type=\'submit\' value=\'Surrender\' /></form>'
;
}
else
{
$_POST['war'] = abs((int) $_POST['war']);
$r $db->fetch_row($db->query("SELECT * FROM gangwars WHERE warID=".$_POST['war'].""));
if(
$gangdata['gangID'] == $r['warDECLARER']) { $w="You";$f="warDECLARED"; } else { $w="Them";$f="warDECLARER"; }
$db->query("INSERT INTO surrenders VALUES('',".$_POST['war'].",".$ir['gang'].",".$r[$f].",'".$_POST['msg']."')");
$them $db->fetch_row($db->query("SELECT * FROM gangs WHERE gangID=".$r[$f].""));
$event=str_replace("'","''","<a href='gangs?action=view&ID=".$ir['gang']."'>".$gang['gangNAME']."</a> have asked to surrender the war against <a href='gangs.php?action=view&ID=".$them['gangID']."'>".$them['gangNAME']."</a>");
$db->query("INSERT INTO gangevents VALUES('',".$ir['gang'].",unix_timestamp(),'$event') , ('',".$r[$f].",unix_timestamp(),'$event')");
print 
"You have asked to surrender.";
}
}
if theres any errors pleas copy and paste them
Logged
Project Choosen - 10%
Daniel - Hanson . Com
Pages: [1] 2
« previous next »
 


This forum is now closed and has moved to a new location! Click here to find out why.