Restriction builder

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
68
28
45
Poland
I think I lost because I don't have idea how to check if player is in XX zones at same time and don't loop server.
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
68
28
45
Poland
I'would reply like you:

"Y"



What did you just wrote to me? xD I have functions ready, but I dont know how to check 10 zones at once and not loop server like your /wipecheck for example. PLEASE NEXT TIME READ CAREFULLY SO I'LL NOT WRITE ANYTHING TWICE AGAIN. . . . . Better, read whole topic from start so you'll remember where we are now.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,486
113
At your house.
github.com
I'would reply like you:

"Y"



What did you just wrote to me? xD I have functions ready, but I dont know how to check 10 zones at once and not loop server like your /wipecheck for example. PLEASE NEXT TIME READ CAREFULLY SO I'LL NOT WRITE ANYTHING TWICE AGAIN. . . . . Better, read whole topic from start so you'll remember where we are now.
Complete answer: Zone3D :p

I will go and do a Zone3D test, and test the copy cat plugin. Will reply with an example so you can use Zone3D and you don't have to for cycle
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,486
113
At your house.
github.com
Python:
__author__ = 'DreTaX'
__version__ = '1.0'
import clr

clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class ZoneTest:

    def On_Command(self, Player, cmd, args):
        if cmd == "create":
            zone = World.CreateZone("TestZoneee")
            #DataStore.Add("Zones", Player.SteamID, zone) Possible to use datastore
            Player.Message("Zone Created")
        elif cmd == "mark":
            #zone = DataStore.Get("Zones", Player.SteamID)
            zone = World.zones['TestZoneee']
            Server.Broadcast(str(zone))
            if len(zone.Points) == 0:
                zone.Mark(Player.X, Player.Y - 20.0)
                Player.Message("Zone needs " + str(4 - len(zone.Points)) + " more points")
            elif 0 < len(zone.Points) < 3:
                zone.Mark(Player.X, Player.Y)
                Player.Message("Zone needs " + str(4 - len(zone.Points)) + " more points")
            else:
                zone.Mark(Player.X, Player.Y + 20.0)
                #zone.ShowMarkers() Yay!.... Doesn't work because World.Spawn is broken -.- Issue reported
                Player.Message("Zone Created")
        elif cmd == "inzone":
            zone = World.zones['TestZoneee']
            Player.Message(str(zone.GlobalContains(Player)))
            Player.Message(str(zone.Contains(Player)))
        elif cmd == "points":
            zone = World.zones['TestZoneee']
            for p in zone.Points:
                Player.Message(str(p))


Oh well. I couldn't sort It out yet. It says I'm not in the zone for some reason. I have no idea why. I'm creating 4 points, but I think I'm not so OP in Vector2

mhm.

Python:
__author__ = 'DreTaX'
__version__ = '1.0'
import clr

clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class ZoneTest:

    def On_Command(self, Player, cmd, args):
        if cmd == "create":
            zone = World.CreateZone("TestZoneee3")
            #DataStore.Add("Zones", Player.SteamID, zone) Possible to use datastore
            Player.Message("Zone Created")
        elif cmd == "mark":
            #zone = DataStore.Get("Zones", Player.SteamID)
            zone = World.zones['TestZoneee3']
            Server.Broadcast(str(zone))
            if len(zone.Points) == 0:
                zone.Mark(Player.X, Player.Y + 10.0)
                Player.Message("Zone needs " + str(4 - len(zone.Points)) + " more points")
            elif 0 < len(zone.Points) < 3:
                zone.Mark(Player.X, Player.Y + 10.0)
                Player.Message("Zone needs " + str(4 - len(zone.Points)) + " more points")
            else:
                zone.Mark(Player.X, Player.Y + 10.0)
                #zone.ShowMarkers() Yay!.... Doesn't work because World.Spawn is broken -.- Issue reported
                Player.Message("Zone Created")
        elif cmd == "inzone":
            zone = World.zones['TestZoneee3']
            Player.Message(str(zone.GlobalContains(Player)))
            Player.Message(str(zone.Contains(Player)))
        elif cmd == "points":
            zone = World.zones['TestZoneee3']
            for p in zone.Points:
                Player.Message(str(p))
I think I missunderstand something. @mikec ?
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
68
28
45
Poland
Sorry I will work on it now. Expect it even today, and I will try to do it in C# with source in this topic to lookup.

It's easy plugin but hope that in C# it will be faster as possible for Rust.

One thing: Do Fougerite have function to reload plugin without restart?
 

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
Sorry I will work on it now. Expect it even today, and I will try to do it in C# with source in this topic to lookup.

It's easy plugin but hope that in C# it will be faster as possible for Rust.

One thing: Do Fougerite have function to reload plugin without restart?
Not for C#.
 
  • Like
Reactions: MasterPeace

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,486
113
At your house.
github.com
Sorry I will work on it now. Expect it even today, and I will try to do it in C# with source in this topic to lookup.

It's easy plugin but hope that in C# it will be faster as possible for Rust.

One thing: Do Fougerite have function to reload plugin without restart?
Python does. python.reload

The js engines do not have one currently.

C# cannot be reloaded, since Its hard to remove something from the assembly.
 
  • Like
Reactions: MasterPeace