AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   if players < 8 exec small_maps (https://forums.alliedmods.net/showthread.php?t=193608)

Caldeum 08-21-2012 02:57

if players < 8 exec small_maps
 
How to get current online players? if players < 8 server will exec small_maps.ini and on round end change map to one of the map in this file and after change to small map if players will be > than 8 on end of round server will exec big_maps.ini and change to one of the big maps.

I think now how to get players. Because if players will be 6 7 or 3 server will change map all the time. Any ideas how to make it? :D

Sorry for english I hope you understand me :)

gogicaa 08-21-2012 05:30

Re: if players < 8 exec small_maps
 
http://www.amxmodx.org/funcwiki.php?go=func&id=174

fysiks 08-21-2012 19:07

Re: if players < 8 exec small_maps
 
get_playersnum() would be more appropriate here.

Caldeum 08-25-2012 15:32

Re: if players < 8 exec small_maps
 
Can anyone help? doesn't work for me. Can anyone tell me better way to get de_ maps if de_dust2_2x2 is small map and de_dust2 is big one?

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] Server detect that 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] Server detect that 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" );



gogicaa 08-25-2012 16:26

Re: if players < 8 exec small_maps
 
Use || operators instead of && on checking map names !

Caldeum 08-25-2012 16:36

Re: if players < 8 exec small_maps
 
ohh stupid mistake :D thanks.

lucas_7_94 08-25-2012 18:06

Re: if players < 8 exec small_maps
 
Dont delete your post , that can help to another people that have the same problem.

Exolent[jNr] 08-25-2012 21:37

Re: if players < 8 exec small_maps
 
Post restored.


All times are GMT -4. The time now is 05:43.

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