mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 14:03:21 +00:00
L4D2Tools: Fix small bugs
This commit is contained in:
parent
bef593169d
commit
85b04f5c9f
2 changed files with 5 additions and 4 deletions
Binary file not shown.
|
@ -40,8 +40,8 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
||||||
|
|
||||||
public void OnPluginStart() {
|
public void OnPluginStart() {
|
||||||
EngineVersion g_Game = GetEngineVersion();
|
EngineVersion g_Game = GetEngineVersion();
|
||||||
if(g_Game != Engine_Left4Dead && g_Game != Engine_Left4Dead2) {
|
if(g_Game != Engine_Left4Dead2) {
|
||||||
SetFailState("This plugin is for L4D/L4D2 only.");
|
SetFailState("This plugin is for L4D2 only.");
|
||||||
}
|
}
|
||||||
LoadTranslations("common.phrases");
|
LoadTranslations("common.phrases");
|
||||||
|
|
||||||
|
@ -157,12 +157,14 @@ public Action Command_SetClientModel(int client, int args) {
|
||||||
GetCmdArg(3, arg3, sizeof(arg3));
|
GetCmdArg(3, arg3, sizeof(arg3));
|
||||||
|
|
||||||
char modelPath[64];
|
char modelPath[64];
|
||||||
int modelID = GetSurvivorId(arg2);
|
int modelID = GetSurvivorId(arg2, false);
|
||||||
if(modelID == -1) {
|
if(modelID == -1) {
|
||||||
ReplyToCommand(client, "Invalid survivor type entered. Case-sensitive, full name required.");
|
ReplyToCommand(client, "Invalid survivor type entered. Case-sensitive, full name required.");
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
GetSurvivorModel(modelID, modelPath, sizeof(modelPath));
|
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];
|
char target_name[MAX_TARGET_LENGTH];
|
||||||
int target_list[MAXPLAYERS], target_count;
|
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)) {
|
if(IsClientConnected(target) && IsClientInGame(target) && IsPlayerAlive(target)) {
|
||||||
int team = GetClientTeam(target_list[i]);
|
int team = GetClientTeam(target_list[i]);
|
||||||
if(team == 2 || team == 4) {
|
if(team == 2 || team == 4) {
|
||||||
modelID = isL4D1Survivors ? modelID - 4 : modelID;
|
|
||||||
SetEntProp(target, Prop_Send, "m_survivorCharacter", modelID);
|
SetEntProp(target, Prop_Send, "m_survivorCharacter", modelID);
|
||||||
SetEntityModel(target, modelPath);
|
SetEntityModel(target, modelPath);
|
||||||
if (IsFakeClient(target)) {
|
if (IsFakeClient(target)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue