Forum

> > CS2D > General > turret for DM
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch turret for DM

14 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt turret for DM

JONY
User Off Offline

Zitieren
Is it possible to make so that a turret attacks everyone except the player who created it? It can be effectively used with Deathmatch mod

I assume that currently, that as soon as the turret sees a player it checks whether he is T or CT and decides to shoot or not, but it would be cool to make so that it checks player's id and decides to kill this player or not.

Regards,
J.

alt Re: turret for DM

SRAN
User Off Offline

Zitieren
whta do you mean it already done in deathmatch mode this dont make sence

alt Re: turret for DM

JONY
User Off Offline

Zitieren
Oh sorry, didnt say it correctly.
I want the turret to attack everyone (except the creator) in TEAM deathmatch mode
(it sounds pointless, but it's still cool, can be used for mods)

alt Re: turret for DM

JONY
User Off Offline

Zitieren
Well, i kind of tried to do it with lua:
Spoiler >


Or should i rather post it in Lua thread?

alt Re: turret for DM

Surplus
User Off Offline

Zitieren
Yes, post it in the lua section.
And it is possible. If the player builds the turret, make it neutral on HIS NAME!

alt Re: turret for DM

JONY
User Off Offline

Zitieren
Wow thanx PartyPooPer... that seems to be the complete solution
gonna do it now

Edit: Shiiiiit. The neutral turret attacks your teammates but doesnt do any damage. I tried also doing that the turret is completely neutral (not built by you), but in that case it kills you as well (but that's to be expected)

I tried to make it so that with lua script turret also takes away hp from your teammates:
1
2
3
4
5
6
7
8
9
10
11
addhook("second","turret")
function turret()
	if (object(12,"exists") and object(12,"target") ~= 0 and object(12,"target") ~= object(12,"player"))  then
		local id = object(12,"target")
		if (player(id,"health")+10)>10 then
			parse("sethealth "..id.." "..player(id,"health")-10)
		else
			parse("customkill "..id.." Turret "..id)
		end
	end
end

But for some reason it tells me that player(id,"health") is a boolean and i cant perform arithmetic operations on it i thought it returns player's health. Can anyone help?
1× editiert, zuletzt 10.12.10 22:38:15

alt Re: turret for DM

SRAN
User Off Offline

Zitieren
in a rp server i saw white colored buildings it dont attack it dont make anything even the wall if you hit it it wont explode how is this possible

alt Re: turret for DM

Phe0
User Off Offline

Zitieren
Just if you are admin, you can spawn objects, like
/spwanobject <type of object> <TileX> <TileY> <rotation> <mode (Like a supply, by selecting 1 you're making supply, which is making 1st weapon from list) <team (here are only 3 normal 0 - neutral, and 1,2 (tt or ct), more than 2 makes them white) <PlayerID>
That's all about white ones.
That lua will be cool.

alt Re: turret for DM

Vectarrio
User Off Offline

Zitieren
JONY hat geschrieben
Shiiiiit. The neutral turret attacks your teammates but doesnt do any damage. I tried also doing that the turret is completely neutral (not built by you), but in that case it kills you as well (but that's to be expected)

turn off friendlyfire

alt Re: turret for DM

SRAN
User Off Offline

Zitieren
Pho hat geschrieben
Just if you are admin, you can spawn objects, like
/spwanobject <type of object> <TileX> <TileY> <rotation> <mode (Like a supply, by selecting 1 you're making supply, which is making 1st weapon from list) <team (here are only 3 normal 0 - neutral, and 1,2 (tt or ct), more than 2 makes them white) <PlayerID>
That's all about white ones.
That lua will be cool.

uh i dont understand i think i should see it in commands

alt Re: turret for DM

JONY
User Off Offline

Zitieren
Vectar666 hat geschrieben
turn off friendlyfire


doesnt work, i can kill teammates, but the turret doesnt (even though it shoots them but doesnt do any damage)

7agarrr hat geschrieben
even the wall if you hit it it wont explode how is this possible


put this into your server.lua file:
1
2
3
4
addhook("objectdamage","nodamage")
function nodamage()
	return 1
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht