Looking for a Plug in..

New Member
Joined
Sep 8, 2009
Messages
9
Best answers
0
Some guy today told me that there is some "KI auto Saver", which saves your KI so you can transform next time you connect, i didn't belive this...but still...if there is one can some one give me a link or where to search for it....
P.S : I already searched the Forum, and google for over 3 times and i didn't get any results which had the Plug in.
~Thanks
 
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
Doesnt exist as a pluggin itself

It is part of ECX though.
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
I might create one. Wait a day or two please.
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
Okay, this seems to work but there is a disadvantage - beam damage and radius is screwed up (because of changing powerlevel offset).
Code:
#include <amxmodx>
#include <fakemeta>
#include <nvault>

#define MAX_CLASSES 9 + 1

new const g_Commands[][] =
{
	"spectate",
	"buu",
	"goku",
	"gohan",
	"krillin",
	"frieza",
	"piccolo",
	"trunks",
	"vegeta",
	"cell",
	"ramdompc"
};

new const g_Models[MAX_CLASSES][] =
{
	"",

	"fatbuu",
	"goku",
	"gohan",
	"krillin",
	"frieza",
	"piccolo",
	"trunks",
	"vegeta",
	"cell"
};

new const g_StartingPowerlevels[MAX_CLASSES] =
{
	0,

	1250000,
	750000,
	600000,
	600000,
	800000,
	650000,
	650000,
	700000,
	900000
};

new const Float:g_AscendMutlipliers[MAX_CLASSES] =
{
	0.0,

	1.5,
	2.0,
	2.0,
	2.0,
	1.5,
	1.5,
	2.0,
	2.0,
	1.5
};

new const g_Vault[] = "plsave";

new bool:g_FirstSpawn[33][MAX_CLASSES];

public plugin_init()
{
	register_plugin("PL Save", "1.3", "hleV");

	register_clcmd("fullupdate", "FullUpdate");

	for (new Slot = 0; Slot < sizeof(g_Commands); Slot++)
		register_clcmd(g_Commands[Slot], "ClassChange");

	register_event("ResetHUD", "ResetHUD", "be");
}

public ClassChange(Client)
	for (new Slot = 1; Slot < MAX_CLASSES; Slot++)
		g_FirstSpawn[Client][Slot] = true;

public client_disconnect(Client)
	SavePowerlevel(Client);

public FullUpdate()
	return PLUGIN_HANDLED;

public ResetHUD(Client)
{
	static Class;
	Class = GetClass(Client);

	if (!g_FirstSpawn[Client][Class])
		return;

	LoadPowerlevel(Client);

	g_FirstSpawn[Client][Class] = false;
}

LoadPowerlevel(Client)
{
	static Class;
	Class = GetClass(Client);

	if (!Class)
		return;

	static Vault;
	Vault = nvault_open(g_Vault);

	static Key[24];
	get_user_authid(Client, Key, 21);
	format(Key, 23, "%s %d", Key, Class);

	static Value[10];
	nvault_get(Vault, Key, Value, 9);

	static Powerlevel;
	Powerlevel = str_to_num(Value);

	if (!Powerlevel)
		Powerlevel = g_StartingPowerlevels[Class];

	SetPowerlevel(Client, Powerlevel);
}

SavePowerlevel(Client)
{
	static Class;
	Class = GetClass(Client);

	if (!Class)
		return;

	static Model[8];
	GetModel(Client, Model, 7);

	static Powerlevel;
	Powerlevel = GetPowerlevel(Client);

	if (!equal(Model, g_Models[Class]))
		Powerlevel = floatround(Powerlevel / g_AscendMutlipliers[Class]);

	static Key[24];
	get_user_authid(Client, Key, 21);
	format(Key, 23, "%s %d", Key, Class);

	static Value[10];
	num_to_str(Powerlevel, Value, 9);

	static Vault;
	Vault = nvault_open(g_Vault);

	nvault_set(Vault, Key, Value);
	nvault_close(Vault);
}

