Raised This Month: $ Target: $400
 0% 

help with MOTD and stats


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-30-2006 , 13:04   help with MOTD and stats
Reply With Quote #1

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     } }
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Nostrodamous
BANNED
Join Date: Oct 2006
Old 10-30-2006 , 16:19   Re: help with MOTD and stats
Reply With Quote #2

to bring up a motd.txt file you would do this
Code:
show_motd(id,"My_motd.txt","Knife Stats")


the first param is the player index (id), then the constant file (txt file motd) , then the last paramter is the constant header of the motd file .

player is a player index from 1 to 32.

message can either be a filename or a string formatted message. With VGUI2, the message can be HTML formatted.

You can supply an optional title bar for the window. If not supplied, it will default to the server name.

The length of the message should not be more than around 1,200 characters - going over this limit could potentially crash the client.

hope this helps

<include amxmodx>
Nostrodamous is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-31-2006 , 02:32   Re: help with MOTD and stats
Reply With Quote #3

If you want you can also specify a file hosted on the internet instead of a local one.
The text limit is gone then
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Nostrodamous
BANNED
Join Date: Oct 2006
Old 10-31-2006 , 02:44   Re: help with MOTD and stats
Reply With Quote #4

really? do you repalce the const file with a url or what? and is it only txt. files allwoed or others?
Nostrodamous is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-31-2006 , 03:41   Re: help with MOTD and stats
Reply With Quote #5

For example, my server's Top15:

Code:
show_motd(id, "http://gotjuice.nl/main/motd.php", "Rules");
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Nostrodamous
BANNED
Join Date: Oct 2006
Old 10-31-2006 , 04:12   Re: help with MOTD and stats
Reply With Quote #6

really ? wow , thats awsome ! it accepts php too ?? thats sweet . im gonna try that out some time . I needed a way to get a motd. off the internet to display my teams stats for the OGL leauge
Nostrodamous is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-31-2006 , 05:50   Re: help with MOTD and stats
Reply With Quote #7

How is (in this case) the ouput of a PHP script different then a simple html file.
I don't think you understand that the extention of a file doesn't matter.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-31-2006 , 10:02   Re: help with MOTD and stats
Reply With Quote #8

how about stats? how can I calculate the top 15 people with the highest knife kills and have them be shown on the MOTD?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-31-2006 , 10:12   Re: help with MOTD and stats
Reply With Quote #9

That sir, is beyond your understanding.
No really.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-31-2006 , 10:13   Re: help with MOTD and stats
Reply With Quote #10

obviously thats why I am asking for explanation or would you Maximus like to confer with me via PM and we could build this together?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode