HomeSet [Deleted]

Status
Not open for further replies.

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
928
113
Australia
Jakkee submitted a new resource:

Basic Home TP - Has the basics covered

Description:
Simple plugin to set a home and teleport to it

Installation:
-Place into plugins folder
-Reload (Creates the INI file for the locations to be saved)

Commands:
/home (Shows help)
/home [name] (Teleports you hone)
/sethome [name] (Sets a home)
/delhome [name] (deletes a home)

To do:
Maybe add more things to it.

*NOTE, Once DreTaX brings his HomeSystem i will stop updating this*
Read more about this resource...
 

[ETH] p996t2

New Member
Member
Oct 12, 2014
16
0
1
46
Parts Unknown
Good idea, just suggest you to provide config var to limit the number of tp location.
One location for player is enought, multiple location for admins.
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
928
113
Australia
Good idea, just suggest you to provide config var to limit the number of tp location.
One location for player is enought, multiple location for admins.
I originally had it at 1 home max.
I'll just add a settings file where you can add a cool down & max homes.
 

SuB_- Revolt

Member
Member
Oct 10, 2014
49
3
8
32
Canada
revoltservers.com
Does it work for you guys? I for some reason have all commands working when typing /home, but when I /sethome Home1, it does not do anything, and I can not teleport to home by typing the right command. Just checking.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,091
4,767
113
At your house.
github.com
Does it work for you guys? I for some reason have all commands working when typing /home, but when I /sethome Home1, it does not do anything, and I can not teleport to home by typing the right command. Just checking.
I guess It's because of the 1 in the home word. Python is really sensitive on these.

I originally had it at 1 home max.
I'll just add a settings file where you can add a cool down & max homes.
To fix this Jakkee try putting

Python:
name = command.quotedArgs[0]

#to

name = str(command.quotedArgs[0])


#It's also safe to put (I'm not sure in the new iniparser)
command.User.Location # into str() also.
 
  • Like
Reactions: Louis

RedDevil6193

New Member
Member
Oct 11, 2014
20
2
3
38
I guess It's because of the 1 in the home word. Python is really sensitive on these.


To fix this Jakkee try putting

Python:
name = command.quotedArgs[0]

#to

name = str(command.quotedArgs[0])


#It's also safe to put (I'm not sure in the new iniparser)
command.User.Location # into str() also.
I replaced 3 lines of code with what you said and then plugin didnt load it gave whole bunch of errors so idk may be something else.
Also i m running .4 version of pluton would it have something to do with that?
 

SuB_- Revolt

Member
Member
Oct 10, 2014
49
3
8
32
Canada
revoltservers.com
Confirmed bugs I have with the latest Pluton Update on the server:
- All sethome commands works, but when players /home NAME, it says You are now in Home, but they did not get teleport
 

RedDevil6193

New Member
Member
Oct 11, 2014
20
2
3
38
whenver i type /home dd /home gg without even adding them it says teleing to that but doesnt do anything, and when i /delhome anything it says removed but i can keep doing it and it keeps saying it deleting.
 
  • Agree
Reactions: SuB_- Revolt

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
928
113
Australia

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,091
4,767
113
At your house.
github.com
Homes are saved into a INI file. Only will lose the locations if you delete this file.

Also I have fixed setting a home and teleporting to it.
Just need to know how to convert String to Vector3, I'm going to have to play around with it.
Not hard. Well It Should work XD


Python:
import clr
clr.AddReferenceByPartialName("UnityEngine")
clr.AddReferenceByPartialName("Pluton")
import Pluton
import UnityEngine
from UnityEngine import *

class Nigeria: 

    def HomeOf(self, Player, Home)
        ini = Homes()
        check = ini.GetSetting(Player.SteamID, Home)
        if check is not None:
            c = check.replace("(", "")
            c = c.replace(")", "")
            return c.split(",")
        return None
     
    def CreateVector3(self, x, y, z):
        return Vector3(float(x), float(y), float(z))
     
    def TestCommandThing(self):
        loc = self.CreateVector3(x, y, z)
 

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
Not hard. Well It Should work XD


Python:
import clr
clr.AddReferenceByPartialName("UnityEngine")
clr.AddReferenceByPartialName("Pluton")
import Pluton
import UnityEngine
from UnityEngine import *

class Nigeria:  

    def HomeOf(self, Player, Home)
        var ini = Homes()
        var check = ini.GetSetting(Player.SteamID, Home)
        if check is not None:
            c = check.replace("(", "")
            c = c.replace(")", "")
            return c.split(",")
        return None
      
    def CreateVector3(self, x, y, z):
        return Vector3(x, y, z)
      
    def TestCommandThing(self):
        loc = self.CreateVector3(x, y, z)
make sure those are floats
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
Code:
Teleport()
instead of
Code:
TeleportTo()
^currently doesn't exist according to Pluton GitHub unless its ANOTHER missing item from there...
 

RedDevil6193

