Solved VIP++ + Home system for VIP players

To add a function no but to redistribute the work of someone else without permission yes
 
  • Agree
Reactions: Jakkee
And add one function is not criminal. Do not you think?
Well first off all remove this:
JavaScript:
        break;
        if(isVip(Player) == true || Player.Admin == true){
           
------>        switch(cmd){       <--------
    case "sethome":
    if(!Plugin.IniExists("data\\" + isVip(Player).SteamID + "-home")){
        var set = Plugin.CreateIni("data\\" + isVip(Player).SteamID + "-home");
        var zset = isVip(Player).Z;
 
Then try it. So far, thank you for the advice

I'll work on a unofficial VIP++ sethome plugin as a addon.
So far I got;
/home [name] (Teleports you home)
/homelist (Lists all your homes)
/delhome [name] (Removes a home)
/sethome [name] (Sets home)
I just need to know to read a config file from another plugin folder (VIPsettings)
@DreTaX or @balu92 do you know how to read a config file from another folder?
 
  • Like
Reactions: paskal
  • Like
Reactions: paskal
I'll work on a unofficial VIP++ sethome plugin as a addon.
So far I got;
/home [name] (Teleports you home)
/homelist (Lists all your homes)
/delhome [name] (Removes a home)
/sethome [name] (Sets home)
I just need to know to read a config file from another plugin folder (VIPsettings)
@DreTaX or @balu92 do you know how to read a config file from another folder?
that's what datastore is for
 
that's what datastore is for
I'll work on a unofficial VIP++ sethome plugin as a addon.
So far I got;
/home [name] (Teleports you home)
/homelist (Lists all your homes)
/delhome [name] (Removes a home)
/sethome [name] (Sets home)
I just need to know to read a config file from another plugin folder (VIPsettings)
@DreTaX or @balu92 do you know how to read a config file from another folder?
Cant you do:
JavaScript:
Data.GetConfigValue("pluginnamehere", "Settings", "sasas");


Edit: Its an ini cfg, okay nvm xD
 
I meant like
JavaScript:
var iniCfg = Plugin.GetIni("Settings");
    if (iniCfg.GetSetting("Config", "Enabled") == "False") {
Except the Config file is not at root/Fougerite/VIPaddon/VIPsettings
Its located at root/Fougerite/ VIP++/VIPsettings
You could try using
JavaScript:
var path = Util.GetRootFolder() + "\Fougerite\VIP++\VipSettings";
var ini = Plugin.GetIni(path);

Maybe that could work, i just peaked inside the plugin.cs

C#:
public IniParser GetIni(string path)
{
            path = ValidateRelativePath(path + ".ini");
            if (path == null)
                return null;
         
            if (File.Exists(path))
                return new IniParser(path);

            return null;
}

Give it a try
 
Just gave it a go plugin doesn't load when it the checking for vip is there:
JavaScript:
if(isVip(Player) == true || Player.Admin == true){
and this the function:
JavaScript:
function isVip(Player)
{
    var path = Util.GetRootFolder() + "\Fougerite\VIP++\VipSettings";
    var ini = Plugin.GetIni(path);
    if (ini.GetSetting("VipList", Player.SteamID) != null)
    {
        return true;
    }else{
        return false;
    }
}

If I remove the isVip(Player) line the plugin will load.
 
Just gave it a go plugin doesn't load when it the checking for vip is there:
JavaScript:
if(isVip(Player) == true || Player.Admin == true){
and this the function:
JavaScript:
function isVip(Player)
{
    var path = Util.GetRootFolder() + "\Fougerite\VIP++\VipSettings";
    var ini = Plugin.GetIni(path);
    if (ini.GetSetting("VipList", Player.SteamID) != null)
    {
        return true;
    }else{
        return false;
    }
}

If I remove the isVip(Player) line the plugin will load.
Can you do printscreen the result of this: Player.Message("asd: " + Util.GetRootFolder());
 
Can you do printscreen the result of this: Player.Message("asd: " + Util.GetRootFolder());

Nothing happens when I do /testbro
JavaScript:
function On_Command(Player, cmd, args) {
    if(cmd == "testbro") {
        Player.Message("asd: " + Util.GetRootFolder());
        }
    else {
    Player.message("Theres an error m8");
    }
}

Same with this

JavaScript:
function On_PluginInit() {
    Player.Message("asd: " + Util.GetRootFolder());
}