Forum

> > CS2D > Scripts > Gatefield turns neutral
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Gatefield turns neutral

1 Antwort
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Gatefield turns neutral

Promaster
User Off Offline

Zitieren
I am currently working on a project thats creates a gatefield whereever a player moves, and i need something that makes players gatefields turns to neutral gatefield whenever the player leaves or change team to spectator.

I don't know if there is any command that can solve this issue easily, but i can't find it in cs2d.com/help/

A player with over 300 gatefields will flood the server and kicks other players in the server when they leaves and the gatefields get automatically removed. That's why I am asking if there is any command or script that turns the players gatefield to neutral when they leaves without flooding the server.

alt Re: Gatefield turns neutral

Masea
Super User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
addhook("leave","_leave")
function _leave(id)
    for k, v in pairs(object(0,"table")) do
        if object(v,"player") == id and object(v,"type") == 6 then
            local x, y = object(v,"tilex"), object(y,"tilex")

            parse("killobject "..v)

            parse("spawnobject 6 "..x.." "..y.." 0 0 0 0")
        end
    end
end
I didn't test it. And I must say, if there's a player who made over 300 gatefields, the code would cause lag indeed.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht