Nominations not blocking current map and excluded maps when used from console.
authorMatt Woodrow <pred@alliedmods.net>
Fri Jul 04 22:54:14 2008 +0000 (2008-07-04)
changeset 2156186f2f16564c
parent 2155 3f1fd7ab3d86
child 2157 e3846fb56e8f
Nominations not blocking current map and excluded maps when used from console.
Removed error causing debug stuff from mapchooser.
plugins/mapchooser.sp
plugins/nominations.sp
     1.1 --- a/plugins/mapchooser.sp	Fri Jul 04 19:04:33 2008 +0000
     1.2 +++ b/plugins/mapchooser.sp	Fri Jul 04 22:54:14 2008 +0000
     1.3 @@ -170,11 +170,6 @@
     1.4  	return true;
     1.5  }
     1.6  
     1.7 -public OnMapStart()
     1.8 -{
     1.9 -	Call_Cancel();	
    1.10 -}
    1.11 -
    1.12  public OnConfigsExecuted()
    1.13  {
    1.14  	if (ReadMapList(g_MapList,
     2.1 --- a/plugins/nominations.sp	Fri Jul 04 19:04:33 2008 +0000
     2.2 +++ b/plugins/nominations.sp	Fri Jul 04 22:54:14 2008 +0000
     2.3 @@ -184,28 +184,6 @@
     2.4  	
     2.5  	decl String:mapname[64];
     2.6  	GetCmdArg(1, mapname, sizeof(mapname));
     2.7 -
     2.8 -	if (FindStringInArray(g_MapList, mapname) == -1)
     2.9 -	{
    2.10 -		ReplyToCommand(client, "%t", "Map was not found", mapname);
    2.11 -		return Plugin_Handled;
    2.12 -	}
    2.13 -	
    2.14 -	new NominateResult:result = NominateMap(mapname, false, client);
    2.15 -	
    2.16 -	if (result > Nominate_Replaced)
    2.17 -	{
    2.18 -		if (result == Nominate_AlreadyInVote)
    2.19 -		{
    2.20 -			ReplyToCommand(client, "%t", "Map Already In Vote", mapname);
    2.21 -		}
    2.22 -		else
    2.23 -		{
    2.24 -			ReplyToCommand(client, "[SM] %t", "Map Already Nominated");
    2.25 -		}
    2.26 -		
    2.27 -		return Plugin_Handled;	
    2.28 -	}
    2.29  	
    2.30  	decl String:item[64];
    2.31  	for (new i = 0; i < GetMenuItemCount(g_MapMenu); i++)
    2.32 @@ -213,17 +191,35 @@
    2.33  		GetMenuItem(g_MapMenu, i, item, sizeof(item));
    2.34  		if (strcmp(item, mapname) == 0)
    2.35  		{
    2.36 +			new NominateResult:result = NominateMap(mapname, false, client);
    2.37 +	
    2.38 +			if (result > Nominate_Replaced)
    2.39 +			{
    2.40 +				if (result == Nominate_AlreadyInVote)
    2.41 +				{
    2.42 +					ReplyToCommand(client, "%t", "Map Already In Vote", mapname);
    2.43 +				}
    2.44 +				else
    2.45 +				{
    2.46 +					ReplyToCommand(client, "[SM] %t", "Map Already Nominated");
    2.47 +				}
    2.48 +				
    2.49 +				return Plugin_Handled;	
    2.50 +			}
    2.51 +			
    2.52  			RemoveMenuItem(g_MapMenu, i);
    2.53 -			break;
    2.54 +			
    2.55 +			decl String:name[64];
    2.56 +			GetClientName(client, name, sizeof(name));
    2.57 +	
    2.58 +			PrintToChatAll("[SM] %t", "Map Nominated", name, mapname);
    2.59 +	
    2.60 +			return Plugin_Continue;
    2.61  		}			
    2.62  	}
    2.63  	
    2.64 -	decl String:name[64];
    2.65 -	GetClientName(client, name, sizeof(name));
    2.66 -	
    2.67 -	PrintToChatAll("[SM] %t", "Map Nominated", name, mapname);
    2.68 -	
    2.69 -	return Plugin_Continue;
    2.70 +	ReplyToCommand(client, "%t", "Map was not found", mapname);
    2.71 +	return Plugin_Handled;
    2.72  }
    2.73  
    2.74  AttemptNominate(client)