New Member
Member
Oct 11, 2014
20
2
3
38
Not hard. Well It Should work XD


Python:
import clr
clr.AddReferenceByPartialName("UnityEngine")
clr.AddReferenceByPartialName("Pluton")
import Pluton
import UnityEngine
from UnityEngine import *

class Nigeria: 

    def HomeOf(self, Player, Home)
        var ini = Homes()
        var check = ini.GetSetting(Player.SteamID, Home)
        if check is not None:
            c = check.replace("(", "")
            c = c.replace(")", "")
            return c.split(",")
        return None
     
    def CreateVector3(self, x, y, z):
        return Vector3(float(x), float(y), float(z))
     
    def TestCommandThing(self):
        loc = self.CreateVector3(x, y, z)
Where do i put that in the code pls, i m very noob and i want this home plugin.
 
  • Funny
Reactions: SuB_- Revolt

sendjes

New Member
Member
Sep 1, 2014
15
0
1
Denmark
Thank you for your contribution, but I also have the same issue as this:
whenver i type /home dd /home gg without even adding them it says teleing to that but doesnt do anything, and when i /delhome anything it says removed but i can keep doing it and it keeps saying it deleting.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,091
4,767
113
At your house.
github.com
Thank you for your contribution, but I also have the same issue as this:
Where do i put that in the code pls, i m very noob and i want this home plugin.
I hope Jakkee won't kill me, but something like this should work:

Python:
__title__ = 'Homes'
__author__ = 'JAKKEE'
__version__ = '1.0'

import clr
from System import *
clr.AddReferenceByPartialName("UnityEngine")
clr.AddReferenceByPartialName("Pluton")
import UnityEngine
from UnityEngine import *
import Pluton


class Homes:
    def On_PluginInit(self):
        Util.ConsoleLog(__title__ + " by " + __author__ + " Version: " + __version__ + " loaded.", False)
        if not Plugin.IniExists("Homes"):
            Plugin.CreateIni("Homes")
            ini = Plugin.GetIni("Homes")
            ini.AddSetting("(STEAMID)", "(LOCATION NAME)", "(LOCATION)")
            ini.AddSetting("(STEAMID)", "(LOCATION)", "(LOCATION NAME)")
            ini.Save()

    def On_Command(self, command):
        if command.cmd == "home":
            if len(command.args) == 0:
                command.User.Message("--------------SETHOME BY " + __author__ + "-------------")
                command.User.Message("usage: /home - Shows the help")
                command.User.Message("usage: /home [name] - Teleports you home")
                command.User.Message("usage: /sethome [name] - Sets a home")
                command.User.Message("usage: /delhome [name] - Deletes home")
                command.User.Message("*REPORT ANY BUGS TO: " + __author__ + "*")
                command.User.Message("--------------------------------------------")
            elif len(command.args) == 1:
                name = command.quotedArgs[0]
                ini = Plugin.GetIni("Homes")
                pyid = command.User.SteamID
                coords = ini.GetSetting(pyid, name)
                if coords is None:
                    command.User.Message("Can not find: " + name)
                    return
                else:
                    split = self.HomeOf(pyid, name)
                    loc = self.CreateVector3(split[0], split[1], split[2])
                    command.User.Message("You arrived at: " + name)
                    command.User.TeleportTo(loc)
        elif command.cmd == "sethome":
            if len(command.args) == 0:
                command.User.Message("usage: /sethome [name]")
            elif len(command.args) == 1:
                name = command.quotedArgs[0]
                pyid = command.User.SteamID
                ini = Plugin.GetIni("Homes")
                ini.AddSetting(command.User.SteamID, name, command.User.Location)
                ini.AddSetting(command.User.SteamID, "location", name)
                ini.Save()
                command.User.Message("Location: " + name + " saved!")
            elif len(command.args) > 1:
                command.User.Message("You are not allowed to use spaces!")
        elif command.cmd == "delhome":
            if len(command.args) == 0:
                command.User.Message("usage: /delhome [name]")
            elif len(command.args) == 1:
                name = command.quotedArgs[0]
                pyid = command.User.SteamID
                ini = Plugin.GetIni("Homes")
                current = ini.GetSetting(pyid, name)
                if current is not None:
                    ini.DeleteSetting(command.User.SteamID, name)
                    ini.DeleteSetting(command.User.SteamID, "location")
                    ini.Save()
                    command.User.Message("You deleted: " + name)
                    return
                else:
                    command.User.Message("Location " + name + " does not exist")
            elif len(command.args) > 1:
                command.User.Message("You can not use spaces")
    def CreateVector3(self, x, y, z):
        return Vector3(float(x), float(y), float(z))
       
    def HomeOf(self, id, Home):
        ini = Plugin.GetIni("Homes")
        check = ini.GetSetting(id, Home)
        if check is not None:
            c = check.replace("(", "")
            c = c.replace(")", "")
            return c.split(",")
        return None
 
Status
Not open for further replies.