Raised This Month: $ Target: $400
 0% 

The most played maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-07-2008 , 16:21   The most played maps
Reply With Quote #1

Hi...how can i know the most 5,for example, played maps on the server ? looping yes, but how ? nvault ?
__________________

anakin_cstrike is offline
Iwon
BANNED
Join Date: Jul 2008
Old 09-07-2008 , 18:33   Re: The most played maps
Reply With Quote #2

1. Get the map name.
2. Get the players vote on that map
3. Save using vault - so you can edit later on..
4. use Case 1 case 2 case 3 Case 4 case 5
like
PHP Code:
case :
{
 if(
cs_assault || voted >= notvoted)
 
//when they vote there name will go in the vault with the map
 
get_user_name(idname31)
 
vault()

Iwon is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-07-2008 , 21:04   Re: The most played maps
Reply With Quote #3

Code:
#include <amxmodx> #include <amxmisc> #include <fvault> new const g_vault_name[] = "popular_maps"; public plugin_init() {     register_concmd("amx_popular_maps", "CmdMaps", ADMIN_MAP);         new mapname[64];     get_mapname(mapname, sizeof(mapname) - 1);         new info[10];     fvault_get_data(g_vault_name, mapname, info, sizeof(info) - 1);         num_to_str(str_to_num(info) + 1, info, sizeof(info) - 1);         fvault_set_data(g_vault_name, mapname, info); } public CmdMaps(client, level, cid) {     if( !cmd_access(client, level, cid, 1) )     {         return PLUGIN_HANDLED;     }         new Array:maps = ArrayCreate();     new Array:count = ArrayCreate();     new total;         new size = fvault_size(g_vault_name);     new mapname[64], info[10];     for( new i = 0; i < size; i++ )     {         fvault_get_keyname(g_vault_name, i, mapname, sizeof(mapname) - 1);                 fvault_get_data(g_vault_name, mapname, info, sizeof(info) - 1);                 ArrayPushString(maps, mapname);         ArrayPushCell(count, str_to_num(info));         total++;     }         // i got lazy but...     // just sort them by count, and you will have all 5.     // "maps" contains all maps ever played on the server     // "count" contains the amount of times played for each map         return PLUGIN_HANDLED; }

#include <fvault>
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-07-2008 , 21:06   Re: The most played maps
Reply With Quote #4

Thanks I'm tired..i go to bed now...if you have time, please make that for me.
__________________

anakin_cstrike 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 09:47.


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