Update base plugins for transitional syntax (#507)

This commit is contained in:
ErikMinekus
2016-05-11 10:44:58 -04:00
committed by Nicholas Hastings
parent e8734ccf28
commit d9fb0ba64e
18 changed files with 483 additions and 465 deletions
+8 -8
View File
@@ -31,9 +31,9 @@
* Version: $Id$
*/
FireOnClientMute(client, bool:muteState)
{
static Handle:hForward;
void FireOnClientMute(int client, bool muteState)
{
static Handle hForward;
if(hForward == null)
{
@@ -44,11 +44,11 @@
Call_PushCell(client);
Call_PushCell(muteState);
Call_Finish();
}
}
FireOnClientGag(client, bool:gagState)
{
static Handle:hForward;
void FireOnClientGag(int client, bool gagState)
{
static Handle hForward;
if(hForward == null)
{
@@ -59,4 +59,4 @@
Call_PushCell(client);
Call_PushCell(gagState);
Call_Finish();
}
}
+67 -61
View File
@@ -41,16 +41,16 @@ enum CommType
CommType_UnSilence
};
DisplayGagTypesMenu(client)
void DisplayGagTypesMenu(int client)
{
Menu menu = CreateMenu(MenuHandler_GagTypes);
Menu menu = new Menu(MenuHandler_GagTypes);
decl String:title[100];
char title[100];
Format(title, sizeof(title), "%T: %N", "Choose Type", client, g_GagTarget[client]);
menu.SetTitle(title);
menu.ExitBackButton = true;
new target = g_GagTarget[client];
int target = g_GagTarget[client];
if (!g_Muted[target])
{
@@ -91,7 +91,7 @@ void AddTranslatedMenuItem(Menu menu, const char[] opt, const char[] phrase, int
void DisplayGagPlayerMenu(int client)
{
Menu menu = CreateMenu(MenuHandler_GagPlayer);
Menu menu = new Menu(MenuHandler_GagPlayer);
char title[100];
Format(title, sizeof(title), "%T:", "Gag/Mute player", client);
@@ -103,12 +103,12 @@ void DisplayGagPlayerMenu(int client)
menu.Display(client, MENU_TIME_FOREVER);
}
public AdminMenu_Gag(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
public void AdminMenu_Gag(TopMenu topmenu,
TopMenuAction action,
TopMenuObject object_id,
int param,
char[] buffer,
int maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
@@ -120,7 +120,7 @@ public AdminMenu_Gag(Handle:topmenu,
}
}
public MenuHandler_GagPlayer(Menu menu, MenuAction action, int param1, int param2)
public int MenuHandler_GagPlayer(Menu menu, MenuAction action, int param1, int param2)
{
if (action == MenuAction_End)
{
@@ -135,8 +135,8 @@ public MenuHandler_GagPlayer(Menu menu, MenuAction action, int param1, int param
}
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);
@@ -157,7 +157,7 @@ public MenuHandler_GagPlayer(Menu menu, MenuAction action, int param1, int param
}
}
public MenuHandler_GagTypes(Menu menu, MenuAction action, int param1, int param2)
public int MenuHandler_GagTypes(Menu menu, MenuAction action, int param1, int param2)
{
if (action == MenuAction_End)
{
@@ -172,13 +172,13 @@ public MenuHandler_GagTypes(Menu menu, MenuAction action, int param1, int param2
}
else if (action == MenuAction_Select)
{
decl String:info[32];
new CommType:type;
char info[32];
CommType type;
menu.GetItem(param2, info, sizeof(info));
type = CommType:StringToInt(info);
type = view_as<CommType>(StringToInt(info));
decl String:name[MAX_NAME_LENGTH];
char name[MAX_NAME_LENGTH];
GetClientName(g_GagTarget[param1], name, sizeof(name));
switch (type)
@@ -217,7 +217,7 @@ public MenuHandler_GagTypes(Menu menu, MenuAction action, int param1, int param2
}
}
PerformMute(client, target, bool:silent=false)
void PerformMute(int client, int target, bool silent=false)
{
g_Muted[target] = true;
SetClientListeningFlags(target, VOICE_MUTED);
@@ -230,7 +230,7 @@ PerformMute(client, target, bool:silent=false)
}
}
PerformUnMute(client, target, bool:silent=false)
void PerformUnMute(int client, int target, bool silent=false)
{
g_Muted[target] = false;
if (g_Cvar_Deadtalk.IntValue == 1 && !IsPlayerAlive(target))
@@ -254,7 +254,7 @@ PerformUnMute(client, target, bool:silent=false)
}
}
PerformGag(client, target, bool:silent=false)
void PerformGag(int client, int target, bool silent=false)
{
g_Gagged[target] = true;
FireOnClientGag(target, true);
@@ -265,7 +265,7 @@ PerformGag(client, target, bool:silent=false)
}
}
PerformUnGag(client, target, bool:silent=false)
void PerformUnGag(int client, int target, bool silent=false)
{
g_Gagged[target] = false;
FireOnClientGag(target, false);
@@ -276,7 +276,7 @@ PerformUnGag(client, target, bool:silent=false)
}
}
PerformSilence(client, target)
void PerformSilence(int client, int target)
{
if (!g_Gagged[target])
{
@@ -294,7 +294,7 @@ PerformSilence(client, target)
LogAction(client, target, "\"%L\" silenced \"%L\"", client, target);
}
PerformUnSilence(client, target)
void PerformUnSilence(int client, int target)
{
if (g_Gagged[target])
{
@@ -324,7 +324,7 @@ PerformUnSilence(client, target)
LogAction(client, target, "\"%L\" unsilenced \"%L\"", client, target);
}
public Action:Command_Mute(client, args)
public Action Command_Mute(int client, int args)
{
if (args < 1)
{
@@ -332,11 +332,12 @@ public Action:Command_Mute(client, args)
return Plugin_Handled;
}
decl String:arg[64];
char arg[64];
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,
@@ -352,9 +353,9 @@ public Action:Command_Mute(client, args)
return Plugin_Handled;
}
for (new i = 0; i < target_count; i++)
for (int i = 0; i < target_count; i++)
{
new target = target_list[i];
int target = target_list[i];
PerformMute(client, target);
}
@@ -371,7 +372,7 @@ public Action:Command_Mute(client, args)
return Plugin_Handled;
}
public Action:Command_Gag(client, args)
public Action Command_Gag(int client, int args)
{
if (args < 1)
{
@@ -379,11 +380,12 @@ public Action:Command_Gag(client, args)
return Plugin_Handled;
}
decl String:arg[64];
char arg[64];
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,
@@ -399,9 +401,9 @@ public Action:Command_Gag(client, args)
return Plugin_Handled;
}
for (new i = 0; i < target_count; i++)
for (int i = 0; i < target_count; i++)
{
new target = target_list[i];
int target = target_list[i];
PerformGag(client, target);
}
@@ -418,7 +420,7 @@ public Action:Command_Gag(client, args)
return Plugin_Handled;
}
public Action:Command_Silence(client, args)
public Action Command_Silence(int client, int args)
{
if (args < 1)
{
@@ -426,11 +428,12 @@ public Action:Command_Silence(client, args)
return Plugin_Handled;
}
decl String:arg[64];
char arg[64];
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,
@@ -446,9 +449,9 @@ public Action:Command_Silence(client, args)
return Plugin_Handled;
}
for (new i = 0; i < target_count; i++)
for (int i = 0; i < target_count; i++)
{
new target = target_list[i];
int target = target_list[i];
PerformSilence(client, target);
}
@@ -465,7 +468,7 @@ public Action:Command_Silence(client, args)
return Plugin_Handled;
}
public Action:Command_Unmute(client, args)
public Action Command_Unmute(int client, int args)
{
if (args < 1)
{
@@ -473,11 +476,12 @@ public Action:Command_Unmute(client, args)
return Plugin_Handled;
}
decl String:arg[64];
char arg[64];
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,
@@ -493,9 +497,9 @@ public Action:Command_Unmute(client, args)
return Plugin_Handled;
}
for (new i = 0; i < target_count; i++)
for (int i = 0; i < target_count; i++)
{
new target = target_list[i];
int target = target_list[i];
if (!g_Muted[target])
{
@@ -517,7 +521,7 @@ public Action:Command_Unmute(client, args)
return Plugin_Handled;
}
public Action:Command_Ungag(client, args)
public Action Command_Ungag(int client, int args)
{
if (args < 1)
{
@@ -525,11 +529,12 @@ public Action:Command_Ungag(client, args)
return Plugin_Handled;
}
decl String:arg[64];
char arg[64];
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,
@@ -545,9 +550,9 @@ public Action:Command_Ungag(client, args)
return Plugin_Handled;
}
for (new i = 0; i < target_count; i++)
for (int i = 0; i < target_count; i++)
{
new target = target_list[i];
int target = target_list[i];
PerformUnGag(client, target);
}
@@ -564,7 +569,7 @@ public Action:Command_Ungag(client, args)
return Plugin_Handled;
}
public Action:Command_Unsilence(client, args)
public Action Command_Unsilence(int client, int args)
{
if (args < 1)
{
@@ -572,11 +577,12 @@ public Action:Command_Unsilence(client, args)
return Plugin_Handled;
}
decl String:arg[64];
char arg[64];
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,
@@ -592,9 +598,9 @@ public Action:Command_Unsilence(client, args)
return Plugin_Handled;
}
for (new i = 0; i < target_count; i++)
for (int i = 0; i < target_count; i++)
{
new target = target_list[i];
int target = target_list[i];
PerformUnSilence(client, target);
}
+10 -10
View File
@@ -31,9 +31,9 @@
* Version: $Id$
*/
public Native_IsClientGagged(Handle:hPlugin, numParams)
public int Native_IsClientGagged(Handle hPlugin, int numParams)
{
new client = GetNativeCell(1);
int client = GetNativeCell(1);
if (client < 1 || client > MaxClients)
{
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
@@ -47,9 +47,9 @@
return g_Gagged[client];
}
public Native_IsClientMuted(Handle:hPlugin, numParams)
public int Native_IsClientMuted(Handle hPlugin, int numParams)
{
new client = GetNativeCell(1);
int client = GetNativeCell(1);
if (client < 1 || client > MaxClients)
{
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
@@ -63,9 +63,9 @@ public Native_IsClientMuted(Handle:hPlugin, numParams)
return g_Muted[client];
}
public Native_SetClientGag(Handle:hPlugin, numParams)
public int Native_SetClientGag(Handle hPlugin, int numParams)
{
new client = GetNativeCell(1);
int client = GetNativeCell(1);
if (client < 1 || client > MaxClients)
{
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
@@ -76,7 +76,7 @@ public Native_SetClientGag(Handle:hPlugin, numParams)
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
}
new bool:gagState = GetNativeCell(2);
bool gagState = GetNativeCell(2);
if (gagState)
{
@@ -100,9 +100,9 @@ public Native_SetClientGag(Handle:hPlugin, numParams)
return true;
}
public Native_SetClientMute(Handle:hPlugin, numParams)
public int Native_SetClientMute(Handle hPlugin, int numParams)
{
new client = GetNativeCell(1);
int client = GetNativeCell(1);
if (client < 1 || client > MaxClients)
{
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
@@ -113,7 +113,7 @@ public Native_SetClientMute(Handle:hPlugin, numParams)
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
}
new bool:muteState = GetNativeCell(2);
bool muteState = GetNativeCell(2);
if (muteState)
{