mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-10 08:23:21 +00:00
survivor_identity_fix: Fix small bugs
This commit is contained in:
parent
3d0b4635b5
commit
bef593169d
2 changed files with 6 additions and 4 deletions
Binary file not shown.
|
@ -230,7 +230,7 @@ public void OnClientCookiesCached(int client) {
|
||||||
if(strlen(modelPref) > 0) {
|
if(strlen(modelPref) > 0) {
|
||||||
int type;
|
int type;
|
||||||
if(StringToIntEx(modelPref, type) > 0) {
|
if(StringToIntEx(modelPref, type) > 0) {
|
||||||
PrintToServer(">>> %N has cookie for: %s", client, survivor_models[type - 1]);
|
PrintToServer(">>> %N has cookie for: %s", client, survivor_models[type - 1][17]);
|
||||||
strcopy(g_Models[client], 64, survivor_models[type - 1]);
|
strcopy(g_Models[client], 64, survivor_models[type - 1]);
|
||||||
g_iPendingCookieModel[client] = type;
|
g_iPendingCookieModel[client] = type;
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadca
|
||||||
//Switch players to L4D2 right before death.
|
//Switch players to L4D2 right before death.
|
||||||
if(StrEqual(currentMap, "c6m3_port") || StrEqual(currentMap, "c6m1_riverbank")) {
|
if(StrEqual(currentMap, "c6m3_port") || StrEqual(currentMap, "c6m1_riverbank")) {
|
||||||
int client = GetClientOfUserId(event.GetInt("userid"));
|
int client = GetClientOfUserId(event.GetInt("userid"));
|
||||||
if(client && GetClientTeam(client) == 2) {
|
if(client > 0 && GetClientTeam(client) == 2) {
|
||||||
SwapL4D1Survivor(client);
|
SwapL4D1Survivor(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,10 @@ void RevertL4D1Survivor(int client) {
|
||||||
}
|
}
|
||||||
//Either use preferred model OR find the least-used.
|
//Either use preferred model OR find the least-used.
|
||||||
public Action Event_PlayerFirstSpawn(Event event, const char[] name, bool dontBroadcast) {
|
public Action Event_PlayerFirstSpawn(Event event, const char[] name, bool dontBroadcast) {
|
||||||
int client = GetClientOfUserId(event.GetInt("userid"));
|
RequestFrame(Frame_CheckClient, event.GetInt("userid"));
|
||||||
|
}
|
||||||
|
public void Frame_CheckClient(int userid) {
|
||||||
|
int client = GetClientOfUserId(userid);
|
||||||
if(client > 0 && GetClientTeam(client) == 2 && !IsFakeClient(client)) {
|
if(client > 0 && GetClientTeam(client) == 2 && !IsFakeClient(client)) {
|
||||||
//todo: hCookiesEnabled.IntVal
|
//todo: hCookiesEnabled.IntVal
|
||||||
if(++survivors > 4 && g_iPendingCookieModel[client] > 0) {
|
if(++survivors > 4 && g_iPendingCookieModel[client] > 0) {
|
||||||
|
@ -332,7 +335,6 @@ public Action Event_PlayerFirstSpawn(Event event, const char[] name, bool dontBr
|
||||||
//RequestFrame(Frame_SetPlayerToLeastUsedModel, client);
|
//RequestFrame(Frame_SetPlayerToLeastUsedModel, client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public void Frame_SetPlayerModel(int client) {
|
public void Frame_SetPlayerModel(int client) {
|
||||||
SetEntityModel(client, survivor_models[g_iPendingCookieModel[client] - 1]);
|
SetEntityModel(client, survivor_models[g_iPendingCookieModel[client] - 1]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue