I don't need to go into great length about it, but I'm not that great at php. I don't expect anyone to code for me, or even to teach me. However, In editing a mod, I have encountered a problem when trying to edit "yourgang.php"
the code is as followed.
global $db,$ir,$c,$userid,$gangdata;
if(isset($_POST['subm']))
{
$_POST['gang'] = abs((int) $_POST['gang']);
if ($gangdata {$_POST['gang']}['status'] = 'Peaceful') { die("You can't go to war with peaceful clans!");
}
{
$db->query("INSERT INTO gangwars VALUES('',{$ir['gang']},{$_POST['gang']},unix_timestamp())");
$ggq=$db->query("SELECT * FROM gangs WHERE gangID={$_POST['gang']}");
$them=$db->fetch_row($ggq);
$event=str_replace("'","''","<a href='gangs.php?action=view&ID={$ir['gang']}'>{$gangdata['gangNAME']}</a> declared war on <a href='gangs.php?action=view&ID={$_POST['gang']}'>{$them['gangNAME']}</a>");
$db->query("INSERT INTO gangevents VALUES('',{$ir['gang']},unix_timestamp(),'$event') , ('',{$_POST['gang']},unix_timestamp(),'$event')");
print "You have declared war!";
The code that I added was
if ($gangdata {$_POST['gang']}['status'] = 'Peaceful') { die("You can't go to war with peaceful clans!");
I'm trying to develop to mod the file where clans can only declare on aggressive clans. (clans that are already in the warring mod) Long story short, this is not working, as the code simply does not let me declare war at all. (which is some success in my book.) Likewise, I have already modified the gangs sql for the "aggressive" and "peaceful" status using
ALTER TABLE users ADD status enum('Peaceful','Aggressive')NOT NULL 'Peaceful'
If anyone could give me some friendly advice point out what I'm doing wrong, and possibly how to correct it, I would be very appreciative.
Thanks.