• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Fixed Guild War System for Website [include all]-[will not count frags] (TFS 0.3+)

Status
Not open for further replies.
I'am getting this error:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'g.war_time' in 'field list'' in C:\xampp\htdocs\wars.php:56 Stack trace: #0 C:\xampp\htdocs\wars.php(56): PDO->query('? SELECT g.n...') #1 C:\xampp\htdocs\index.php(112): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\wars.php on line 56
 
I'am getting this error:
Execute this on phpMyAdmin:
PHP:
ALTER TABLE `guilds` 
ADD `invited_to` INT( 11 ) NOT NULL ,
ADD `invited_by` INT( 11 ) NOT NULL ,
ADD `in_war_with` INT( 11 ) NOT NULL ,
ADD `kills` INT( 11 ) NOT NULL ,
ADD `show` SMALLINT( 1 ) NOT NULL ,
ADD `war_time` INT( 11 ) NOT NULL ;
PHP:
 CREATE TABLE `deaths_in_wars` (
`guild_id` INT( 11 ) NOT NULL ,
`player_id` INT( 11 ) NOT NULL ,
`killer_guild` INT( 11 ) NOT NULL ,
`killer` INT( 11 ) NOT NULL ,
`date` INT( 11 ) NOT NULL ,
`result1` INT( 11 ) NOT NULL ,
`result2` INT( 11 ) NOT NULL 
) ENGINE = MYISAM ;
PHP:
  UPDATE `guilds` SET `invited_to` = 0, `invited_by` = 0, `in_war_with` = 0, `kills` = 0, `show` = 0, `war_time` = 0 WHERE `id` > 0;
 
Execute this on phpMyAdmin:
PHP:
ALTER TABLE `guilds` 
ADD `invited_to` INT( 11 ) NOT NULL ,
ADD `invited_by` INT( 11 ) NOT NULL ,
ADD `in_war_with` INT( 11 ) NOT NULL ,
ADD `kills` INT( 11 ) NOT NULL ,
ADD `show` SMALLINT( 1 ) NOT NULL ,
ADD `war_time` INT( 11 ) NOT NULL ;
PHP:
 CREATE TABLE `deaths_in_wars` (
`guild_id` INT( 11 ) NOT NULL ,
`player_id` INT( 11 ) NOT NULL ,
`killer_guild` INT( 11 ) NOT NULL ,
`killer` INT( 11 ) NOT NULL ,
`date` INT( 11 ) NOT NULL ,
`result1` INT( 11 ) NOT NULL ,
`result2` INT( 11 ) NOT NULL 
) ENGINE = MYISAM ;
PHP:
  UPDATE `guilds` SET `invited_to` = 0, `invited_by` = 0, `in_war_with` = 0, `kills` = 0, `show` = 0, `war_time` = 0 WHERE `id` > 0;


Nooby question, but how do I "Execute" ?
 
Omfg i know but where shall i click and insert that code or what it is!!??=
 
I added the ones you siad and I'am still gettin the error..

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'g.war_time' in 'field list'' in C:\xampp\htdocs\wars.php:56 Stack trace: #0 C:\xampp\htdocs\wars.php(56): PDO->query('? SELECT g.n...') #1 C:\xampp\htdocs\index.php(112): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\wars.php on line 56
 
Two things:

1) It gives you any error when you fill this?:
ALTER TABLE `guilds`
ADD `invited_to` INT( 11 ) NOT NULL ,
ADD `invited_by` INT( 11 ) NOT NULL ,
ADD `in_war_with` INT( 11 ) NOT NULL ,
ADD `kills` INT( 11 ) NOT NULL ,
ADD `show` SMALLINT( 1 ) NOT NULL ,
ADD `war_time` INT( 11 ) NOT NULL ;
If yes, post here the error message.

2)Go to guilds table and press "Structure" tab and make an Image Print "ImgPnt button" and post here the picture please.

PS 500 posts :p xD
 
Last edited:
Now i have other problem... when player was going to die he was staying with 0 hp and didn't die. Error in console:
Code:
[07/01/2010 20:06:42]done ; )
 
Last edited:
What an error 0,o... xDD Done error haha. What's that?
What TFS version do you use?
 
I don't remember but I installed OTAL and then works perfect. I'm using 0.3.5pl1
 
For 0.3.5 say this in web...

Warning: include(wars.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\index.php on line 130

Warning: include() [function.include]: Failed opening 'wars.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\index.php on line 130
 
¿Have you checked if wars.php file exists in htdocs folder?
 
No no existia porque?

Cree uno y coloque lo que pusiste tu...

EDIT: DISCULPAME XAMPY ACABO DE VER Y EL PROBLEMA ERA QUE LO PUSE CON WARS.LUA NO WARS.PHP lol. Gracias.
 
Xampy,

I think the systems fails. When someone that is not in WAR (so guildless or another guild that aint in war) then the playes who are in WAR do get a Unjust kill.
So for example

Maro (Is in war)
Zalo (he is in war against Maro)
Nano (he aint not in war)

Maro and Nano kill Zalo then Nano get unjust ofc but Maro ALSO.
Bug??

PS: do you alrdy know a solution for the invite bug? :)
Regards,
Zakie
 
Zakie, about guilds.php
<change>
PHP:
if($invited->isOnline()) {
$guild_errors[] = 'You must logout the character <b>'.$player->getName().'</b> before accept the invitation.';
}
<with> Not tested
PHP:
if($player->isOnline()) {
$guild_errors[] = 'You must logout the character <b>'.$player->getName().'</b> before accept the invitation.';
}



\\ Testing second error //
EDIT:
I think the systems fails. When someone that is not in WAR (so guildless or another guild that aint in war) then the playes who are in WAR do get a Unjust kill.
So for example

Maro (Is in war)
Zalo (he is in war against Maro)
Nano (he aint not in war)

Maro and Nano kill Zalo then Nano get unjust ofc but Maro ALSO.
Bug??
I did it as you said, and it works fine for me :confused:.
What I did?

1) I logged in the 3 characters: Zhaoxin (in war against Xampy), Xampy (in war against Zhaoxin) & Test (no war | no guilds).
2) I attacked with Test and Xampy to Zhaoxin. Finally, we killed him and didn't get any frag in Xampy.
Test said:
Warning! The murder of Zhaoxin was not justified.
Xampy said:
Warning! The murder of Zhaoxin was not justified.
Frag from Zhaoxin wasn't counted.

And it's correct, it didn't count me any frag on Xampy's character.
 
Last edited:
Status
Not open for further replies.
Back
Top