plugins/basevotes.sp
changeset 1378 115ba755bcdf
parent 1364 99405d7da69d
child 1536 fe2146e4975d
     1.1 --- a/plugins/basevotes.sp	Sun Aug 26 20:12:30 2007 +0000
     1.2 +++ b/plugins/basevotes.sp	Mon Aug 27 02:00:37 2007 +0000
     1.3 @@ -148,6 +148,7 @@
     1.4  		}	
     1.5  	}
     1.6  
     1.7 +	LogAction(client, -1, "\"%L\" initiated a map vote.", client);
     1.8  	ShowActivity(client, "%t", "Initiated Vote Map");
     1.9  	
    1.10  	g_voteType = voteType:map;
    1.11 @@ -217,6 +218,7 @@
    1.12  		}	
    1.13  	}
    1.14  
    1.15 +	LogAction(client, -1, "\"%L\" initiated a generic vote.", client);
    1.16  	ShowActivity(client, "%t", "Initiate Vote", g_voteArg);
    1.17  	
    1.18  	g_voteType = voteType:question;
    1.19 @@ -287,6 +289,7 @@
    1.20  
    1.21  	GetClientName(target, g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[]));
    1.22  
    1.23 +	LogAction(client, target, "\"%L\" initiated a kick vote against \"%L\"", client, target);
    1.24  	ShowActivity(client, "%t", "Initiated Vote Kick", g_voteInfo[VOTE_NAME]);
    1.25  	
    1.26  	g_voteType = voteType:kick;
    1.27 @@ -347,6 +350,7 @@
    1.28  	GetClientAuthString(target, g_voteInfo[VOTE_AUTHID], sizeof(g_voteInfo[]));
    1.29  	GetClientIP(target, g_voteInfo[VOTE_IP], sizeof(g_voteInfo[]));
    1.30  
    1.31 +	LogAction(client, target, "\"%L\" initiated a ban vote against \"%L\"", client, target);
    1.32  	ShowActivity(client, "%t", "Initiated Vote Ban", g_voteInfo[VOTE_NAME]);
    1.33  
    1.34  	g_voteType = voteType:ban;
    1.35 @@ -421,11 +425,15 @@
    1.36  		{
    1.37  			limit = GetConVarFloat(g_Cvar_Limits[g_voteType]);
    1.38  		}
    1.39 +		
    1.40 +		/* :TODO: g_voteClient[userid] needs to be checked */
    1.41  
    1.42  		// A multi-argument vote is "always successful", but have to check if its a Yes/No vote.
    1.43  		if ((strcmp(item, VOTE_YES) == 0 && FloatCompare(percent,limit) < 0 && param1 == 0) || (strcmp(item, VOTE_NO) == 0 && param1 == 1))
    1.44  		{
    1.45 -			LogMessage("Vote failed.");
    1.46 +			/* :TODO: g_voteClient[userid] should be used here and set to -1 if not applicable.
    1.47 +			 */
    1.48 +			LogAction(-1, -1, "Vote failed.");
    1.49  			PrintToChatAll("[SM] %t", "Vote Failed", RoundToNearest(100.0*limit), RoundToNearest(100.0*percent), totalVotes);
    1.50  		}
    1.51  		else
    1.52 @@ -446,7 +454,7 @@
    1.53  				
    1.54  				case (voteType:map):
    1.55  				{
    1.56 -					LogMessage("Changing map to %s due to vote.", item);
    1.57 +					LogAction(-1, -1, "Changing map to %s due to vote.", item);
    1.58  					PrintToChatAll("[SM] %t", "Changing map", item);
    1.59  					new Handle:dp;
    1.60  					CreateDataTimer(5.0, Timer_ChangeMap, dp);
    1.61 @@ -461,7 +469,7 @@
    1.62  					}
    1.63  					
    1.64  					PrintToChatAll("[SM] %t", "Kicked player", g_voteInfo[VOTE_NAME]);					
    1.65 -					LogMessage("Vote kick successful, kicked \"%L\" (reason \"%s\")", g_voteClient[VOTE_CLIENTID], g_voteArg);
    1.66 +					LogAction(-1, g_voteClient[VOTE_CLIENTID], "Vote kick successful, kicked \"%L\" (reason \"%s\")", g_voteClient[VOTE_CLIENTID], g_voteArg);
    1.67  					
    1.68  					ServerCommand("kickid %d \"%s\"", g_voteClient[VOTE_USERID], g_voteArg);					
    1.69  				}
    1.70 @@ -482,7 +490,7 @@
    1.71  					}
    1.72  					
    1.73  					PrintToChatAll("[SM] %t", "Banned player", g_voteInfo[VOTE_NAME], 30);
    1.74 -					LogMessage("Vote ban successful, banned \"%L\" (minutes \"30\") (reason \"%s\")", g_voteClient[VOTE_CLIENTID], g_voteArg);
    1.75 +					LogAction(-1, g_voteClient[VOTE_CLIENTID], "Vote ban successful, banned \"%L\" (minutes \"30\") (reason \"%s\")", g_voteClient[VOTE_CLIENTID], g_voteArg);
    1.76  					
    1.77  					ServerCommand("banid %d %s", 30, g_voteClient[VOTE_AUTHID]);
    1.78  					ServerCommand("kickid %d \"%s\"", g_voteClient[VOTE_USERID], g_voteArg);