Instabuild

Is this a good idea?

  • Yess

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%

  • Total voters
    0
  • Poll closed .
Status
Not open for further replies.

MuffinButton696

New Member
Member
Oct 12, 2014
9
1
1
28
Parts Unknown
I posted this on Fougerite plugin request thinking it was also for pluton, so please dont get mad at me, noob mistake. also sorry for double post just didnt know if i was to leave post up there or make one down here.

name of this plugin would be instabuild, and some commands could be /instaall for the entire server, /instaadmin for admins, /instaoff to turn it off. what this would do would make it so it takes the exact ammount of resources from your inventory and put it into what you hit with a hammer. example: i put a wall up and hit it once with a hammer and it takes the 9 wood needed to upgrade and make it to lvl 1, same thing for lvl 2-lvl 6, but you have to have the materials required for it.
 

MuffinButton696

New Member
Member
Oct 12, 2014
9
1
1
28
Parts Unknown
im not one that does programming or anything like that, but to me it sounds like it changes the amount of resources that goes into the building part when using the hammer. I would create a backup file of everything then go and change that number around to different points and see what the results are, good way to test it.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,486
113
At your house.
github.com
I was messing around trying to find some sort of instabuild, but I got side tracked and can kinda get the SteamID of who placed the object. (Tried to create a destroy mod, But it just gives a random connected players steamid)
I saw a post that buildings no longer contain data about their owners, but the thing you are using seems to be correct.

How about trying BuildingPart.OwnerID instead of name?
 

Jakkee

Plugin Developer
Plugin Developer
Contributor
Jul 28, 2014
1,465
925
113
Australia
Yeah I tried that, It returns in an error. (Can't remember, I'll try again soon)
I think it has to do with finding the player, It finds a random connect players.
If it just me online it will return my ID and let me destroy it.
 

MuffinButton696

New Member
Member
Oct 12, 2014
9
1
1
28
Parts Unknown
I was messing around trying to find some sort of instabuild, but I got side tracked and can kinda get the SteamID of who placed the object. (Tried to create a destroy mod, But it just gives a random connected players steamid)
what about having it save the players steam id when they first join the server, then whenever they place a foundation it saves that foundation to their steam id. so their steam id and their foundations stay in a save file.its all plugin side and doesnt get owner info like it did before on legacy. your make the owner info basicly. im still new to plugins and dont know how it all works, so forgive me if im wrong.
 

Jakkee

Plugin Developer
Plugin Developer
Contributor
Jul 28, 2014
1,465
925
113
Australia
what about having it save the players steam id when they first join the server, then whenever they place a foundation it saves that foundation to their steam id. so their steam id and their foundations stay in a save file.its all plugin side and doesnt get owner info like it did before on legacy. your make the owner info basicly.
Well a steam id Plus location for each entity...
Some servers have 60,000-70,000 Entitys before they wipe.(Legacy)
And Experimental handles Entitys better so that list would be longer.
So if I did /destroy and hit an object it would have to scan through 60k lines of text just to see if I placed it
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,486
113
At your house.
github.com
Returns some Iu64 error.
Try something shitty like this.

Python:
def GetPlayer(self, namee):
        name = namee.lower()
        for pl in Server.ActivePlayers:
            Server.Broadcast("Name that we found: " + str(pl.Name.lower()))
            if pl.Name.lower() == name:
                return pl
        return None

name = str(BuildingEvent.BuildingPart.OwnerName)
foundplayer = self.GetPlayer(name)
if foundplayer is None:
   #Broadcast null
Server.Broadcast("We got: " + foundplayer.Name)
 

balu92

Moderator
Moderator
Jul 11, 2014
338
75
28
33
Try something shitty like this.

Python:
def GetPlayer(self, namee):
        name = namee.lower()
        for pl in Server.ActivePlayers:
            Server.Broadcast("Name that we found: " + str(pl.Name.lower()))
            if pl.Name.lower() == name:
                return pl
        return None

name = str(BuildingEvent.BuildingPart.OwnerName)
foundplayer = self.GetPlayer(name)
if foundplayer is None:
   #Broadcast null
Server.Broadcast("We got: " + foundplayer.Name)
BuildingPart.OwnerName is always: ""
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,486
113
At your house.
github.com
Hmmm

Then the only thing you can do is saving the Entity's location under the player's ID on building, and then later checking if he owns it by the location.
 

Jakkee

Plugin Developer
Plugin Developer
Contributor
Jul 28, 2014
1,465
925
113
Australia
Hmmm

Then the only thing you can do is saving the Entity's location under the player's ID on building, and then later checking if he owns it by the location.
I wonder how a server would handle a 50k lined text file.
(I might test this)
 

balu92

Moderator
Moderator
Jul 11, 2014
338
75
28
33
Hmmm

Then the only thing you can do is saving the Entity's location under the player's ID on building, and then later checking if he owns it by the location.
I think we can make it not always to be that way...
 
Status
Not open for further replies.