stock GetClass(Client)
	return pev(Client, pev_playerclass);

stock GetModel(Client, Model[], Length)
	get_pdata_string(Client, 1420, Model, Length, 0, 20);

stock GetPowerlevel(Client)
	return get_pdata_int(Client, 460, 5);

stock SetPowerlevel(Client, Powerlevel)
{
	set_pdata_int(Client, 460, Powerlevel, 5);
	set_pdata_int(Client, 461, Powerlevel, 5);
}
I hope you know how to compile the script. Test it and see if it works flawless.
 
Last edited:
New Member
Joined
Sep 8, 2009
Messages
9
Best answers
0
Okay, this seems to work but there are 2 disadvantages:
  1. beam damage and radius is screwed up (because of changing powerlevel offset);
  2. powerlevel won't be loaded if player chooses random character through selection screen.
Code:
#include <amxmodx>
#include <fakemeta>
#include <nvault>

#define MAX_CLASSES 9 + 1

new const g_Commands[][] =
{
	"spectate",
	"buu",
	"goku",
	"gohan",
	"krillin",
	"frieza",
	"piccolo",
	"trunks",
	"vegeta",
	"cell"
};

new const g_Models[MAX_CLASSES][] =
{
	"",

	"fatbuu",
	"goku",
	"gohan",
	"krillin",
	"frieza",
	"piccolo",
	"trunks",
	"vegeta",
	"cell"
};

new const g_StartingPowerlevels[MAX_CLASSES] =
{
	0,

	1250000,
	750000,
	600000,
	600000,
	800000,
	650000,
	650000,
	700000,
	900000
};

new const Float:g_AscendMutlipliers[MAX_CLASSES] =
{
	0.0,

	1.5,
	2.0,
	2.0,
	2.0,
	1.5,
	1.5,
	2.0,
	2.0,
	1.5
};

new const g_Vault[] = "plsave";

new bool:g_FirstSpawn[33][MAX_CLASSES];

public plugin_init()
{
	register_plugin("PL Save", "1.0", "hleV");

	register_clcmd("fullupdate", "FullUpdate");

	for (new Slot = 0; Slot < sizeof(g_Commands); Slot++)
		register_clcmd(g_Commands[Slot], "ClassChange");

	register_event("ResetHUD", "ResetHUD", "be");
}

public ClassChange(Client)
	for (new Slot = 0; Slot < MAX_CLASSES; Slot++)
		g_FirstSpawn[Client][Slot] = true;

public client_disconnect(Client)
	SavePowerlevel(Client);

public FullUpdate()
	return PLUGIN_HANDLED;

public ResetHUD(Client)
{
	static Class;
	Class = GetClass(Client);

	if (!Class || !g_FirstSpawn[Client][Class])
		return;

	LoadPowerlevel(Client);

	g_FirstSpawn[Client][Class] = false;
}

LoadPowerlevel(Client)
{
	static Class;
	Class = GetClass(Client);

	if (!Class)
		return;

	static Vault;
	Vault = nvault_open(g_Vault);

	static Key[24];
	get_user_authid(Client, Key, 21);
	format(Key, 23, "%s %d", Key, Class);

	static Value[10];
	nvault_get(Vault, Key, Value, 9);

	static Powerlevel;
	Powerlevel = str_to_num(Value);

	if (!Powerlevel)
		Powerlevel = g_StartingPowerlevels[Class];

	SetPowerlevel(Client, Powerlevel);
}

SavePowerlevel(Client)
{
	static Class;
	Class = GetClass(Client);

	if (!Class)
		return;

	static Model[8];
	GetModel(Client, Model, 7);

	static Powerlevel;
	Powerlevel = GetPowerlevel(Client);

	if (!equal(Model, g_Models[Class]))
		Powerlevel = floatround(Powerlevel / g_AscendMutlipliers[Class]);

	static Key[24];
	get_user_authid(Client, Key, 21);
	format(Key, 23, "%s %d", Key, Class);

	static Value[10];
	num_to_str(Powerlevel, Value, 9);

	static Vault;
	Vault = nvault_open(g_Vault);

	nvault_set(Vault, Key, Value);
	nvault_close(Vault);
}

