plugins/basefunvotes.sp
changeset 1378 115ba755bcdf
parent 1375 b7acfca8070d
child 1536 fe2146e4975d
     1.1 --- a/plugins/basefunvotes.sp	Sun Aug 26 20:12:30 2007 +0000
     1.2 +++ b/plugins/basefunvotes.sp	Mon Aug 27 02:00:37 2007 +0000
     1.3 @@ -156,6 +156,7 @@
     1.4  		}	
     1.5  	}
     1.6  
     1.7 +	LogAction(client, -1, "\"%L\" initiated a gravity vote.", client);
     1.8  	ShowActivity(client, "%t", "Initiated Vote Gravity");
     1.9  	
    1.10  	g_voteType = voteType:gravity;
    1.11 @@ -226,6 +227,7 @@
    1.12  	g_voteClient[VOTE_CLIENTID] = target;
    1.13  	GetClientName(target, g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[]));
    1.14  
    1.15 +	LogAction(client, target, "\"%L\" initiated a burn vote against \"%L\"", client, target);
    1.16  	ShowActivity(client, "%t", "Initiated Vote Burn", g_voteInfo[VOTE_NAME]);
    1.17  	
    1.18  	g_voteType = voteType:burn;
    1.19 @@ -279,6 +281,7 @@
    1.20  	g_voteClient[VOTE_CLIENTID] = target;
    1.21  	GetClientName(target, g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[]));
    1.22  
    1.23 +	LogAction(client, target, "\"%L\" initiated a slay vote against \"%L\"", client, target);
    1.24  	ShowActivity(client, "%t", "Initiated Vote Slay", g_voteInfo[VOTE_NAME]);
    1.25  	
    1.26  	g_voteType = voteType:slay;
    1.27 @@ -312,6 +315,7 @@
    1.28  		return Plugin_Handled;
    1.29  	}
    1.30  	
    1.31 +	LogAction(client, -1, "\"%L\" initiated an alltalk vote.", client);
    1.32  	ShowActivity(client, "%t", "Initiated Vote Alltalk");
    1.33  	
    1.34  	g_voteType = voteType:alltalk;
    1.35 @@ -355,6 +359,7 @@
    1.36  		return Plugin_Handled;
    1.37  	}
    1.38  	
    1.39 +	LogAction(client, -1, "\"%L\" initiated a friendly fire vote.", client);
    1.40  	ShowActivity(client, "%t", "Initiated Vote FF");
    1.41  	
    1.42  	g_voteType = voteType:ff;
    1.43 @@ -433,11 +438,16 @@
    1.44  		percent = GetVotePercent(votes, totalVotes);
    1.45  		
    1.46  		limit = GetConVarFloat(g_Cvar_Limits[g_voteType]);
    1.47 +		
    1.48 +		/* :TODO: g_voteClient[userid] needs to be checked.
    1.49 +		 */
    1.50  
    1.51  		// A multi-argument vote is "always successful", but have to check if its a Yes/No vote.
    1.52  		if ((strcmp(item, VOTE_YES) == 0 && FloatCompare(percent,limit) < 0 && param1 == 0) || (strcmp(item, VOTE_NO) == 0 && param1 == 1))
    1.53  		{
    1.54 -			LogMessage("Vote failed.");
    1.55 +			/* :TODO: g_voteClient[userid] should be used here and set to -1 if not applicable.
    1.56 +			 */
    1.57 +			LogAction(-1, -1, "Vote failed.");
    1.58  			PrintToChatAll("[SM] %t", "Vote Failed", RoundToNearest(100.0*limit), RoundToNearest(100.0*percent), totalVotes);
    1.59  		}
    1.60  		else
    1.61 @@ -449,14 +459,14 @@
    1.62  				case (voteType:gravity):
    1.63  				{
    1.64  					PrintToChatAll("[SM] %t", "Cvar changed", "sv_gravity", item);					
    1.65 -					LogMessage("Changing gravity to %s due to vote.", item);
    1.66 +					LogAction(-1, -1, "Changing gravity to %s due to vote.", item);
    1.67  					SetConVarInt(g_Cvar_Gravity, StringToInt(item));
    1.68  				}
    1.69  				
    1.70  				case (voteType:burn):
    1.71  				{
    1.72  					PrintToChatAll("[SM] %t", "Ignited player", g_voteInfo[VOTE_NAME]);					
    1.73 -					LogMessage("Vote burn successful, igniting \"%L\"", g_voteClient[VOTE_CLIENTID]);
    1.74 +					LogAction(-1, g_voteClient[VOTE_CLIENTID], "Vote burn successful, igniting \"%L\"", g_voteClient[VOTE_CLIENTID]);
    1.75  					
    1.76  					IgniteEntity(g_voteClient[VOTE_CLIENTID], 19.8);	
    1.77  				}
    1.78 @@ -464,7 +474,7 @@
    1.79  				case (voteType:slay):
    1.80  				{
    1.81  					PrintToChatAll("[SM] %t", "Slayed player", g_voteInfo[VOTE_NAME]);					
    1.82 -					LogMessage("Vote slay successful, slaying \"%L\"", g_voteClient[VOTE_CLIENTID]);
    1.83 +					LogAction(-1, g_voteClient[VOTE_CLIENTID], "Vote slay successful, slaying \"%L\"", g_voteClient[VOTE_CLIENTID]);
    1.84  					
    1.85  					ExtinguishEntity(g_voteClient[VOTE_CLIENTID]);
    1.86  					ForcePlayerSuicide(g_voteClient[VOTE_CLIENTID]);
    1.87 @@ -473,14 +483,14 @@
    1.88  				case (voteType:alltalk):
    1.89  				{
    1.90  					PrintToChatAll("[SM] %t", "Cvar changed", "sv_alltalk", (GetConVarBool(g_Cvar_Alltalk) ? "0" : "1"));
    1.91 -					LogMessage("Changing alltalk to %s due to vote.", (GetConVarBool(g_Cvar_Alltalk) ? "0" : "1"));
    1.92 +					LogAction(-1, -1, "Changing alltalk to %s due to vote.", (GetConVarBool(g_Cvar_Alltalk) ? "0" : "1"));
    1.93  					SetConVarBool(g_Cvar_Alltalk, !GetConVarBool(g_Cvar_Alltalk));
    1.94  				}
    1.95  				
    1.96  				case (voteType:ff):
    1.97  				{
    1.98  					PrintToChatAll("[SM] %t", "Cvar changed", "mp_friendlyfire", (GetConVarBool(g_Cvar_FF) ? "0" : "1"));
    1.99 -					LogMessage("Changing friendly fire to %s due to vote.", (GetConVarBool(g_Cvar_FF) ? "0" : "1"));
   1.100 +					LogAction(-1, -1, "Changing friendly fire to %s due to vote.", (GetConVarBool(g_Cvar_FF) ? "0" : "1"));
   1.101  					SetConVarBool(g_Cvar_FF, !GetConVarBool(g_Cvar_FF));
   1.102  				}				
   1.103  			}