Update fun plugins for transitional syntax (#508)
This commit is contained in:
committed by
Nicholas Hastings
parent
d9fb0ba64e
commit
6d9f46e983
@@ -31,17 +31,17 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new g_BeaconSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
int g_BeaconSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
|
||||
ConVar g_Cvar_BeaconRadius;
|
||||
|
||||
CreateBeacon(client)
|
||||
void CreateBeacon(int client)
|
||||
{
|
||||
g_BeaconSerial[client] = ++g_Serial_Gen;
|
||||
CreateTimer(1.0, Timer_Beacon, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS);
|
||||
}
|
||||
|
||||
KillBeacon(client)
|
||||
void KillBeacon(int client)
|
||||
{
|
||||
g_BeaconSerial[client] = 0;
|
||||
|
||||
@@ -51,15 +51,15 @@ KillBeacon(client)
|
||||
}
|
||||
}
|
||||
|
||||
KillAllBeacons()
|
||||
void KillAllBeacons()
|
||||
{
|
||||
for (new i = 1; i <= MaxClients; i++)
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
KillBeacon(i);
|
||||
}
|
||||
}
|
||||
|
||||
PerformBeacon(client, target)
|
||||
void PerformBeacon(int client, int target)
|
||||
{
|
||||
if (g_BeaconSerial[target] == 0)
|
||||
{
|
||||
@@ -73,10 +73,10 @@ PerformBeacon(client, target)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Timer_Beacon(Handle:timer, any:value)
|
||||
public Action Timer_Beacon(Handle timer, any value)
|
||||
{
|
||||
new client = value & 0x7f;
|
||||
new serial = value >> 7;
|
||||
int client = value & 0x7f;
|
||||
int serial = value >> 7;
|
||||
|
||||
if (!IsClientInGame(client)
|
||||
|| !IsPlayerAlive(client)
|
||||
@@ -122,12 +122,12 @@ public Action:Timer_Beacon(Handle:timer, any:value)
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public AdminMenu_Beacon(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_Beacon(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -139,11 +139,11 @@ public AdminMenu_Beacon(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
DisplayBeaconMenu(client)
|
||||
void DisplayBeaconMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Beacon);
|
||||
Menu menu = new Menu(MenuHandler_Beacon);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Beacon player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -153,7 +153,7 @@ DisplayBeaconMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_Beacon(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Beacon(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -168,8 +168,8 @@ public MenuHandler_Beacon(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -184,7 +184,7 @@ public MenuHandler_Beacon(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformBeacon(param1, target);
|
||||
@@ -199,7 +199,7 @@ public MenuHandler_Beacon(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_Beacon(client, args)
|
||||
public Action Command_Beacon(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -207,11 +207,12 @@ public Action:Command_Beacon(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[65];
|
||||
char arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
decl String:target_name[MAX_TARGET_LENGTH];
|
||||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
||||
char target_name[MAX_TARGET_LENGTH];
|
||||
int target_list[MAXPLAYERS], target_count;
|
||||
bool tn_is_ml;
|
||||
|
||||
if ((target_count = ProcessTargetString(
|
||||
arg,
|
||||
@@ -227,7 +228,7 @@ public Action:Command_Beacon(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformBeacon(client, target_list[i]);
|
||||
}
|
||||
|
||||
@@ -31,16 +31,16 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new g_BlindTarget[MAXPLAYERS+1];
|
||||
int g_BlindTarget[MAXPLAYERS+1];
|
||||
|
||||
PerformBlind(client, target, amount)
|
||||
void PerformBlind(int client, int target, int amount)
|
||||
{
|
||||
new targets[2];
|
||||
int targets[2];
|
||||
targets[0] = target;
|
||||
|
||||
new duration = 1536;
|
||||
new holdtime = 1536;
|
||||
new flags;
|
||||
int duration = 1536;
|
||||
int holdtime = 1536;
|
||||
int flags;
|
||||
if (amount == 0)
|
||||
{
|
||||
flags = (0x0001 | 0x0010);
|
||||
@@ -50,7 +50,7 @@ PerformBlind(client, target, amount)
|
||||
flags = (0x0002 | 0x0008);
|
||||
}
|
||||
|
||||
new color[4] = { 0, 0, 0, 0 };
|
||||
int color[4] = { 0, 0, 0, 0 };
|
||||
color[3] = amount;
|
||||
|
||||
Handle message = StartMessageEx(g_FadeUserMsgId, targets, 1);
|
||||
@@ -79,12 +79,12 @@ PerformBlind(client, target, amount)
|
||||
LogAction(client, target, "\"%L\" set blind on \"%L\", amount %d.", client, target, amount);
|
||||
}
|
||||
|
||||
public AdminMenu_Blind(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_Blind(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -101,11 +101,11 @@ public AdminMenu_Blind(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
DisplayBlindMenu(client)
|
||||
void DisplayBlindMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Blind);
|
||||
Menu menu = new Menu(MenuHandler_Blind);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Blind player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -115,11 +115,11 @@ DisplayBlindMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
DisplayAmountMenu(client)
|
||||
void DisplayAmountMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Amount);
|
||||
Menu menu = new Menu(MenuHandler_Amount);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T: %N", "Blind amount", client, GetClientOfUserId(g_BlindTarget[client]));
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -131,7 +131,7 @@ DisplayAmountMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_Blind(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Blind(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -146,8 +146,8 @@ public MenuHandler_Blind(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -177,7 +177,7 @@ public MenuHandler_Blind(Menu menu, MenuAction action, int param1, int param2)
|
||||
return;
|
||||
}
|
||||
|
||||
public MenuHandler_Amount(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Amount(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -192,8 +192,8 @@ public MenuHandler_Amount(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new amount, target;
|
||||
char info[32];
|
||||
int amount, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
amount = StringToInt(info);
|
||||
@@ -208,7 +208,7 @@ public MenuHandler_Amount(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformBlind(param1, target, amount);
|
||||
@@ -223,8 +223,7 @@ public MenuHandler_Amount(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Action:Command_Blind(client, args)
|
||||
public Action Command_Blind(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -232,13 +231,13 @@ public Action:Command_Blind(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[65];
|
||||
char arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
new amount = 0;
|
||||
int amount = 0;
|
||||
if (args > 1)
|
||||
{
|
||||
decl String:arg2[20];
|
||||
char arg2[20];
|
||||
GetCmdArg(2, arg2, sizeof(arg2));
|
||||
if (StringToIntEx(arg2, amount) == 0)
|
||||
{
|
||||
@@ -257,8 +256,9 @@ public Action:Command_Blind(client, args)
|
||||
}
|
||||
}
|
||||
|
||||
decl String:target_name[MAX_TARGET_LENGTH];
|
||||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
||||
char target_name[MAX_TARGET_LENGTH];
|
||||
int target_list[MAXPLAYERS], target_count;
|
||||
bool tn_is_ml;
|
||||
|
||||
if ((target_count = ProcessTargetString(
|
||||
arg,
|
||||
@@ -274,7 +274,7 @@ public Action:Command_Blind(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformBlind(client, target_list[i], amount);
|
||||
}
|
||||
|
||||
+42
-41
@@ -31,32 +31,32 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new Handle:g_DrugTimers[MAXPLAYERS+1];
|
||||
new Float:g_DrugAngles[20] = {0.0, 5.0, 10.0, 15.0, 20.0, 25.0, 20.0, 15.0, 10.0, 5.0, 0.0, -5.0, -10.0, -15.0, -20.0, -25.0, -20.0, -15.0, -10.0, -5.0};
|
||||
Handle g_DrugTimers[MAXPLAYERS+1];
|
||||
float g_DrugAngles[20] = {0.0, 5.0, 10.0, 15.0, 20.0, 25.0, 20.0, 15.0, 10.0, 5.0, 0.0, -5.0, -10.0, -15.0, -20.0, -25.0, -20.0, -15.0, -10.0, -5.0};
|
||||
|
||||
CreateDrug(client)
|
||||
void CreateDrug(int client)
|
||||
{
|
||||
g_DrugTimers[client] = CreateTimer(1.0, Timer_Drug, client, TIMER_REPEAT);
|
||||
}
|
||||
|
||||
KillDrug(client)
|
||||
void KillDrug(int client)
|
||||
{
|
||||
KillDrugTimer(client);
|
||||
|
||||
new Float:angs[3];
|
||||
float angs[3];
|
||||
GetClientEyeAngles(client, angs);
|
||||
|
||||
angs[2] = 0.0;
|
||||
|
||||
TeleportEntity(client, NULL_VECTOR, angs, NULL_VECTOR);
|
||||
|
||||
new clients[2];
|
||||
int clients[2];
|
||||
clients[0] = client;
|
||||
|
||||
new duration = 1536;
|
||||
new holdtime = 1536;
|
||||
new flags = (0x0001 | 0x0010);
|
||||
new color[4] = { 0, 0, 0, 0 };
|
||||
int duration = 1536;
|
||||
int holdtime = 1536;
|
||||
int flags = (0x0001 | 0x0010);
|
||||
int color[4] = { 0, 0, 0, 0 };
|
||||
|
||||
Handle message = StartMessageEx(g_FadeUserMsgId, clients, 1);
|
||||
if (GetUserMessageType() == UM_Protobuf)
|
||||
@@ -82,15 +82,15 @@ KillDrug(client)
|
||||
EndMessage();
|
||||
}
|
||||
|
||||
KillDrugTimer(client)
|
||||
void KillDrugTimer(int client)
|
||||
{
|
||||
KillTimer(g_DrugTimers[client]);
|
||||
g_DrugTimers[client] = null;
|
||||
}
|
||||
|
||||
KillAllDrugs()
|
||||
void KillAllDrugs()
|
||||
{
|
||||
for (new i = 1; i <= MaxClients; i++)
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if (g_DrugTimers[i] != null)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ KillAllDrugs()
|
||||
}
|
||||
}
|
||||
|
||||
PerformDrug(client, target, toggle)
|
||||
void PerformDrug(int client, int target, int toggle)
|
||||
{
|
||||
switch (toggle)
|
||||
{
|
||||
@@ -144,7 +144,7 @@ PerformDrug(client, target, toggle)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Timer_Drug(Handle:timer, any:client)
|
||||
public Action Timer_Drug(Handle timer, any client)
|
||||
{
|
||||
if (!IsClientInGame(client))
|
||||
{
|
||||
@@ -160,20 +160,20 @@ public Action:Timer_Drug(Handle:timer, any:client)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
new Float:angs[3];
|
||||
float angs[3];
|
||||
GetClientEyeAngles(client, angs);
|
||||
|
||||
angs[2] = g_DrugAngles[GetRandomInt(0,100) % 20];
|
||||
|
||||
TeleportEntity(client, NULL_VECTOR, angs, NULL_VECTOR);
|
||||
|
||||
new clients[2];
|
||||
int clients[2];
|
||||
clients[0] = client;
|
||||
|
||||
new duration = 255;
|
||||
new holdtime = 255;
|
||||
new flags = 0x0002;
|
||||
new color[4] = { 0, 0, 0, 128 };
|
||||
int duration = 255;
|
||||
int holdtime = 255;
|
||||
int flags = 0x0002;
|
||||
int color[4] = { 0, 0, 0, 128 };
|
||||
color[0] = GetRandomInt(0,255);
|
||||
color[1] = GetRandomInt(0,255);
|
||||
color[2] = GetRandomInt(0,255);
|
||||
@@ -203,12 +203,12 @@ public Action:Timer_Drug(Handle:timer, any:client)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public AdminMenu_Drug(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_Drug(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -220,11 +220,11 @@ public AdminMenu_Drug(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
DisplayDrugMenu(client)
|
||||
void DisplayDrugMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Drug);
|
||||
Menu menu = new Menu(MenuHandler_Drug);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Drug player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -234,7 +234,7 @@ DisplayDrugMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_Drug(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Drug(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -249,8 +249,8 @@ public MenuHandler_Drug(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -265,7 +265,7 @@ public MenuHandler_Drug(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformDrug(param1, target, 2);
|
||||
@@ -280,7 +280,7 @@ public MenuHandler_Drug(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_Drug(client, args)
|
||||
public Action Command_Drug(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -288,13 +288,13 @@ public Action:Command_Drug(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[65];
|
||||
char arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
new toggle = 2;
|
||||
int toggle = 2;
|
||||
if (args > 1)
|
||||
{
|
||||
decl String:arg2[2];
|
||||
char arg2[2];
|
||||
GetCmdArg(2, arg2, sizeof(arg2));
|
||||
if (StringToInt(arg2))
|
||||
{
|
||||
@@ -306,8 +306,9 @@ public Action:Command_Drug(client, args)
|
||||
}
|
||||
}
|
||||
|
||||
decl String:target_name[MAX_TARGET_LENGTH];
|
||||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
||||
char target_name[MAX_TARGET_LENGTH];
|
||||
int target_list[MAXPLAYERS], target_count;
|
||||
bool tn_is_ml;
|
||||
|
||||
if ((target_count = ProcessTargetString(
|
||||
arg,
|
||||
@@ -323,7 +324,7 @@ public Action:Command_Drug(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformDrug(client, target_list[i], toggle);
|
||||
}
|
||||
|
||||
+42
-48
@@ -31,22 +31,22 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new g_FireBombSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
new g_FireBombTime[MAXPLAYERS+1] = { 0, ... };
|
||||
int g_FireBombSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
int g_FireBombTime[MAXPLAYERS+1] = { 0, ... };
|
||||
|
||||
ConVar g_Cvar_BurnDuration;
|
||||
ConVar g_Cvar_FireBombTicks;
|
||||
ConVar g_Cvar_FireBombRadius;
|
||||
ConVar g_Cvar_FireBombMode;
|
||||
|
||||
CreateFireBomb(client)
|
||||
void CreateFireBomb(int client)
|
||||
{
|
||||
g_FireBombSerial[client] = ++g_Serial_Gen;
|
||||
CreateTimer(1.0, Timer_FireBomb, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS);
|
||||
g_FireBombTime[client] = g_Cvar_FireBombTicks.IntValue;
|
||||
}
|
||||
|
||||
KillFireBomb(client)
|
||||
void KillFireBomb(int client)
|
||||
{
|
||||
g_FireBombSerial[client] = 0;
|
||||
|
||||
@@ -56,21 +56,21 @@ KillFireBomb(client)
|
||||
}
|
||||
}
|
||||
|
||||
KillAllFireBombs()
|
||||
void KillAllFireBombs()
|
||||
{
|
||||
for (new i = 1; i <= MaxClients; i++)
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
KillFireBomb(i);
|
||||
}
|
||||
}
|
||||
|
||||
PerformBurn(client, target, Float:seconds)
|
||||
void PerformBurn(int client, int target, float seconds)
|
||||
{
|
||||
IgniteEntity(target, seconds);
|
||||
LogAction(client, target, "\"%L\" ignited \"%L\" (seconds \"%f\")", client, target, seconds);
|
||||
}
|
||||
|
||||
PerformFireBomb(client, target)
|
||||
void PerformFireBomb(int client, int target)
|
||||
{
|
||||
if (g_FireBombSerial[client] == 0)
|
||||
{
|
||||
@@ -85,10 +85,10 @@ PerformFireBomb(client, target)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Timer_FireBomb(Handle:timer, any:value)
|
||||
public Action Timer_FireBomb(Handle timer, any value)
|
||||
{
|
||||
new client = value & 0x7f;
|
||||
new serial = value >> 7;
|
||||
int client = value & 0x7f;
|
||||
int serial = value >> 7;
|
||||
|
||||
if (!IsClientInGame(client)
|
||||
|| !IsPlayerAlive(client)
|
||||
@@ -179,7 +179,7 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
|
||||
{
|
||||
int teamOnly = ((g_Cvar_FireBombMode.IntValue == 1) ? true : false);
|
||||
|
||||
for (new i = 1; i <= MaxClients; i++)
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client)
|
||||
{
|
||||
@@ -211,12 +211,12 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
|
||||
}
|
||||
}
|
||||
|
||||
public AdminMenu_Burn(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_Burn(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -228,12 +228,12 @@ public AdminMenu_Burn(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
public AdminMenu_FireBomb(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_FireBomb(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -245,11 +245,11 @@ public AdminMenu_FireBomb(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
DisplayBurnMenu(client)
|
||||
void DisplayBurnMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Burn);
|
||||
Menu menu = new Menu(MenuHandler_Burn);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Burn player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -259,11 +259,11 @@ DisplayBurnMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
DisplayFireBombMenu(client)
|
||||
void DisplayFireBombMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_FireBomb);
|
||||
Menu menu = new Menu(MenuHandler_FireBomb);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "FireBomb player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -273,7 +273,7 @@ DisplayFireBombMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_Burn(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Burn(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -288,8 +288,8 @@ public MenuHandler_Burn(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -304,7 +304,7 @@ public MenuHandler_Burn(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
PerformBurn(param1, target, 20.0);
|
||||
ShowActivity2(param1, "[SM] ", "%t", "Set target on fire", "_s", name);
|
||||
@@ -318,7 +318,7 @@ public MenuHandler_Burn(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_FireBomb(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_FireBomb(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -333,8 +333,8 @@ public MenuHandler_FireBomb(Menu menu, MenuAction action, int param1, int param2
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -349,7 +349,7 @@ public MenuHandler_FireBomb(Menu menu, MenuAction action, int param1, int param2
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformFireBomb(param1, target);
|
||||
@@ -364,7 +364,7 @@ public MenuHandler_FireBomb(Menu menu, MenuAction action, int param1, int param2
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_Burn(client, args)
|
||||
public Action Command_Burn(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -406,7 +406,7 @@ public Action:Command_Burn(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformBurn(client, target_list[i], seconds);
|
||||
}
|
||||
@@ -423,7 +423,7 @@ public Action:Command_Burn(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public Action:Command_FireBomb(client, args)
|
||||
public Action Command_FireBomb(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -452,7 +452,7 @@ public Action:Command_FireBomb(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformFireBomb(client, target_list[i]);
|
||||
}
|
||||
@@ -467,9 +467,3 @@ public Action:Command_FireBomb(client, args)
|
||||
}
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,20 +31,20 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new g_GravityTarget[MAXPLAYERS+1];
|
||||
int g_GravityTarget[MAXPLAYERS+1];
|
||||
|
||||
PerformGravity(client, target, Float:amount)
|
||||
void PerformGravity(int client, int target, float amount)
|
||||
{
|
||||
SetEntityGravity(target, amount);
|
||||
LogAction(client, target, "\"%L\" set gravity on \"%L\" to %f.", client, target, amount);
|
||||
}
|
||||
|
||||
public AdminMenu_Gravity(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_Gravity(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -56,11 +56,11 @@ public AdminMenu_Gravity(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
DisplayGravityMenu(client)
|
||||
void DisplayGravityMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Gravity);
|
||||
Menu menu = new Menu(MenuHandler_Gravity);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Gravity player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -70,11 +70,11 @@ DisplayGravityMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
DisplayGravityAmountMenu(client)
|
||||
void DisplayGravityAmountMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_GravityAmount);
|
||||
Menu menu = new Menu(MenuHandler_GravityAmount);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T: %N", "Gravity amount", client, GetClientOfUserId(g_GravityTarget[client]));
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -88,7 +88,7 @@ DisplayGravityAmountMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_Gravity(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Gravity(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -103,8 +103,8 @@ public MenuHandler_Gravity(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -134,7 +134,7 @@ public MenuHandler_Gravity(Menu menu, MenuAction action, int param1, int param2)
|
||||
return;
|
||||
}
|
||||
|
||||
public MenuHandler_GravityAmount(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_GravityAmount(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -149,8 +149,9 @@ public MenuHandler_GravityAmount(Menu menu, MenuAction action, int param1, int p
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new Float:amount, target;
|
||||
char info[32];
|
||||
float amount;
|
||||
int target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
amount = StringToFloat(info);
|
||||
@@ -165,7 +166,7 @@ public MenuHandler_GravityAmount(Menu menu, MenuAction action, int param1, int p
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformGravity(param1, target, amount);
|
||||
@@ -180,7 +181,7 @@ public MenuHandler_GravityAmount(Menu menu, MenuAction action, int param1, int p
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_Gravity(client, args)
|
||||
public Action Command_Gravity(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -188,13 +189,13 @@ public Action:Command_Gravity(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[65];
|
||||
char arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
new Float:amount = 1.0;
|
||||
float amount = 1.0;
|
||||
if (args > 1)
|
||||
{
|
||||
decl String:arg2[20];
|
||||
char arg2[20];
|
||||
GetCmdArg(2, arg2, sizeof(arg2));
|
||||
if (StringToFloatEx(arg2, amount) == 0)
|
||||
{
|
||||
@@ -208,8 +209,9 @@ public Action:Command_Gravity(client, args)
|
||||
}
|
||||
}
|
||||
|
||||
decl String:target_name[MAX_TARGET_LENGTH];
|
||||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
||||
char target_name[MAX_TARGET_LENGTH];
|
||||
int target_list[MAXPLAYERS], target_count;
|
||||
bool tn_is_ml;
|
||||
|
||||
if ((target_count = ProcessTargetString(
|
||||
arg,
|
||||
@@ -225,7 +227,7 @@ public Action:Command_Gravity(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformGravity(client, target_list[i], amount);
|
||||
}
|
||||
|
||||
+60
-58
@@ -31,17 +31,17 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new g_FreezeSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
new g_FreezeBombSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
new g_FreezeTime[MAXPLAYERS+1] = { 0, ... };
|
||||
new g_FreezeBombTime[MAXPLAYERS+1] = { 0, ... };
|
||||
int g_FreezeSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
int g_FreezeBombSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
int g_FreezeTime[MAXPLAYERS+1] = { 0, ... };
|
||||
int g_FreezeBombTime[MAXPLAYERS+1] = { 0, ... };
|
||||
|
||||
ConVar g_Cvar_FreezeDuration;
|
||||
ConVar g_Cvar_FreezeBombTicks;
|
||||
ConVar g_Cvar_FreezeBombRadius;
|
||||
ConVar g_Cvar_FreezeBombMode;
|
||||
|
||||
FreezeClient(client, time)
|
||||
void FreezeClient(int client, int time)
|
||||
{
|
||||
if (g_FreezeSerial[client] != 0)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ FreezeClient(client, time)
|
||||
|
||||
if (g_FreezeSound[0])
|
||||
{
|
||||
new Float:vec[3];
|
||||
float vec[3];
|
||||
GetClientEyePosition(client, vec);
|
||||
EmitAmbientSound(g_FreezeSound, vec, client, SNDLEVEL_RAIDSIREN);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ FreezeClient(client, time)
|
||||
CreateTimer(1.0, Timer_Freeze, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS);
|
||||
}
|
||||
|
||||
UnfreezeClient(client)
|
||||
void UnfreezeClient(int client)
|
||||
{
|
||||
g_FreezeSerial[client] = 0;
|
||||
g_FreezeTime[client] = 0;
|
||||
@@ -72,7 +72,7 @@ UnfreezeClient(client)
|
||||
{
|
||||
if (g_FreezeSound[0])
|
||||
{
|
||||
new Float:vec[3];
|
||||
float vec[3];
|
||||
GetClientAbsOrigin(client, vec);
|
||||
vec[2] += 10;
|
||||
|
||||
@@ -86,7 +86,7 @@ UnfreezeClient(client)
|
||||
}
|
||||
}
|
||||
|
||||
CreateFreezeBomb(client)
|
||||
void CreateFreezeBomb(int client)
|
||||
{
|
||||
if (g_FreezeBombSerial[client] != 0)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ CreateFreezeBomb(client)
|
||||
CreateTimer(1.0, Timer_FreezeBomb, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS);
|
||||
}
|
||||
|
||||
KillFreezeBomb(client)
|
||||
void KillFreezeBomb(int client)
|
||||
{
|
||||
g_FreezeBombSerial[client] = 0;
|
||||
g_FreezeBombTime[client] = 0;
|
||||
@@ -109,9 +109,9 @@ KillFreezeBomb(client)
|
||||
}
|
||||
}
|
||||
|
||||
KillAllFreezes( )
|
||||
void KillAllFreezes()
|
||||
{
|
||||
for(new i = 1; i <= MaxClients; i++)
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if (g_FreezeSerial[i] != 0)
|
||||
{
|
||||
@@ -125,13 +125,13 @@ KillAllFreezes( )
|
||||
}
|
||||
}
|
||||
|
||||
PerformFreeze(client, target, time)
|
||||
void PerformFreeze(int client, int target, int time)
|
||||
{
|
||||
FreezeClient(target, time);
|
||||
LogAction(client, target, "\"%L\" froze \"%L\"", client, target);
|
||||
}
|
||||
|
||||
PerformFreezeBomb(client, target)
|
||||
void PerformFreezeBomb(int client, int target)
|
||||
{
|
||||
if (g_FreezeBombSerial[target] != 0)
|
||||
{
|
||||
@@ -145,10 +145,10 @@ PerformFreezeBomb(client, target)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Timer_Freeze(Handle:timer, any:value)
|
||||
public Action Timer_Freeze(Handle timer, any value)
|
||||
{
|
||||
new client = value & 0x7f;
|
||||
new serial = value >> 7;
|
||||
int client = value & 0x7f;
|
||||
int serial = value >> 7;
|
||||
|
||||
if (!IsClientInGame(client)
|
||||
|| !IsPlayerAlive(client)
|
||||
@@ -188,7 +188,7 @@ public Action:Timer_Freeze(Handle:timer, any:value)
|
||||
SetEntityMoveType(client, MOVETYPE_NONE);
|
||||
SetEntityRenderColor(client, 0, 128, 255, 135);
|
||||
|
||||
new Float:vec[3];
|
||||
float vec[3];
|
||||
GetClientAbsOrigin(client, vec);
|
||||
vec[2] += 10;
|
||||
|
||||
@@ -206,10 +206,10 @@ public Action:Timer_Freeze(Handle:timer, any:value)
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public Action:Timer_FreezeBomb(Handle:timer, any:value)
|
||||
public Action Timer_FreezeBomb(Handle timer, any value)
|
||||
{
|
||||
new client = value & 0x7f;
|
||||
new serial = value >> 7;
|
||||
int client = value & 0x7f;
|
||||
int serial = value >> 7;
|
||||
|
||||
if (!IsClientInGame(client)
|
||||
|| !IsPlayerAlive(client)
|
||||
@@ -219,13 +219,13 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
|
||||
return Plugin_Stop;
|
||||
}
|
||||
|
||||
new Float:vec[3];
|
||||
float vec[3];
|
||||
GetClientEyePosition(client, vec);
|
||||
g_FreezeBombTime[client]--;
|
||||
|
||||
if (g_FreezeBombTime[client] > 0)
|
||||
{
|
||||
new color;
|
||||
int color;
|
||||
|
||||
if (g_FreezeBombTime[client] > 1)
|
||||
{
|
||||
@@ -325,12 +325,12 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
|
||||
}
|
||||
}
|
||||
|
||||
public AdminMenu_Freeze(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_Freeze(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -342,12 +342,12 @@ public AdminMenu_Freeze(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
public AdminMenu_FreezeBomb(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_FreezeBomb(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -359,11 +359,11 @@ public AdminMenu_FreezeBomb(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
DisplayFreezeMenu(client)
|
||||
void DisplayFreezeMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Freeze);
|
||||
Menu menu = new Menu(MenuHandler_Freeze);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Freeze player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -373,11 +373,11 @@ DisplayFreezeMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
DisplayFreezeBombMenu(client)
|
||||
void DisplayFreezeBombMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_FreezeBomb);
|
||||
Menu menu = new Menu(MenuHandler_FreezeBomb);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "FreezeBomb player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -387,7 +387,7 @@ DisplayFreezeBombMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_Freeze(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Freeze(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -402,8 +402,8 @@ public MenuHandler_Freeze(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -418,7 +418,7 @@ public MenuHandler_Freeze(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformFreeze(param1, target, g_Cvar_FreezeDuration.IntValue);
|
||||
@@ -433,7 +433,7 @@ public MenuHandler_Freeze(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_FreezeBomb(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_FreezeBomb(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -448,8 +448,8 @@ public MenuHandler_FreezeBomb(Menu menu, MenuAction action, int param1, int para
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -464,7 +464,7 @@ public MenuHandler_FreezeBomb(Menu menu, MenuAction action, int param1, int para
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformFreezeBomb(param1, target);
|
||||
@@ -494,7 +494,7 @@ public Action Command_Freeze(int client, int args)
|
||||
|
||||
if (args > 1)
|
||||
{
|
||||
decl String:time[20];
|
||||
char time[20];
|
||||
GetCmdArg(2, time, sizeof(time));
|
||||
if (StringToIntEx(time, seconds) == 0)
|
||||
{
|
||||
@@ -503,8 +503,9 @@ public Action Command_Freeze(int client, int args)
|
||||
}
|
||||
}
|
||||
|
||||
decl String:target_name[MAX_TARGET_LENGTH];
|
||||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
||||
char target_name[MAX_TARGET_LENGTH];
|
||||
int target_list[MAXPLAYERS], target_count;
|
||||
bool tn_is_ml;
|
||||
|
||||
if ((target_count = ProcessTargetString(
|
||||
arg,
|
||||
@@ -520,7 +521,7 @@ public Action Command_Freeze(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformFreeze(client, target_list[i], seconds);
|
||||
}
|
||||
@@ -537,7 +538,7 @@ public Action Command_Freeze(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public Action:Command_FreezeBomb(client, args)
|
||||
public Action Command_FreezeBomb(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -545,11 +546,12 @@ public Action:Command_FreezeBomb(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[65];
|
||||
char arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
decl String:target_name[MAX_TARGET_LENGTH];
|
||||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
||||
char target_name[MAX_TARGET_LENGTH];
|
||||
int target_list[MAXPLAYERS], target_count;
|
||||
bool tn_is_ml;
|
||||
|
||||
if ((target_count = ProcessTargetString(
|
||||
arg,
|
||||
@@ -565,7 +567,7 @@ public Action:Command_FreezeBomb(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformFreezeBomb(client, target_list[i]);
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
PerformNoClip(client, target)
|
||||
void PerformNoClip(int client, int target)
|
||||
{
|
||||
new MoveType:movetype = GetEntityMoveType(target);
|
||||
MoveType movetype = GetEntityMoveType(target);
|
||||
|
||||
if (movetype != MOVETYPE_NOCLIP)
|
||||
{
|
||||
@@ -47,12 +47,12 @@ PerformNoClip(client, target)
|
||||
LogAction(client, target, "\"%L\" toggled noclip on \"%L\"", client, target);
|
||||
}
|
||||
|
||||
public AdminMenu_NoClip(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_NoClip(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -64,11 +64,11 @@ public AdminMenu_NoClip(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
DisplayNoClipMenu(client)
|
||||
void DisplayNoClipMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_NoClip);
|
||||
Menu menu = new Menu(MenuHandler_NoClip);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "NoClip player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -78,7 +78,7 @@ DisplayNoClipMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_NoClip(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_NoClip(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -93,8 +93,8 @@ public MenuHandler_NoClip(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -109,7 +109,7 @@ public MenuHandler_NoClip(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformNoClip(param1, target);
|
||||
@@ -124,7 +124,7 @@ public MenuHandler_NoClip(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_NoClip(client, args)
|
||||
public Action Command_NoClip(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -132,11 +132,12 @@ public Action:Command_NoClip(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[65];
|
||||
char arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
decl String:target_name[MAX_TARGET_LENGTH];
|
||||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
||||
char target_name[MAX_TARGET_LENGTH];
|
||||
int target_list[MAXPLAYERS], target_count;
|
||||
bool tn_is_ml;
|
||||
|
||||
if ((target_count = ProcessTargetString(
|
||||
arg,
|
||||
@@ -152,7 +153,7 @@ public Action:Command_NoClip(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformNoClip(client, target_list[i]);
|
||||
}
|
||||
|
||||
@@ -31,21 +31,21 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new g_TimeBombSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
new g_TimeBombTime[MAXPLAYERS+1] = { 0, ... };
|
||||
int g_TimeBombSerial[MAXPLAYERS+1] = { 0, ... };
|
||||
int g_TimeBombTime[MAXPLAYERS+1] = { 0, ... };
|
||||
|
||||
ConVar g_Cvar_TimeBombTicks;
|
||||
ConVar g_Cvar_TimeBombRadius;
|
||||
ConVar g_Cvar_TimeBombMode;
|
||||
|
||||
CreateTimeBomb(client)
|
||||
void CreateTimeBomb(int client)
|
||||
{
|
||||
g_TimeBombSerial[client] = ++g_Serial_Gen;
|
||||
CreateTimer(1.0, Timer_TimeBomb, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS);
|
||||
g_TimeBombTime[client] = g_Cvar_TimeBombTicks.IntValue;
|
||||
}
|
||||
|
||||
KillTimeBomb(client)
|
||||
void KillTimeBomb(int client)
|
||||
{
|
||||
g_TimeBombSerial[client] = 0;
|
||||
|
||||
@@ -55,15 +55,15 @@ KillTimeBomb(client)
|
||||
}
|
||||
}
|
||||
|
||||
KillAllTimeBombs()
|
||||
void KillAllTimeBombs()
|
||||
{
|
||||
for (new i = 1; i <= MaxClients; i++)
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
KillTimeBomb(i);
|
||||
}
|
||||
}
|
||||
|
||||
PerformTimeBomb(client, target)
|
||||
void PerformTimeBomb(int client, int target)
|
||||
{
|
||||
if (g_TimeBombSerial[target] == 0)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ PerformTimeBomb(client, target)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Timer_TimeBomb(Handle:timer, any:value)
|
||||
public Action Timer_TimeBomb(Handle timer, any value)
|
||||
{
|
||||
int client = value & 0x7f;
|
||||
int serial = value >> 7;
|
||||
@@ -155,7 +155,7 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
|
||||
{
|
||||
int teamOnly = ((g_Cvar_TimeBombMode.IntValue == 1) ? true : false);
|
||||
|
||||
for (new i = 1; i <= MaxClients; i++)
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client)
|
||||
{
|
||||
@@ -177,7 +177,7 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
|
||||
continue;
|
||||
}
|
||||
|
||||
new damage = 220;
|
||||
int damage = 220;
|
||||
damage = RoundToFloor(damage * ((g_Cvar_TimeBombRadius.FloatValue - distance) / g_Cvar_TimeBombRadius.FloatValue));
|
||||
|
||||
SlapPlayer(i, damage, false);
|
||||
@@ -195,8 +195,8 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
|
||||
|
||||
if (i == TR_GetEntityIndex())
|
||||
{
|
||||
new damage = 100;
|
||||
new radius = g_Cvar_TimeBombRadius.IntValue / 2;
|
||||
int damage = 100;
|
||||
int radius = g_Cvar_TimeBombRadius.IntValue / 2;
|
||||
|
||||
if (distance > radius)
|
||||
{
|
||||
@@ -213,12 +213,12 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
|
||||
}
|
||||
}
|
||||
|
||||
public AdminMenu_TimeBomb(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_TimeBomb(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -230,11 +230,11 @@ public AdminMenu_TimeBomb(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
DisplayTimeBombMenu(client)
|
||||
void DisplayTimeBombMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_TimeBomb);
|
||||
Menu menu = new Menu(MenuHandler_TimeBomb);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "TimeBomb player", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -244,7 +244,7 @@ DisplayTimeBombMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_TimeBomb(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_TimeBomb(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -259,8 +259,8 @@ public MenuHandler_TimeBomb(Menu menu, MenuAction action, int param1, int param2
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -275,7 +275,7 @@ public MenuHandler_TimeBomb(Menu menu, MenuAction action, int param1, int param2
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformTimeBomb(param1, target);
|
||||
@@ -290,7 +290,7 @@ public MenuHandler_TimeBomb(Menu menu, MenuAction action, int param1, int param2
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_TimeBomb(client, args)
|
||||
public Action Command_TimeBomb(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -298,11 +298,12 @@ public Action:Command_TimeBomb(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[65];
|
||||
char arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
decl String:target_name[MAX_TARGET_LENGTH];
|
||||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
||||
char target_name[MAX_TARGET_LENGTH];
|
||||
int target_list[MAXPLAYERS], target_count;
|
||||
bool tn_is_ml;
|
||||
|
||||
if ((target_count = ProcessTargetString(
|
||||
arg,
|
||||
@@ -318,7 +319,7 @@ public Action:Command_TimeBomb(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformTimeBomb(client, target_list[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user