stock GetClass(Client)
	return pev(Client, pev_playerclass);

stock GetModel(Client, Model[], Length)
	get_pdata_string(Client, 1420, Model, Length, 0, 20);

stock GetPowerlevel(Client)
	return get_pdata_int(Client, 460, 5);

stock SetPowerlevel(Client, Powerlevel)
{
	set_pdata_int(Client, 460, Powerlevel, 5);
	set_pdata_int(Client, 461, Powerlevel, 5);
}
I hope you know how to compile the script. Test it and see if it works flawless.
Thanks but i don't actually know how to make this as a Script.

Doesnt exist as a pluggin itself

It is part of ECX though.
What do you mean It's a part of the ECX?
the "autosave" command in the console or is it something else?
cuz i've never seen my Power Level save before.
 
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
I think there is a way to turn it off. But by default its on. You can check with your gamemode in the server list. If your server says "SQLite" then the feature is activated. No idea what the command to turn it on/off is but as said by default its on.

Ofcourse that only works if you dont change the character and if its allways the same server.

So there might be a problem if you are using a LAN server as you dont get STEAM ID for it. YOu need to make an internet server to get a STEAM ID.
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
i don't actually know how to make this as a Script.
This is a script. You have to compile it. You can do that here.

BTW mine is not compatible with ECX (since ECX has its own PL saving feature). If you're playing on LAN, mine won't work too (or maybe it will load the same PL to everyone, not sure and not tested). This is meant for public Steam servers.
 
Last edited:
New Member
Joined
Sep 8, 2009
Messages
9
Best answers
0
BTW mine is not compatible with ECX (since ECX has its own PL saving feature). If you're playing on LAN, mine won't work too (or maybe it will load the same PL to everyone, not sure and not tested). This is meant for public Steam servers.

I'm playing online, so how do i trigger this or is it auto?
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
It's auto, just install it the same way as the other AMXX plugins.
 
Active Member
✔️ HL Verified
💻 Oldtimer
Joined
Nov 6, 2004
Messages
3,055
Best answers
0
Location
Round Rock, TX
If you're playing on LAN, mine won't work too (or maybe it will load the same PL to everyone, not sure and not tested).
You should use SQLite then. Most people use SQLite anyway. I can't remember the last time I saw anyone use nVault. It's slower and its usage is more drawn out. Use a threaded query with SQLite and 85% of the work is done for you.

Why do you block the 'fullupdate' command? I don't think anybody uses that exploit anymore, especially in ESF. Steven|AFL already wrote that anyway.

It might be more efficient to hook their spawn with Ham. There's no guarantee the HUD won't be reset at an awkard time, and having to process those instructions for no reason is kind of a waste. You should make sure their powerlevel is loaded once, and only once.
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
I'm not familiar with SQLite.
Did you ever try "fullupdate" command in ESF? I doubt it. It's a good idea to block it.
How come is it more efficient to hook spawn with Ham? It's the same thing. ESF is not CS.

Anyway this plugin is quickly-made one, I'm not going for approval in AlliedModders or whatever. As long as it works fine, I won't **** with it.
 
Last edited:
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
SQLx:
http://forums.alliedmods.net/showthread.php?t=46779

I already told you why Ham is more efficient. You want to load their powerlevel once, and only once.
When I said that I'm not familiar with SQLite, I didn't say that I don't know how to get familiar with it.

With Ham would be the same. ResetHUD and Ham's post spawn are both called after player has spawned. I'm loading PL only once, unless player changes class or newly connects.
 
Last edited:

Users who are viewing this thread

Top Bottom