• 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!

[Gesior acc. maker][TFS 0.3]Powergamers and online time stats

Gesior you should make War system

Accepting/inviting peoples to war with website(Gesiors)
-guilds can invite others guilds to war.
-if they are in war, they dont get frags.
-deaths in wars are registered.
-web show pending invitations and scores.
 
Gesior you should make War system

Accepting/inviting peoples to war with website(Gesiors)
-guilds can invite others guilds to war.
-if they are in war, they dont get frags.
-deaths in wars are registered.
-web show pending invitations and scores.

yes i need tooo
 
LUA script to count team and player frags:
Lua:
local fragTime = getConfigInfo('timeToDecreaseFrags')

function onKill(cid, target)
	local team = 0
	local id = 0
	if isPlayer(target) == TRUE and getPlayerGuildId(cid) > 0 and getPlayerGuildId(target) > 0 then
		local inWar_team1 = db.getResult("SELECT * FROM `wars_list` WHERE `team_1` like '%".. getPlayerGuildId(cid) ..",%' AND `team_2` like '%".. getPlayerGuildId(target) ..",%';")
		if(inWar_team1:getID() ~= -1) then
			id = tonumber(inWar_team1:getDataInt("id"))
			team = 1
			inWar_team1:free()
		else
			local inWar_team2 = db.getResult("SELECT * FROM `wars_list` WHERE `team_1` like '%".. getPlayerGuildId(target) ..",%' AND `team_2` like '%".. getPlayerGuildId(cid) ..",%';")
			if(inWar_team2:getID() ~= -1) then
				id = tonumber(inWar_team1:getDataInt("id"))
				team = 2
				inWar_team2:free()
			end
		end
		if team > 0 then
			db.executeQuery("INSERT INTO `war_deaths` (`war_id`, `team`, `from_guild`, `to_guild`, `player_id`, `killed_by`) VALUES (" .. id .. ", " .. team .. ", " .. getPlayerGuildId(cid) .. ", " .. getPlayerGuildId(target) .. ", " .. getPlayerGUID(target) .. ", " .. getPlayerGUID(cid) .. ");")
			doPlayerSetRedSkullTicks(cid, getPlayerRedSkullTicks(cid)-fragTime)
		end
	end
	return TRUE
