plugins/basefuncommands/burn.sp
branchsourcemod-1.1.0
changeset 2283 03a67e41afbc
parent 1951 c7b4237fff50
child 2287 017a725c9d17
     1.1 --- a/plugins/basefuncommands/burn.sp	Fri Mar 28 06:21:34 2008 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,139 +0,0 @@
     1.4 -PerformBurn(client, target, Float:seconds)
     1.5 -{
     1.6 -	LogAction(client, target, "\"%L\" ignited \"%L\" (seconds \"%f\")", client, target, seconds);
     1.7 -	IgniteEntity(target, seconds);
     1.8 -}
     1.9 -
    1.10 -DisplayBurnMenu(client)
    1.11 -{
    1.12 -	new Handle:menu = CreateMenu(MenuHandler_Burn);
    1.13 -	
    1.14 -	decl String:title[100];
    1.15 -	Format(title, sizeof(title), "%T:", "Burn player", client);
    1.16 -	SetMenuTitle(menu, title);
    1.17 -	SetMenuExitBackButton(menu, true);
    1.18 -	
    1.19 -	AddTargetsToMenu(menu, client, true, true);
    1.20 -	
    1.21 -	DisplayMenu(menu, client, MENU_TIME_FOREVER);
    1.22 -}
    1.23 -
    1.24 -public AdminMenu_Burn(Handle:topmenu, 
    1.25 -					  TopMenuAction:action,
    1.26 -					  TopMenuObject:object_id,
    1.27 -					  param,
    1.28 -					  String:buffer[],
    1.29 -					  maxlength)
    1.30 -{
    1.31 -	if (action == TopMenuAction_DisplayOption)
    1.32 -	{
    1.33 -		Format(buffer, maxlength, "%T", "Burn player", param);
    1.34 -	}
    1.35 -	else if (action == TopMenuAction_SelectOption)
    1.36 -	{
    1.37 -		DisplayBurnMenu(param);
    1.38 -	}
    1.39 -}
    1.40 -
    1.41 -public MenuHandler_Burn(Handle:menu, MenuAction:action, param1, param2)
    1.42 -{
    1.43 -	if (action == MenuAction_End)
    1.44 -	{
    1.45 -		CloseHandle(menu);
    1.46 -	}
    1.47 -	else if (action == MenuAction_Cancel)
    1.48 -	{
    1.49 -		if (param2 == MenuCancel_ExitBack && hTopMenu != INVALID_HANDLE)
    1.50 -		{
    1.51 -			DisplayTopMenu(hTopMenu, param1, TopMenuPosition_LastCategory);
    1.52 -		}
    1.53 -	}
    1.54 -	else if (action == MenuAction_Select)
    1.55 -	{
    1.56 -		decl String:info[32];
    1.57 -		new userid, target;
    1.58 -		
    1.59 -		GetMenuItem(menu, param2, info, sizeof(info));
    1.60 -		userid = StringToInt(info);
    1.61 -
    1.62 -		if ((target = GetClientOfUserId(userid)) == 0)
    1.63 -		{
    1.64 -			PrintToChat(param1, "[SM] %t", "Player no longer available");
    1.65 -		}
    1.66 -		else if (!CanUserTarget(param1, target))
    1.67 -		{
    1.68 -			PrintToChat(param1, "[SM] %t", "Unable to target");
    1.69 -		}
    1.70 -		else
    1.71 -		{
    1.72 -			new String:name[32];
    1.73 -			GetClientName(target, name, sizeof(name));
    1.74 -			PerformBurn(param1, target, 20.0);
    1.75 -			ShowActivity2(param1, "[SM] ", "%t", "Set target on fire", "_s", name);
    1.76 -		}
    1.77 -		
    1.78 -		/* Re-draw the menu if they're still valid */
    1.79 -		if (IsClientInGame(param1) && !IsClientInKickQueue(param1))
    1.80 -		{
    1.81 -			DisplaySlayMenu(param1);
    1.82 -		}
    1.83 -	}
    1.84 -}
    1.85 -
    1.86 -public Action:Command_Burn(client, args)
    1.87 -{
    1.88 -	if (args < 1)
    1.89 -	{
    1.90 -		ReplyToCommand(client, "[SM] Usage: sm_burn <#userid|name> [time]");
    1.91 -		return Plugin_Handled;
    1.92 -	}
    1.93 -
    1.94 -	decl String:arg[65];
    1.95 -	GetCmdArg(1, arg, sizeof(arg));
    1.96 -
    1.97 -	new Float:seconds = 20.0;
    1.98 -	
    1.99 -	if (args > 1)
   1.100 -	{
   1.101 -		decl String:time[20];
   1.102 -		GetCmdArg(2, time, sizeof(time));
   1.103 -		if (StringToFloatEx(time, seconds) == 0)
   1.104 -		{
   1.105 -			ReplyToCommand(client, "[SM] %t", "Invalid Amount");
   1.106 -			return Plugin_Handled;
   1.107 -		}
   1.108 -	}
   1.109 -	
   1.110 -	decl String:target_name[MAX_TARGET_LENGTH];
   1.111 -	decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
   1.112 -	
   1.113 -	if ((target_count = ProcessTargetString(
   1.114 -			arg,
   1.115 -			client,
   1.116 -			target_list,
   1.117 -			MAXPLAYERS,
   1.118 -			COMMAND_FILTER_ALIVE,
   1.119 -			target_name,
   1.120 -			sizeof(target_name),
   1.121 -			tn_is_ml)) <= 0)
   1.122 -	{
   1.123 -		ReplyToTargetError(client, target_count);
   1.124 -		return Plugin_Handled;
   1.125 -	}
   1.126 -	
   1.127 -	for (new i = 0; i < target_count; i++)
   1.128 -	{
   1.129 -		PerformBurn(client, target_list[i], seconds);
   1.130 -	}
   1.131 -	
   1.132 -	if (tn_is_ml)
   1.133 -	{
   1.134 -		ShowActivity2(client, "[SM] ", "%t", "Set target on fire", target_name);
   1.135 -	}
   1.136 -	else
   1.137 -	{
   1.138 -		ShowActivity2(client, "[SM] ", "%t", "Set target on fire", "_s", target_name);
   1.139 -	}
   1.140 -
   1.141 -	return Plugin_Handled;
   1.142 -}