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 1271 times)

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 #15 on: November 06, 2009, 04:05:03 PM »
you know the issue im having is with accepting surrenders right?
Logged

gambino

  • Active Member
  • **
  • Reputation Power: 0
  • gambino is looked down upon.gambino is looked down upon.gambino is looked down upon.
  • Offline Offline
  • Posts: 113
    • View Profile
Re: Gang War Surrender does NOT work out of the box
« Reply #16 on: November 06, 2009, 05:01:46 PM »
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/USERNAME/public_html/yourgang.php on line 630

yeah. it's not working on both of them. I tried everything and I can't get it working even with your codes.
Logged

gambino

  • Active Member
  • **
  • Reputation Power: 0
  • gambino is looked down upon.gambino is looked down upon.gambino is looked down upon.
  • Offline Offline
  • Posts: 113
    • View Profile
Re: Gang War Surrender does NOT work out of the box
« Reply #17 on: November 06, 2009, 08:12:15 PM »
I know. it's just accepting surrenders but they are not working.
I don't know what the person is doing on giving us the codes if he didn't give us the right codes for it.
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 #18 on: November 08, 2009, 02:55:13 AM »
READ WHAT I SAID!!!

If a gang hit's 0 respect while in war, the gang get's deleted. Now because of the gang being deleted, the war list (Accept surrender's) Will never work as it can not fetch the name for that gang. And the list is throwing mysql error's at you, but because it's in a list, you can not see the error's unless you VIEW SOURCE.

In your attack file's, make sure you delete the war and surrender's from that gang that has just been destroyed. And your problem is sorted.
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 #19 on: November 08, 2009, 02:23:57 PM »
For me, i have removed that code, i dont like it.
Logged
Project Choosen - 10%
Daniel - Hanson . Com

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
FIXED!!!!!!!
« Reply #20 on: November 12, 2009, 05:35:26 PM »
Ive fixed it!!! here is the answer so everybody can remove this headache!!!


function gang_staff_viewsurrenders()
{
global 
$db,$ir,$c,$userid,$gangdata;
if(!isset(
$_POST['subm']))
{
echo 
"<form action='yourgang.php?action=staff&act2=viewsurrenders' method='post'>
Choose who to accept the surrender from.<br />
<input type='hidden' name='subm' value='submit' />
Gang: <select name='sur' type='dropdown'>"
;
$sql sprintf(
"SELECT s.*, w.* " .
"FROM surrenders s " .
"LEFT JOIN gangwars w ON (s.surWAR = w.warID) " .
"WHERE (surTO = %u)"$ir['gang']);
$wq $db->query($sql);
while(
$r $db->fetch_row($wq))
{
$w = ($gangdata['gangID'] == $r['warDECLARER']) ? "You" "Them";
$f = ($gangdata['gangID'] == $r['warDECLARER']) ? "warDECLARED" "warDECLARER";
$SelectGangs sprintf("SELECT * FROM gangs WHERE (gangID = %u)"$r[$f]);
$ggq $db->query($SelectGangs);
$them $db->fetch_row($ggq);
echo 
sprintf("<option value='%u'>War vs. %s (Msg: %s)</option>"$r['surID'], stripslashes($them['gangNAME']), stripslashes($r['surMSG']));
}
echo 
"</select><br /><input type='submit' value='Accept Surrender' /></form>";
}
else
{
$_POST['sur'] = abs(@intval($_POST['sur']));
$SelectWar sprintf("SELECT surWAR FROM surrenders WHERE (surID = %u)"$_POST['sur']);
$q $db->query($SelectWar);
if(!
$db->num_rows($q))
{
echo 
"Invalid surrender";
$h->endpage();
exit;
}
$war $db->fetch_row($q);
$SelectGangWars sprintf("SELECT * FROM gangwars WHERE (warID = %u)"$war['surWAR']);
$wq $db->query($SelectGangWars);
if(
$db->num_rows($wq) == 0)
{
echo 
"Invalid Gang";
exit;
}
$r $db->fetch_row($wq);
$w = ($gangdata['gangID'] == $r['warDECLARER']) ? "You" "Them";
$f = ($gangdata['gangID'] == $r['warDECLARER']) ? "warDECLARED" "warDECLARER";

$AcceptSurrender sprintf("DELETE FROM surrenders WHERE (surID = %u)"$_POST['sur']);
$EndWar sprintf("DELETE FROM gangwars WHERE (warID = %u)"$war['surWAR']);
$db->query($AcceptSurrender);
$db->query($EndWar);

$SelectGang sprintf("SELECT gangID, gangNAME FROM gangs WHERE (gangID = %u)"$r[$f]);
$ggq $db->query($SelectGang);
$them $db->fetch_row($ggq);

$eventage sprintf("<a href='gangs.php?action=view&ID=%u'>%s</a> have accepted the surrender from <a href='gangs.php?action=view&ID=%u'>%s</a>. The war is over!"$ir['gang'], $gangdata['gangNAME'], $them['gangID'], $them['gangNAME']);

$event str_replace("'""''"$eventage);

$LogEvent sprintf("INSERT INTO gangevents VALUES ('', %u, unix_timestamp(), '%s'), ('', %u, unix_timestamp(), '%s')"$ir['gang'], $event$r[$f], $event);
$db->query($LogEvent);
echo 
"You have accepted surrender, the war is over.";
Logged
Pages: 1 [2]
« previous next »
 


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