Raised This Month: $ Target: $400
 0% 

Chnanging map when players not enough


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-26-2012 , 05:51   Chnanging map when players not enough
Reply With Quote #1

Last topic locked. I create new one. Doesn't work for me. Does anyone know why?

PHP Code:
#pragma semicolon 1
#include < amxmodx >
#include < amxmisc >
#include < color >

public plugin_init( )
{
register_plugin"Changing map""0.1""alliedmodd" );

register_logevent"endround_event"2"0=World triggered""1=Round_End" );
}

public 
endround_eventid )
{
new 
players;
players get_playersnum( );

new 
Name32 ];
get_mapnameName31 );

if ( 
equaliName"de_" ) || equaliName"cs_office" ) || equaliName"cs_italy" ) )
{
if ( 
equaliName"de_dust2_2x2" ) )
return;

if ( 
players )
{
print_colorid"[AMXX] players are less than 8. Next map will be de_dust2_2x2." );
set_task0.15"changesmallmap" );
}
}

if ( 
equaliName"fy_" ) || equaliName"awp_" ) || equaliName"cs_deagle5" ) || 
equaliName"cs_max" ) || equaliName"aim_" ) || equaliName"35hp_" ) || equaliName"de_dust2_2x2" ) )
{
if ( 
players 10 )
{
print_colorid"[AMXX] players are more than 10. Next map will be de_dust2." );
set_task0.15"changebigmap" );
}
}
}

public 
changesmallmap( )
{
server_cmd"exec mapcycle_small.txt" );
server_cmd"changelevel de_dust2_2x2" );
}

public 
changebigmap( )
{
server_cmd"exec mapcycle_big.txt" );
server_cmd"changelevel de_dust2" );

or better use ? +mapcycle...
PHP Code:
server_cmd"mapcycle mapcycle_big.txt" ); 
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-26-2012 , 10:08   Re: Chnanging map when players not enough
Reply With Quote #2

endround_event(id) --> endround_event(). Also, you should use get_players() since it's the easiest way to do so.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-26-2012 , 12:19   Re: Chnanging map when players not enough
Reply With Quote #3

an you give me example with get_players() ?
__________________
Of all the things I lost, I miss my brain the most.

Last edited by Caldeum; 08-26-2012 at 12:24.
Caldeum is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 08-26-2012 , 14:15   Re: Chnanging map when players not enough
Reply With Quote #4

Quote:
Originally Posted by Caldeum View Post
an you give me example with get_players() ?
Or can you search for it... ? You will get your answer faster that way.
__________________

Accepting all kinds of requests via private message.
matsi is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 08-26-2012 , 14:24   Re: Chnanging map when players not enough
Reply With Quote #5

This is a fast way:

PHP Code:
new iPlayers[32], iNum;
get_players(iPlayersiNum"ae""CT");

// And so on.. 
Torge is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 08-26-2012 , 14:27   Re: Chnanging map when players not enough
Reply With Quote #6

Quote:
Originally Posted by Torge View Post
This is a fast way:

PHP Code:
new iPlayers[32], iNum;
get_players(iPlayersiNum"ae""CT");

// And so on.. 
Are you stupid? As far as i know he never asked how to get all alive cts and you even left the looping part. Even funcwiki offers better examples than yours.
__________________

Accepting all kinds of requests via private message.
matsi is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 08-26-2012 , 14:34   Re: Chnanging map when players not enough
Reply With Quote #7

Quote:
Originally Posted by matsi View Post
Are you stupid? As far as i know he never asked how to get all alive cts and you even left the looping part. Even funcwiki offers better examples than yours.
That's just example, I didn't said that he must use it.
Torge is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-26-2012 , 15:24   Re: Chnanging map when players not enough
Reply With Quote #8

Quote:
Originally Posted by Napoleon_be View Post
Also, you should use get_players() since it's the easiest way to do so.
What are you saying? That doesn't even make sense...
get_playersnum() is perfectly fine since he doesn't need the actual list of players.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please

Last edited by nikhilgupta345; 08-26-2012 at 15:24.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
matsi
Thinkosaur
Join Date: Sep 2006
Old 08-26-2012 , 15:46   Re: Chnanging map when players not enough
Reply With Quote #9

Quote:
Originally Posted by Torge View Post
That's just example, I didn't said that he must use it.
Taken from amxmodx.inc:
Code:
/* Sets indexes of players.
* Flags:
* "a" - don't collect dead players.
* "b" - don't collect alive players.
* "c" - skip bots.
* "d" - skip real players.
* "e" - match with team.
* "f" - match with part of name.
* "g" - ignore case sensitivity.
* "h" - skip HLTV.
* Example: Get all alive CTs: get_players(players,num,"ae","CT") */
native get_players(players[32], &num ,const flags[]="", const team[]="");
It has more info than your and he might learn something from it.

Quote:
Originally Posted by nikhilgupta345 View Post
What are you saying? That doesn't even make sense...
get_playersnum() is perfectly fine since he doesn't need the actual list of players.
This is also true didn't pay any attention to that. You might also want to check get_playersnum() in connect/disconnect forwards.
__________________

Accepting all kinds of requests via private message.

Last edited by matsi; 08-26-2012 at 15:51.
matsi is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-26-2012 , 16:30   Re: Chnanging map when players not enough
Reply With Quote #10

You can cache the map name , that will not change , and Round_End doesnt have params.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
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 05:48.


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