Raised This Month: $222 Target: $400
 55% 

Map Announcer v1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Statistical       
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 11-25-2010 , 06:39   Map Announcer v1.0
Reply With Quote #1

Map Announcer v1.0
Copyright © 2010 by Duna. All rights reserved.

Last Update: 24/06/2010
Visit: www.csduna.blogspot.com


Description:

At the beginning of each round, the plugin displays a message in the chat showing the name of the map being played.



I apologize for my bad english.
The issue is that I use translator.
Thanks!
.
Attached Files
File Type: sma Get Plugin or Get Source (mapannouncer.sma - 669 views - 1.7 KB)
rrduna is offline
s33k
Senior Member
Join Date: Jul 2009
Location: club420
Old 11-25-2010 , 07:19   Re: Map Announcer v1.0
Reply With Quote #2

Again?

Already made.
__________________
s33k is offline
Send a message via MSN to s33k
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 11-25-2010 , 07:21   Re: Map Announcer v1.0
Reply With Quote #3

not, again :/
rrduna is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-25-2010 , 07:46   Re: Map Announcer v1.0
Reply With Quote #4

Code:
public map_announcer(id) {
    new map[32]
    get_mapname(map,31)
    
    client_printc(id, "^4[AMXX] ^1You are playing in map: ^4%s",map)
    return;
}
=>>>>

Code:
new roundnumber;

public map_announcer() {
    roundnumber++;
    new map[64];
    new players;
    new maxplayers;
    new timeleft;
    get_mapname(map, 63);
    players = get_playersnum(1);
    maxplayers = get_maxplayers();
    timeleft = (get_timeleft() / 60);
    for (new id = 1; id <= get_maxplayers(); id++) {
        if (!is_user_connected(id)) {
            continue;
        }
        client_printc(id, "^4[AMXX] ^1You are playing on map: ^4%s", map);
        client_printc(id, "^4[AMXX] ^1Number of players: ^4%i/%i", players, maxplayers);
        client_printc(id, "^4[AMXX] ^1Round number: ^4%i", roundnumber);
        client_printc(id, "^4[AMXX] ^1Timeleft: ^4%i", timeleft);
    }
}
--Edited!
--Edited again!
__________________

Last edited by claudiuhks; 11-27-2010 at 09:33.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 11-25-2010 , 07:48   Re: Map Announcer v1.0
Reply With Quote #5

thanks!

Last edited by rrduna; 11-25-2010 at 08:39.
rrduna is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-25-2010 , 10:45   Re: Map Announcer v1.0
Reply With Quote #6

I think it would be better to cache the mapname in a global variable in plugin_init()
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 11-25-2010 , 11:15   Re: Map Announcer v1.0
Reply With Quote #7

how so?
rrduna is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-25-2010 , 11:29   Re: Map Announcer v1.0
Reply With Quote #8

PHP Code:
new g_Mapname[35];

public 
plugin_init()
    
get_mapname(g_MapNamecharsmax(g_MapName));

public 
MapAnouncer()
    
show_hudmessage(0"You are playing on %s"g_MapName); 
So you don't have to check it every round.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 11-25-2010 , 11:32   Re: Map Announcer v1.0
Reply With Quote #9

Understood.
Thank you for expressing opinions.
Next version comes complete;)
rrduna is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-27-2010 , 14:27   Re: Map Announcer v1.0
Reply With Quote #10

* Save mapname into a global var
* Don't pass any id in a global event
* Don't use a private function when used only once, integrate it in the calling function
* Don't make checks on id when you know it always be 0
* Don't stupidly use a stock, your plugin has no ML, so you can send one brodcast message instead of looping through all players, also you never send any !g nor !t nor !n so you don't need to try to replace them.


Also this plugin is useless and has no configuration possibilities, Unapproved.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 15:27.


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