Commit d35c93de authored by Mikleo's avatar Mikleo
Browse files

emputils compatibility

parent 693001c3
Pipeline #7182 passed with stages
in 18 seconds
......@@ -8,7 +8,7 @@
#include <empstats>
#include <updater>
#define PluginVersion "0.96"
#define PluginVersion "0.97"
#define UPDATE_URL "https://sourcemod.docs.empiresmod.com/DraftPick/dist/updater.txt"
......@@ -537,11 +537,16 @@ public Action Command_SetTeam(int client, int args)
{
GetCmdArg(1, arg1, sizeof(arg1));
int target = GetClientID(arg1,client);
GetCmdArg(2, arg2, sizeof(arg2));
char commandString[64];
Format(commandString,sizeof(commandString),"sm_setteam %s %s","#%d",arg2);
int target = EU_MenuFindTarget(commandString,client,arg1);
if(target == -1)
return Plugin_Handled;
GetCmdArg(2, arg2, sizeof(arg2));
char clientName[64];
char targetName[64];
GetClientName(client,clientName,sizeof(clientName));
......@@ -1314,7 +1319,7 @@ public Action Command_SimJoin(int client, int args)
{
return Plugin_Handled;
}
int target = GetClientID(arg1,client);
int target = EU_FindTarget(client,arg1);
if(target != -1)
StartBatchJoin(target,20);
......@@ -1334,7 +1339,7 @@ public Action Command_SetCaptain(int client, int args)
PrintToChat(client,"You must be in the captain vote stage to set captains");
return Plugin_Handled;
}
int target = GetClientID(arg1,client);
int target = EU_FindTarget(client,arg1);
if(target != -1)
SetCaptain(target,client);
......@@ -1353,7 +1358,7 @@ public Action Command_RemoveCaptain(int client, int args)
PrintToChat(client,"You must be in the captain vote stage to remove captains");
return Plugin_Handled;
}
int target = GetClientID(arg1,client);
int target = EU_FindTarget(client,arg1);
if(target != -1)
RemoveCaptain(target,client);
......@@ -2398,34 +2403,7 @@ int TeamCaptained(int client)
return -1;
}
}
GetClientID(char[] name,int client)
{
char target_name[MAX_TARGET_LENGTH];
int target_list[MAXPLAYERS], target_count;
bool tn_is_ml;
target_count = ProcessTargetString(
name,
client,
target_list,
MAXPLAYERS,
COMMAND_FILTER_NO_IMMUNITY,
target_name,
sizeof(target_name),
tn_is_ml);
if(target_count == -7)
{
ReplyToCommand(client, " Input applies to more than one target");
return -1;
}
if (target_count <= 0)
{
ReplyToCommand(client, "No Targets detected");
return -1;
}
return target_list[0];
}
// must delete the list after using this function
ArrayList GetClientCandidates(char[] name)
{
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "0.96"
"Latest" "0.97"
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment