AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help with MOTD and stats (https://forums.alliedmods.net/showthread.php?t=46643)

Rolnaaba 10-30-2006 13:04

help with MOTD and stats
 
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     } }

Nostrodamous 10-30-2006 16:19

Re: help with MOTD and stats
 
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 :up:

<include amxmodx>

MaximusBrood 10-31-2006 02:32

Re: help with MOTD and stats
 
If you want you can also specify a file hosted on the internet instead of a local one.
The text limit is gone then :)

Nostrodamous 10-31-2006 02:44

Re: help with MOTD and stats
 
really? do you repalce the const file with a url or what? and is it only txt. files allwoed or others?

MaximusBrood 10-31-2006 03:41

Re: help with MOTD and stats
 
For example, my server's Top15:

Code:
show_motd(id, "http://gotjuice.nl/main/motd.php", "Rules");

Nostrodamous 10-31-2006 04:12

Re: help with MOTD and stats
 
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 :up:

MaximusBrood 10-31-2006 05:50

Re: help with MOTD and stats
 
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.

Rolnaaba 10-31-2006 10:02

Re: help with MOTD and stats
 
how about stats? how can I calculate the top 15 people with the highest knife kills and have them be shown on the MOTD?

MaximusBrood 10-31-2006 10:12

Re: help with MOTD and stats
 
That sir, is beyond your understanding.
No really.

Rolnaaba 10-31-2006 10:13

Re: help with MOTD and stats
 
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?


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

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