Raised This Month: $51 Target: $400
 12% 

Count Maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hitD
Junior Member
Join Date: May 2017
Location: Lithuania
Old 05-24-2017 , 03:05   Count Maps
Reply With Quote #1

Hello,

Anyone have plugin or a source code that server would count changed maps?

Thanks.
hitD is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-24-2017 , 10:20   Re: Count Maps
Reply With Quote #2

Give more information.
__________________

Last edited by OciXCrom; 05-24-2017 at 10:21.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
hitD
Junior Member
Join Date: May 2017
Location: Lithuania
Old 05-24-2017 , 12:34   Re: Count Maps
Reply With Quote #3

For example you start server and it changes map.
Then it would show changed 1 time.
When u will change again it would show changed 2 times and when u change again 3 times and etc....
So i need like server would count how much times it changed while server was online.
hitD is offline
hitD
Junior Member
Join Date: May 2017
Location: Lithuania
Old 05-26-2017 , 11:28   Re: Count Maps
Reply With Quote #4

UP!
hitD is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-26-2017 , 16:26   Re: Count Maps
Reply With Quote #5

When and where would it show? Explain better.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
hitD
Junior Member
Join Date: May 2017
Location: Lithuania
Old 05-27-2017 , 08:10   Re: Count Maps
Reply With Quote #6

Well i would need like only a source code or plugin that would only count. Just the counting part.
hitD is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-27-2017 , 09:02   Re: Count Maps
Reply With Quote #7

Well there is a server change level forward called on changing the map, make a global variable and increase it each time the forward is called.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
hitD
Junior Member
Join Date: May 2017
Location: Lithuania
Old 05-27-2017 , 11:45   Re: Count Maps
Reply With Quote #8

Thanks for good answer. Can u give me some examples how the global variable works. I know it's like for example new count
and i use this forward:
public server_changelevel()
{
count++

}

but still when map changes it will be 0 or i don't know how the global variable should work
hitD is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-27-2017 , 11:50   Re: Count Maps
Reply With Quote #9

Everything will be reseted on map change. You must save it.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 05-27-2017 at 11:50.
EFFx is offline
Old 05-27-2017, 12:03
Alber9091
This message has been deleted by Alber9091.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-27-2017 , 12:58   Re: Count Maps
Reply With Quote #10

PHP Code:
#include <amxmodx>
#include <amxmisc>

new g_szFile[512], g_iChanges

public plugin_init()
{
    
register_plugin("Count Map Changes""1.0""OciXCrom")
    
get_configsdir(g_szFilecharsmax(g_szFile))
    
add(g_szFilecharsmax(g_szFile), "/MapChanges.txt")
    
    if(
file_exists(g_szFile))
    {
        new 
szChanges[10]
        
read_file(g_szFile0szChangescharsmax(szChanges))
        
g_iChanges str_to_num(szChanges) + 1
    
}
}

public 
plugin_end()
{
    new 
szChanges[10]
    
num_to_str(g_iChangesszChangescharsmax(szChanges))
    
write_file(g_szFileszChanges0)

g_iChanges is the number of changes.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 01:32.


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