Yes yes i know, but the search box doesn't help me, that's why i made this thread. I made a little nVault plugin that saves points to the user when he types the command.
The nVault tutorial only gave me info what the natives are, i just get confused every time i try to read about them... i just can't understand it.
So i made this and it saves the user's points when he reconnects
but it wont save them and when the map changes
... how do i do that? And i don't know how to make motds... i searched and searched and there aren't any (Like in statsx.. but that didn't help me either and not a motd with HTML). So i want the motd to save users points...
Let's just go step by step until i complete it.
And here is the sma code (UPDATED)
PHP Code:
#include <amxmodx>
#include <nvault>
#define PLUGIN "BlahnVault"
#define VERSION "1.0"
#define AUTHOR "wEight"
new points[33]
new g_Vault
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /winpoints", "cmd_winpoints")
register_clcmd("say /showpoints", "cmd_showpoints")
g_Vault = nvault_open("blahvault")
}
public client_authorized(id)
{
points[id] = loadpoints(id)
}
public plugin_end()
{
nvault_close(g_Vault)
}
public cmd_winpoints(id)
{
points[id] += 1
savepoints(id, points[id])
}
public loadpoints(id)
{
new authid[33]
new vaultkey[64], vaultdata[64]
get_user_authid(id, authid, 32)
format(vaultkey, 63, "%s-blahs", authid)
nvault_get(g_Vault, vaultkey, vaultdata, 63)
// nvault_close put in plugin_end
return str_to_num(vaultdata)
}
public savepoints(id, pointz)
{
if(g_Vault == INVALID_HANDLE)
set_fail_state("Oh noes! Invalid Handle")
new authid[32]
new vaultkey[64], vaultdata[64]
get_user_authid(id, authid, 31)
format(vaultkey, 63, "%s-blahs", authid)
format(vaultdata, 63, "%d^n", pointz)
nvault_set(g_Vault, vaultkey, vaultdata)
// nvault_close put in plugin_end
}
public cmd_showpoints(id)
{
client_print(id, print_chat, "You have %d point(s)!", points[id])
}
So... first, i need to fix this error, then you can help me with the nvault saving the points when map changes or server restarts (not global restart), then i want to make a motd of top10 players with points...
If you can help me with this it would be very appreciated and i will put your credit on my plugin update.
Edit: Need help with motd now