1 PerformBurn(client, target, Float:seconds)
3 LogAction(client, target, "\"%L\" ignited \"%L\" (seconds \"%f\")", client, target, seconds);
4 IgniteEntity(target, seconds);
7 DisplayBurnMenu(client)
9 new Handle:menu = CreateMenu(MenuHandler_Burn);
11 decl String:title[100];
12 Format(title, sizeof(title), "%T:", "Burn player", client);
13 SetMenuTitle(menu, title);
14 SetMenuExitBackButton(menu, true);
16 AddTargetsToMenu(menu, client, false, true);
18 DisplayMenu(menu, client, MENU_TIME_FOREVER);
21 public AdminMenu_Burn(Handle:topmenu,
23 TopMenuObject:object_id,
28 if (action == TopMenuAction_DisplayOption)
30 Format(buffer, maxlength, "%T", "Burn player", param);
32 else if (action == TopMenuAction_SelectOption)
34 DisplayBurnMenu(param);
38 public MenuHandler_Burn(Handle:menu, MenuAction:action, param1, param2)
40 if (action == MenuAction_End)
44 else if (action == MenuAction_Cancel)
46 if (param2 == MenuCancel_ExitBack && hTopMenu != INVALID_HANDLE)
48 DisplayTopMenu(hTopMenu, param1, TopMenuPosition_LastCategory);
51 else if (action == MenuAction_Select)
56 GetMenuItem(menu, param2, info, sizeof(info));
57 userid = StringToInt(info);
59 if ((target = GetClientOfUserId(userid)) == 0)
61 PrintToChat(param1, "[SM] %t", "Player no longer available");
63 else if (!CanUserTarget(param1, target))
65 PrintToChat(param1, "[SM] %t", "Unable to target");
70 GetClientName(target, name, sizeof(name));
71 PerformBurn(param1, target, 20.0);
72 ShowActivity2(param1, "[SM] ", "%t", "Set target on fire", "_s", name);
75 /* Re-draw the menu if they're still valid */
76 if (IsClientInGame(param1) && !IsClientInKickQueue(param1))
78 DisplaySlayMenu(param1);
83 public Action:Command_Burn(client, args)
87 ReplyToCommand(client, "[SM] Usage: sm_burn <#userid|name> [time]");
88 return Plugin_Handled;
92 GetCmdArg(1, arg, sizeof(arg));
94 new Float:seconds = 20.0;
99 GetCmdArg(2, time, sizeof(time));
100 if (StringToFloatEx(time, seconds) == 0)
102 ReplyToCommand(client, "[SM] %t", "Invalid Amount");
103 return Plugin_Handled;
107 decl String:target_name[MAX_TARGET_LENGTH];
108 decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
110 if ((target_count = ProcessTargetString(
115 COMMAND_FILTER_ALIVE,
120 ReplyToTargetError(client, target_count);
121 return Plugin_Handled;
124 for (new i = 0; i < target_count; i++)
126 PerformBurn(client, target_list[i], seconds);
131 ShowActivity2(client, "[SM] ", "%t", "Set target on fire", target_name);
135 ShowActivity2(client, "[SM] ", "%t", "Set target on fire", "_s", target_name);
138 return Plugin_Handled;