Forum

> > CS2D > Scripts > Killer's Weapon
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Killer's Weapon

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Killer's Weapon

Marcell
Super User Off Offline

Zitieren
Welcome!

I would like to ask how can i get killer's weapon?
Mean when somebody kill someone with "this weapon"

tried with player(killer, "weapon") but won't work

alt Re: Killer's Weapon

Alistaire
User Off Offline

Zitieren
1
2
3
4
5
addhook('kill', '_killHook')

function _killHook(killer, victim, weapon)
	print(weapon)
end

alt Re: Killer's Weapon

Marcell
Super User Off Offline

Zitieren
Everything is works, but weapon's name don't want

1
2
3
4
5
6
7
8
9
addhook("kill", "adv_log", -9000)
function adv_log(id, killer, victim, weapon, x, y)
	local state, file = pcall(io.open, advancedlog .. os.date("%Y_%m_%d", os.time()) .. "-adv.log", "a+")
	if file then
	local file = io.open(""..advancedlog.."/adv.log", "a+")
	file:write("[" .. os.date("%H:%M:%S", os.time()) .. "]: #"..player(id, "usgn")..", "..player(id, "ip")..", "..player(killer, "name").." KILLED "..player(victim, "name").." WITH "..player(killer, "weapon").." AT "..player(victim,"x").." & "..player(victim,"y").." \n")
	file:close()
	end
end

alt Re: Killer's Weapon

Alistaire
User Off Offline

Zitieren
Also why would you want to io.open and io.close every time someone dies. This script will certainly shit on your server's speed.

alt Re: Killer's Weapon

Marcell
Super User Off Offline

Zitieren
exactly what i did now...
a log system...

which save player ip, name, usgn when he/she join with time and date

which save killer name, position, weapon, victim name with time and date

which save building name and position with time and date and who made it

and also a chatlog which saves every messages with time and date..

anway no.. not really, because it will be a roleplay server, where you can't kill without reason..

alt Re: Killer's Weapon

Yates
Reviewer Off Offline

Zitieren
user Marcell hat geschrieben
anway no.. not really, because it will be a roleplay server, where you can't kill without reason..

So if I am a psychopath and I kill people because I am mentally ill this would suffice, right?

Saddle up, men. Because either way I will bust your balls.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht