L4D2Tools: Fix small bugs

This commit is contained in:
Jackzie 2021-05-03 09:55:07 -05:00
parent bef593169d
commit 85b04f5c9f
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
2 changed files with 5 additions and 4 deletions

Binary file not shown.

View file

@ -40,8 +40,8 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
public void OnPluginStart() {
EngineVersion g_Game = GetEngineVersion();
if(g_Game != Engine_Left4Dead && g_Game != Engine_Left4Dead2) {
SetFailState("This plugin is for L4D/L4D2 only.");
if(g_Game != Engine_Left4Dead2) {
SetFailState("This plugin is for L4D2 only.");
}
LoadTranslations("common.phrases");
@ -157,12 +157,14 @@ public Action Command_SetClientModel(int client, int args) {
GetCmdArg(3, arg3, sizeof(arg3));
char modelPath[64];
int modelID = GetSurvivorId(arg2);
int modelID = GetSurvivorId(arg2, false);
if(modelID == -1) {
ReplyToCommand(client, "Invalid survivor type entered. Case-sensitive, full name required.");
return Plugin_Handled;
}
GetSurvivorModel(modelID, modelPath, sizeof(modelPath));
//Convert the l4d1 survivors to proper l4d1 ID if game is l4d1
if(isL4D1Survivors) modelID = GetSurvivorId(arg2, true);
char target_name[MAX_TARGET_LENGTH];
int target_list[MAXPLAYERS], target_count;
@ -188,7 +190,6 @@ public Action Command_SetClientModel(int client, int args) {
if(IsClientConnected(target) && IsClientInGame(target) && IsPlayerAlive(target)) {
int team = GetClientTeam(target_list[i]);
if(team == 2 || team == 4) {
modelID = isL4D1Survivors ? modelID - 4 : modelID;
SetEntProp(target, Prop_Send, "m_survivorCharacter", modelID);
SetEntityModel(target, modelPath);
if (IsFakeClient(target)) {