end
PHP:
CREATE TABLE IF NOT EXISTS `wars_list` (
  `id` int(11) NOT NULL auto_increment,
  `team_1` varchar(255) NOT NULL,
  `team_2` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
);
CREATE TABLE IF NOT EXISTS `war_deaths` (
  `war_id` int(11) NOT NULL,
  `team` int(11) NOT NULL,
  `from_guild` int(11) NOT NULL default '0',
  `to_guild` int(11) NOT NULL default '0',
  `player_id` int(11) NOT NULL default '0',
  `killed_by` int(11) NOT NULL default '0'
);
Example of war:
PHP:
INSERT INTO `wars_list` (`id`, `team_1`, `team_2`) VALUES
(1, '3,', '38,');
(guild ID 3 vs. guild ID 38)
PHP:
INSERT INTO `wars_list` (`id`, `team_1`, `team_2`) VALUES
(1, '3,6,', '38,23,');
(guild ID 3 and guild ID 6 vs. guild ID 38 and guild ID 23 )
Always "," at end of guilds list.
Script save info:
PHP:
INSERT INTO `war_deaths` (`war_id`, `team`, `from_guild`, `to_guild`, `player_id`, `killed_by`) VALUES
(1, 1, 3, 38, 17797, 15422),
(1, 1, 3, 38, 17797, 15422);
1 - war id = 1
1 - frag for team 1
3 - killer was from guild id 3
38 - killed player was from guild id 38
17797 - id of killed player
15422 - id of killer
with this table you can generate any stats of war.. like:
- top 5 fragers from 1 team (or 1 guild)
PHP:
SELECT `players`.`name`, COUNT(`war_deaths`.`killed_by`) frags FROM `war_deaths`, `players` WHERE `war_deaths`.`war_id` = 1 AND `players`.`id` = `war_deaths`.`killed_by` AND `war_deaths`.`team` = 1 GROUP BY `war_deaths`.`killed_by` ORDER BY COUNT(`war_deaths`.`killed_by`) DESC
phpmyadmin said:
name, frags
Un Death Druid, 9
- number of frags of teams from 'war id 1'
PHP:
SELECT `team`, COUNT(`war_deaths`.`team`) frags FROM `war_deaths` WHERE `war_deaths`.`war_id` = 1 GROUP BY `war_deaths`.`team` ORDER BY COUNT(`war_deaths`.`team`) DESC
phpmyadmin said:
team, frags
1, 9
Script remove frags (can't get more then 1 frag if kill only enemy team members)

Now someone must write PHP scripts to invite guilds and show stats on page.
 
:OOOOOOOOOOOOOOOO my fucking gosh!!!!!!!!!! Gesior do it again! xd
Really rox man :D
 
so now wainting only to release PHP ;D
Maaaybe I'll release PHP script, but I don't know how should it work :>
Guild leader 'create war' (invite other guild) [Status: Inactive]. When enemy guild leader accept invitation war start [Status: Active - script count frags]. Now guild leaders can invite other guilds (if these guilds don't have war against any guild from this war in other war). Guilds can't leave war. GOD/GM end war (set 'active' = 2 in database in table 'wars_list').
???
-----------
One guild can fight against other guild only in one war.
 
I love 'no edit' option on forum :)
First page:
war1gz2.jpg

(players sorted by level)
Page show 9 : 0 and one player with one frag. It's because one guild who had 8 frags and was in team 1 'deleted' (guild manager). Deleted guilds aren't on guilds in teams list (GROM, Enklawa - 9 : 0 - Swieta Inkwizycja, Undeath Army, Art of War) and players from guild are not showed on list of players, but frags stay.
------------
What should I add to page with info about war? Top 5 fraggers? Last 5 frags?
 
lua script to count team and player frags:
Lua:
local fragtime = getconfiginfo('timetodecreasefrags')

function onkill(cid, target)
	local team = 0
	local id = 0
	if isplayer(target) == true and getplayerguildid(cid) > 0 and getplayerguildid(target) > 0 then
		local inwar_team1 = db.getresult("select * from `wars_list` where `team_1` like '%".. Getplayerguildid(cid) ..",%' and `team_2` like '%".. Getplayerguildid(target) ..",%';")
		if(inwar_team1:getid() ~= -1) then
			id = tonumber(inwar_team1:getdataint("id"))
			team = 1
			inwar_team1:free()
		else
			local inwar_team2 = db.getresult("select * from `wars_list` where `team_1` like '%".. Getplayerguildid(target) ..",%' and `team_2` like '%".. Getplayerguildid(cid) ..",%';")
			if(inwar_team2:getid() ~= -1) then
				id = tonumber(inwar_team1:getdataint("id"))
				team = 2
				inwar_team2:free()
			end
		end
		if team > 0 then
			db.executequery("insert into `war_deaths` (`war_id`, `team`, `from_guild`, `to_guild`, `player_id`, `killed_by`) values (" .. Id .. ", " .. Team .. ", " .. Getplayerguildid(cid) .. ", " .. Getplayerguildid(target) .. ", " .. Getplayerguid(target) .. ", " .. Getplayerguid(cid) .. ");")
			doplayersetredskullticks(cid, getplayerredskullticks(cid)-fragtime)
		end
	end
	return true
end
PHP:
create table if not exists `wars_list` (
  `id` int(11) not null auto_increment,
  `team_1` varchar(255) not null,
  `team_2` varchar(255) not null,
  primary key  (`id`)
);
create table if not exists `war_deaths` (
  `war_id` int(11) not null,
  `team` int(11) not null,
  `from_guild` int(11) not null default '0',
  `to_guild` int(11) not null default '0',
  `player_id` int(11) not null default '0',
  `killed_by` int(11) not null default '0'
);
example of war:
PHP:
insert into `wars_list` (`id`, `team_1`, `team_2`) values
(1, '3,', '38,');
(guild id 3 vs. Guild id 38)
PHP:
insert into `wars_list` (`id`, `team_1`, `team_2`) values
(1, '3,6,', '38,23,');
(guild id 3 and guild id 6 vs. Guild id 38 and guild id 23 )
always "," at end of guilds list.
Script save info:
PHP:
insert into `war_deaths` (`war_id`, `team`, `from_guild`, `to_guild`, `player_id`, `killed_by`) values
(1, 1, 3, 38, 17797, 15422),
(1, 1, 3, 38, 17797, 15422);
1 - war id = 1
1 - frag for team 1
3 - killer was from guild id 3
38 - killed player was from guild id 38
17797 - id of killed player
15422 - id of killer
with this table you can generate any stats of war.. Like:
- top 5 fragers from 1 team (or 1 guild)
PHP:
select `players`.`name`, count(`war_deaths`.`killed_by`) frags from `war_deaths`, `players` where `war_deaths`.`war_id` = 1 and `players`.`id` = `war_deaths`.`killed_by` and `war_deaths`.`team` = 1 group by `war_deaths`.`killed_by` order by count(`war_deaths`.`killed_by`) desc

- number of frags of teams from 'war id 1'
PHP:
select `team`, count(`war_deaths`.`team`) frags from `war_deaths` where `war_deaths`.`war_id` = 1 group by `war_deaths`.`team` order by count(`war_deaths`.`team`) desc

script remove frags (can't get more then 1 frag if kill only enemy team members)

now someone must write php scripts to invite guilds and show stats on page.



omg !!!!!!!!!! Fucing rox gesior are !!!!!!! Man gesior are best understand ? Besssssssst !!!!!!!!!!!!!
 
help please... i get this error when i try to load my charinfo page


Fatal error: Cannot redeclare ispremium() (previously declared in C:\Program Files\Xampp\htdocs\config-and-functions.php:79) in C:\Program Files\Xampp\htdocs\config-and-functions.php on line 82
 
Hey I have Problem..
Everything I make according to instruction
But when I press click on part.. Error shows on screen me.


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

Warning: include() [function.include]: Failed opening 'exphist.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\index.php on line 195

i don't know what i doing now ?

Sorry for my english..

PS. Poprostu robie wszystko zgodnie z twoimi poadnikami i wyskakuje mi ten bład gdy klikam na stronie w menu "History Experience"
 
Back
Top