I am creating a plugin that stores the kills you get with the knife in vault and then loads them later then you can type /knife (or something) in chat to bring a MOTD that will display the 15 people with the most knife kills, but I need some help, not sure how to make a MOTD come up in PAWN and not sure how to find their rankings this is what I have so far:
Code:
#include <amxmodx>
#include <amxmisc>
new KnifeScore[33] //global knife score
public plugin_init() {
register_plugin("Knife Score", "1.0", "Rolnaaba")
register_cvar("amx_knifescore", "1")
register_clcmd("say /knife", "ShowScores")
register_clcmd("amx_knife", "ShowScores")
}
public ShowScores(id) {
//this is MOTD dunno how to do it
}
public SaveScore(id) {
new authid[32]
get_user_authid(id, authid, 31)
new vaultkey[64], vaultdata[64]
format(vaultkey,63,"Knife-Score-%s",authid)
format(vaultdata,63,"%d",KnifeScore[id])
set_vaultdata(vaultkey,vaultdata) //save score
}
public LoadScore(id) {
new authid[32]
get_user_authid(id,authid,31)
new vaultkey[64], vaultdata[64]
format(vaultkey,63,"Knife-Score-%s",authid)
get_vaultdata(vaultkey,vaultdata,63)
KnifeScore[id] = str_to_num(vaultdata) //load score
}
public client_connect(id) {
if(get_cvar_num("amx_knifescore") == 1) {
LoadScore(id) //load score and display in chaty their score
client_print(id, print_chat, "Your knife score is currently %i", KnifeScore[id])
}
else {
return PLUGIN_HANDLED
}
}
public client_disconnect(id) {
if(get_cvar_num("amx_knifescore") == 1) {
SaveScore(id) //save their score when they leave
}
else {
return PLUGIN_HANDLED
}
}
__________________