• 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.
whole edit: i'm trying to convert this script to 0.2(luasql one) but have some problem when i say /war-invite Absolut it says that my guild is already in war or have a pending invitation ... any1 know the reason ? and i'm not in any war i checked /war-cancel-invite and /war-reject ...
it means that this is returning false instead of true
Code:
	if GuildIsInPEace(invitedGuild) == TRUE then
									doInviteToWar(myGuild, invitedGuild)
									doBroadcastMessage(BroadCast[1[1]..getPlayerGuildName(cid).. BroadCast[1][2] ..getGuildNameById(invitedGuild).. BroadCast[1][3], BroadCast_Type)
								else

function doInviteToWar(myGuild, enemyGuild)
	db.executeQuery("UPDATE `guilds` SET `invited_to` = ".. enemyGuild .." WHERE `id` = ".. myGuild .."")
	db.executeQuery("UPDATE `guilds` SET `invited_by` = ".. myGuild .." WHERE `id` = ".. enemyGuild .."")
end
function GuildIsInPEace(id)
	local Info = getGuildWarInfo(id)
	return (Info.To == 0 and Info.By == 0 and Info.With == 0)
end
function getGuildWarInfo(id)
	local Info = db.getResult("SELECT `invited_to`, `invited_by`, `in_war_with`,`war_time` FROM `guilds` WHERE `id` = " .. id .. "")
	if Info:getID() ~= LUA_ERROR then
		local invTo, invBy, warWith, Time = Info:getDataInt("invited_to"), Info:getDataInt("invited_by"), Info:getDataInt("in_war_with"), Info:getDataInt("war_time") 
		Info:free()
		return {To = invTo, By = invBy, With = warWith, T = Time}
	end
 	return LUA_ERROR
end
 
Last edited:
@Azuk:
You need Xampp to use phpMyAdmin. If you already have Xampp program, you can access to phpMyAdmin by -> phpMyAdmin


@Pietia:
Hmmm, I think you must change all those "Info:getID()", "db.executeQuery", etc. Cos' I think that TFS 0.2 doesn't have those functions.
 
Last edited:
Ooh, there's nothing missing. I didn't know that you were using that script. I'll take a look then and I'll try to fix those errors.
 
@Xampy i know, i have xampp and i entered to localhost/phpmyadmin but where exactly i have to put that code 0.0 in the database where accounts, character etc..? where? sry for bothering you Xampy, i really want this :D
 
When you are in the database of the server (let me call it 'otserv'), then will appear a lot of tables (accounts, bans, players, player_items, player_storage, etc.) then, on the top-middle, you will see some buttons like 'Examine', 'Structure', 'Search', 'SQL',... Then press on SQL and there you copy into the box:
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 ;

 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 
) ENGINE = MYISAM ;
And press Continue. Done!

Regards.
 
The command /war-challenge doesn't work for the moment. I'm trying to repair that bug and some bugs more. Thanks.

Regards.

EDIT: Oooh, frags won't count if you kill someone that is versus you. It will count if you kill someone that is not versus you and after that you kill someone that is in war with you.

Example:
Player 1 (in war with guild of Player 2)
Player 2 (in war with guild of Player 1)
Player 3 (he's not in any war)
.................................
Player 1 kills Player 2 [It won't count a frag]
Player 2 kills Player 1 [It won't count a frag]
Player 1 kills Player 3 [It will count as a frag] and after that, if Player 1 already has PZ and Player 1 kills Player 2 [It will count as another frag (bug)]

That's a bug that I will repair soon, like others...
 
Last edited:
but i kill someone that is versus me(im in war with him) and it count me a frag dont know why i just did this

Leader of War of Hell: /war-invite The noobs
Leader of The noobs: /war-accept

and it says that im in war and all but dont know why it count the frags :S
 
Did you added the scripts that must go on creaturescripts folder, etc? (steps 2.0~2.3)
 
yes war_kill and war_attack, i added all script including php script for the page
 
I use them and it works like I said. I don't know why it doesn't work to you, check them another time, if not... I don't know. Anyway I'll improve them in a short time.

Regards.
 
Little problem here!

Fatal error: Call to a member function query() on a non-object in C:\xampp\htdocs\OT\wars.php on line 50

this is the line

PHP:
$wars = $SQL->query("SELECT g.name AS gname, wg.name AS wgname, g.war_time AS gtime, g.kills AS kills, wg.kills AS ekills, g.show AS s, g.id AS gid, wg.id AS wgid FROM guilds AS g INNER JOIN guilds AS wg ON wg.id = g.in_war_with ORDER BY s DESC LIMIT 50;");
 
@Xampy:
ok ill wait :) another thing is is not counting the kills in the page

look this
Guild V/s Guild Started at Kills
The Noobs V/s The Pendejos 2/07/09 09:10:43 0 - 0

when i click on the guild it say this error in the page
The Following Errors Have Occurred:
# Guild with ID 0 doesn't exist.

tried making the guild by the command !createguild The noobs and
 
Last edited:
@Azuk:
I posted on main thread the file .PHP for htdocs for people who use 0.3.4 and have the error "Guild with ID 0 doesn't exist...". And it may count the kills... :S

@Pietia:
No, I don't. I'm making mine OTServer too and I don't have too many free time. I'll try it, maybe, today, or tomorrow.


Regards.
 
Xampy solo por curiosidad por que cambiaste los php? lo unico que necesitabas era editar los pot xD
 
Sup i need to request a script for an infinite aol please i rlly need help with this script =/
 
@Xampy yo no tengo 0.3.4 mi server es
The Forgotten Server, version 0.3.1 (Crying Damson)

trate ese php script de 0.3.4 y aora cuando le doy al Guild sale este error
Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.
Error 404
pendejo.no-ip.org
07/02/09 11:29:15
Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5
 
Last edited:
Status
Not open for further replies.
Back
Top