diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim.dx80.vtx b/season_halloween/content/models/player/techknow/grimreaper/grim.dx80.vtx deleted file mode 100644 index 00b86c10..00000000 Binary files a/season_halloween/content/models/player/techknow/grimreaper/grim.dx80.vtx and /dev/null differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim.mdl b/season_halloween/content/models/player/techknow/grimreaper/grim.mdl deleted file mode 100644 index 6c98e28a..00000000 Binary files a/season_halloween/content/models/player/techknow/grimreaper/grim.mdl and /dev/null differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim.phy b/season_halloween/content/models/player/techknow/grimreaper/grim.phy deleted file mode 100644 index 82f80dcf..00000000 Binary files a/season_halloween/content/models/player/techknow/grimreaper/grim.phy and /dev/null differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim.sw.vtx b/season_halloween/content/models/player/techknow/grimreaper/grim.sw.vtx deleted file mode 100644 index 7413847c..00000000 Binary files a/season_halloween/content/models/player/techknow/grimreaper/grim.sw.vtx and /dev/null differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim.vvd b/season_halloween/content/models/player/techknow/grimreaper/grim.vvd deleted file mode 100644 index e9fbcf7e..00000000 Binary files a/season_halloween/content/models/player/techknow/grimreaper/grim.vvd and /dev/null differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.dx80.vtx b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.dx80.vtx new file mode 100644 index 00000000..385c947f Binary files /dev/null and b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.dx80.vtx differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.dx90.vtx b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.dx90.vtx new file mode 100644 index 00000000..e7f4616c Binary files /dev/null and b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.dx90.vtx differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.mdl b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.mdl new file mode 100644 index 00000000..74e4258c Binary files /dev/null and b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.mdl differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.phy b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.phy new file mode 100644 index 00000000..42ff3418 Binary files /dev/null and b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.phy differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim.dx90.vtx b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.sw.vtx similarity index 52% rename from season_halloween/content/models/player/techknow/grimreaper/grim.dx90.vtx rename to season_halloween/content/models/player/techknow/grimreaper/grim_unloze.sw.vtx index 148600c3..2ead6593 100644 Binary files a/season_halloween/content/models/player/techknow/grimreaper/grim.dx90.vtx and b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.sw.vtx differ diff --git a/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.vvd b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.vvd new file mode 100644 index 00000000..64b794a7 Binary files /dev/null and b/season_halloween/content/models/player/techknow/grimreaper/grim_unloze.vvd differ diff --git a/season_halloween/scripting/season_halloween.sp b/season_halloween/scripting/season_halloween.sp index e5d4baee..dbfc9223 100644 --- a/season_halloween/scripting/season_halloween.sp +++ b/season_halloween/scripting/season_halloween.sp @@ -65,6 +65,7 @@ public void OnPluginStart() HookEvent("round_start", OnRoundStart, EventHookMode_Post); RegConsoleCmd("sm_pumpkins", Command_Collected, "Shows the total amount of Pumpkins you have collected so far"); + RegConsoleCmd("sm_pumpkin", Command_Collected, "Shows the total amount of Pumpkins you have collected so far"); RegConsoleCmd("sm_halloween", Command_Collected, "Shows the total amount of Pumpkins you have collected so far"); RegConsoleCmd("sm_highscore", Command_HighScore, "Shows the Pumpkin HighScore"); @@ -100,19 +101,19 @@ public void OnMapStart() AddFileToDownloadsTable("materials/models/player/techknow/thorn/headlight.vmt"); PrecacheModel("models/player/techknow/thorn/thorn.mdl"); - AddFileToDownloadsTable("models/player/techknow/grimreaper/grim.dx80.vtx"); - AddFileToDownloadsTable("models/player/techknow/grimreaper/grim.dx90.vtx"); - AddFileToDownloadsTable("models/player/techknow/grimreaper/grim.mdl"); - AddFileToDownloadsTable("models/player/techknow/grimreaper/grim.phy"); - AddFileToDownloadsTable("models/player/techknow/grimreaper/grim.sw.vtx"); - AddFileToDownloadsTable("models/player/techknow/grimreaper/grim.vvd"); + AddFileToDownloadsTable("models/player/techknow/grimreaper/grim_unloze.dx80.vtx"); + AddFileToDownloadsTable("models/player/techknow/grimreaper/grim_unloze.dx90.vtx"); + AddFileToDownloadsTable("models/player/techknow/grimreaper/grim_unloze.mdl"); + AddFileToDownloadsTable("models/player/techknow/grimreaper/grim_unloze.phy"); + AddFileToDownloadsTable("models/player/techknow/grimreaper/grim_unloze.sw.vtx"); + AddFileToDownloadsTable("models/player/techknow/grimreaper/grim_unloze.vvd"); AddFileToDownloadsTable("materials/models/player/techknow/grimreaper/grim.vmt"); AddFileToDownloadsTable("materials/models/player/techknow/grimreaper/grim.vtf"); AddFileToDownloadsTable("materials/models/player/techknow/grimreaper/grim_n.vtf"); AddFileToDownloadsTable("materials/models/player/techknow/grimreaper/grim2.vmt"); AddFileToDownloadsTable("materials/models/player/techknow/grimreaper/grim2.vtf"); AddFileToDownloadsTable("materials/models/player/techknow/grimreaper/grim2_n.vtf"); - PrecacheModel("models/player/techknow/grimreaper/grim.mdl"); + PrecacheModel("models/player/techknow/grimreaper/grim_unloze.mdl"); AddFileToDownloadsTable("models/player/microsoft/skeleton.dx80.vtx"); AddFileToDownloadsTable("models/player/microsoft/skeleton.dx90.vtx"); @@ -455,15 +456,19 @@ public Action SpawnCollectable(Handle timer) return; int iTarget = GetTargetClient(); + + if (!IsValidClient(iTarget, false)) + return; + float fOrigin[3]; float fTempOrigin[3]; GetClientAbsOrigin(iTarget, fOrigin); // Rotating int iRotating = CreateEntityAtOrigin("func_rotating", fOrigin); - DispatchKeyFormat(iRotating, "targetname", "season_rotating_%d", g_iCounter); + DispatchKeyFormat(iRotating, "targetname", "season_rotating_%d", g_iCounter); DispatchKeyFormat(iRotating, "maxspeed", "20"); - DispatchKeyFormat(iRotating, "spawnflags", "65"); + DispatchKeyFormat(iRotating, "spawnflags", "65"); SpawnAndActivate(iRotating); // make the trigger work. @@ -619,9 +624,25 @@ public void HookCallback(const char[] output, int caller, int activator, float d char sSteamID[32]; GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID)); + char sName[MAX_NAME_LENGTH]; + GetClientName(client, sName, sizeof(sName)); + char sQuery[255]; - Format(sQuery, sizeof(sQuery), "SELECT collected FROM halloween_table WHERE steam_auth = '%s'", sSteamID); - SQL_TQuery(g_hDatabase, TQueryCBUpdate, sQuery, GetClientUserId(client)); + Format(sQuery, sizeof(sQuery), "INSERT INTO halloween_table (steam_auth,name,collected) VALUES ('%s','%s',1) ON DUPLICATE KEY UPDATE collected=collected+1;", sSteamID, sName); + SQL_FastQuery(g_hDatabase, sQuery); + + g_iCollected[client] += 1; + CheckAndAddFlag(client); + + CPrintToChat(client, "{darkorange}[UNLOZE HALLOWEEN] {white}Your Team found a pumpkin! You have collected {green}%d {white}pumpkins so far.", g_iCollected[client]); + if (g_iCollected[client] == g_hCVar_MilestoneInfection.IntValue) + CPrintToChat(client, "{darkorange}[UNLOZE HALLOWEEN] {white}Congratulations! You have unlocked {red}INFECTION EFFECTS{white}!"); + + if (g_iCollected[client] == g_hCVar_MilestoneGrenade.IntValue) + CPrintToChat(client, "{darkorange}[UNLOZE HALLOWEEN] {white}Congratulations! You have unlocked {red}GRENADE SKINS{white}!"); + + if (g_iCollected[client] == g_hCVar_MilestoneSkin.IntValue) + CPrintToChat(client, "{darkorange}[UNLOZE HALLOWEEN] {white}Congratulations! You have unlocked {red}HALLOWEEN SKINS{white}!"); } } } @@ -629,49 +650,6 @@ public void HookCallback(const char[] output, int caller, int activator, float d //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- -public void TQueryCBUpdate(Handle owner, Handle rs, const char[] error, any data) -{ - int client = 0; - - if ((client = GetClientOfUserId(data)) == 0) - return; - - char sQuery[255]; - char sName[MAX_NAME_LENGTH]; - GetClientName(client, sName, sizeof(sName)); - char sSteamID[32]; - GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID)); - - if (SQL_GetRowCount(rs) > 0) - { - int iField; - SQL_FetchRow(rs); - SQL_FieldNameToNum(rs, "collected", iField); - g_iCollected[client] = SQL_FetchInt(rs, iField); - g_iCollected[client] += 1; - Format(sQuery, sizeof(sQuery), "UPDATE halloween_table SET name='%s', collected='%d' WHERE steam_auth='%s'", sName, g_iCollected[client], sSteamID); - SQL_FastQuery(g_hDatabase, sQuery); - } - else - { - Format(sQuery, sizeof(sQuery), "INSERT INTO halloween_table (steam_auth, name, collected) VALUES ('%s', '%s', '%d')", sSteamID, sName, 1); - SQL_FastQuery(g_hDatabase, sQuery); - g_iCollected[client] = 1; - } - delete rs; - CheckAndAddFlag(client); - - CPrintToChat(client, "{darkorange}[UNLOZE HALLOWEEN] {white}Your Team found a pumpkin! You have collected {green}%d {white}pumpkins so far.", g_iCollected[client]); - if (g_iCollected[client] == g_hCVar_MilestoneInfection.IntValue) - CPrintToChat(client, "{darkorange}[UNLOZE HALLOWEEN] {white}Congratulations! You have unlocked {red}INFECTION EFFECTS{white}!"); - - if (g_iCollected[client] == g_hCVar_MilestoneGrenade.IntValue) - CPrintToChat(client, "{darkorange}[UNLOZE HALLOWEEN] {white}Congratulations! You have unlocked {red}GRENADE SKINS{white}!"); - - if (g_iCollected[client] == g_hCVar_MilestoneSkin.IntValue) - CPrintToChat(client, "{darkorange}[UNLOZE HALLOWEEN] {white}Congratulations! You have unlocked {red}HALLOWEEN SKINS{white}!"); -} - public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn) { if (!IsValidClient(attacker)) @@ -794,6 +772,9 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo } } +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- public void OnEntityCreated(int entity, const char[] classname) { if (StrContains(classname, "_projectile", false) != -1) @@ -801,6 +782,9 @@ public void OnEntityCreated(int entity, const char[] classname) } +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- public void ProjectileSpawned(int Entity) { int iOwner = GetEntPropEnt(Entity, Prop_Data, "m_hOwnerEntity"); @@ -809,13 +793,22 @@ public void ProjectileSpawned(int Entity) if (g_iCollected[iOwner] >= g_hCVar_MilestoneGrenade.IntValue) { - int iRandomSkin = GetRandomInt(0, 0); - if (iRandomSkin == 0) - { - SetEntityModel(Entity, "models/models_kit/hallo_pumpkin_l.mdl"); - SetVariantString("modelscale 0.35"); - AcceptEntityInput(Entity, "AddOutput"); - } + SetEntityRenderMode(Entity, RENDER_NONE); + + float fNadeOrigin[3]; + GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", fNadeOrigin); + + int iNadeProp = CreateEntityAtOrigin("prop_dynamic_override", fNadeOrigin); + DispatchKeyFormat(iNadeProp, "targetname", "season_nade_prop_%d", g_iCounter); + + DispatchKeyFormat(iNadeProp, "model", "models/models_kit/hallo_pumpkin_l.mdl"); + DispatchKeyFormat(iNadeProp, "disableshadows", "1"); + DispatchKeyFormat(iNadeProp, "disablereceiveshadows", "1"); + DispatchKeyFormat(iNadeProp, "DisableBoneFollowers", "1"); + DispatchKeyFormat(iNadeProp, "modelscale", "0.35"); + + SpawnAndActivate(iNadeProp); + ParentToEntity(iNadeProp, Entity); } } diff --git a/season_xmas/scripting/season_xmas.sp b/season_xmas/scripting/season_xmas.sp index 2e06cec2..7f31aa36 100644 --- a/season_xmas/scripting/season_xmas.sp +++ b/season_xmas/scripting/season_xmas.sp @@ -65,6 +65,7 @@ public void OnPluginStart() HookEvent("round_start", OnRoundStart, EventHookMode_Post); RegConsoleCmd("sm_presents", Command_Collected, "Shows the total amount of Presents you have collected so far"); + RegConsoleCmd("sm_xmas", Command_Collected, "Shows the total amount of Presents you have collected so far"); RegConsoleCmd("sm_highscore", Command_HighScore, "Shows the Present HighScore"); AutoExecConfig(); @@ -236,6 +237,7 @@ public void OnMapStart() AddFileToDownloadsTable("sound/unl1/season/hohohoho.wav"); PrecacheSound("sound/unl1/season/hohohoho.wav"); + float fRandomInterval = GetRandomFloat(GetConVarFloat(g_hCVar_RandomIntervalMin), GetConVarFloat(g_hCVar_RandomIntervalMax)); CreateTimer(fRandomInterval, SpawnCollectable, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE); } @@ -477,14 +479,18 @@ public Action SpawnCollectable(Handle timer) return; int iTarget = GetTargetClient(); + + if (!IsValidClient(iTarget, false)) + return; + float fOrigin[3]; GetClientAbsOrigin(iTarget, fOrigin); // Rotating int iRotating = CreateEntityAtOrigin("func_rotating", fOrigin); - DispatchKeyFormat(iRotating, "targetname", "season_rotating_%d", g_iCounter); + DispatchKeyFormat(iRotating, "targetname", "season_rotating_%d", g_iCounter); DispatchKeyFormat(iRotating, "maxspeed", "20"); - DispatchKeyFormat(iRotating, "spawnflags", "65"); + DispatchKeyFormat(iRotating, "spawnflags", "65"); SpawnAndActivate(iRotating); // make the trigger work. @@ -495,7 +501,7 @@ public Action SpawnCollectable(Handle timer) // Model int iModel = CreateEntityAtOrigin("prop_dynamic_override", fOrigin); DispatchKeyFormat(iModel, "targetname", "season_prop_%d", g_iCounter); - DispatchKeyFormat(iModel, "model", "models/zombieden/xmas/giftbox.mdl"); + DispatchKeyFormat(iModel, "model", "models/zombieden/xmas/giftbox.mdl"); DispatchKeyFormat(iModel, "modelscale", "0.8"); DispatchKeyFormat(iModel, "disablebonefollowers", "1"); SpawnAndActivate(iModel); @@ -519,9 +525,9 @@ public Action SpawnCollectable(Handle timer) // Trigger int iTrigger = CreateEntityAtOrigin("trigger_multiple", fOrigin); - DispatchKeyFormat(iTrigger, "targetname", "season_trigger_%d", g_iCounter); - DispatchKeyFormat(iTrigger, "spawnflags", "1"); - DispatchKeyFormat(iTrigger, "startdisabled", "1"); + DispatchKeyFormat(iTrigger, "targetname", "season_trigger_%d", g_iCounter); + DispatchKeyFormat(iTrigger, "spawnflags", "1"); + DispatchKeyFormat(iTrigger, "startdisabled", "1"); DispatchKeyFormat(iTrigger, "OnUser1", "season_hitbox_%d,FireUser2,,0,1", g_iCounter); SpawnAndActivate(iTrigger); ParentToEntity(iTrigger, iRotating); @@ -550,24 +556,24 @@ public Action SpawnCollectable(Handle timer) // Hitbox int iHitbox = CreateEntityAtOrigin("func_physbox_multiplayer", fOrigin); DispatchKeyFormat(iHitbox, "targetname", "season_hitbox_%d", g_iCounter); - DispatchKeyFormat(iHitbox, "model", "models/zombieden/xmas/giftbox.mdl"); + DispatchKeyFormat(iHitbox, "model", "models/zombieden/xmas/giftbox.mdl"); DispatchKeyFormat(iHitbox, "modelscale", "0.8"); DispatchKeyFormat(iHitbox, "disableshadows", "1"); - DispatchKeyFormat(iHitbox, "disablereceiveshadows", "1"); - DispatchKeyFormat(iHitbox, "DisableBoneFollowers", "1"); + DispatchKeyFormat(iHitbox, "disablereceiveshadows", "1"); + DispatchKeyFormat(iHitbox, "DisableBoneFollowers", "1"); DispatchKeyFormat(iHitbox, "rendermode", "10"); DispatchKeyFormat(iHitbox, "PerformanceMode", "1"); - DispatchKeyFormat(iHitbox, "material", "3"); + DispatchKeyFormat(iHitbox, "material", "3"); DispatchKeyFormat(iHitbox, "health", "200"); DispatchKeyFormat(iHitbox, "physdamagescale", "1.0"); DispatchKeyFormat(iHitbox, "OnBreak", "season_rotating_%d,KillHierarchy,,2.5,1", g_iCounter); DispatchKeyFormat(iHitbox, "OnBreak", "season_particle_%d,Start,,0,1", g_iCounter); - DispatchKeyFormat(iHitbox, "OnBreak", "season_sound_%d,Start,PlaySound,,0,1", g_iCounter); - DispatchKeyFormat(iHitbox, "OnBreak", "season_sound_%d,Start,Kill,,2.4,1", g_iCounter); + DispatchKeyFormat(iHitbox, "OnBreak", "season_sound_%d,PlaySound,,0,1", g_iCounter); + DispatchKeyFormat(iHitbox, "OnBreak", "season_sound_%d,Kill,,2.4,1", g_iCounter); DispatchKeyFormat(iHitbox, "OnUser1", "season_rotating_%d,KillHierarchy,,59.0,1", g_iCounter); - DispatchKeyFormat(iHitbox, "OnUser1", "season_sound_%d,Start,Kill,,59.0,1", g_iCounter); + DispatchKeyFormat(iHitbox, "OnUser1", "season_sound_%d,Kill,,59.0,1", g_iCounter); DispatchKeyFormat(iHitbox, "OnUser2", "season_rotating_%d,KillHierarchy,,0,1", g_iCounter); - DispatchKeyFormat(iHitbox, "OnUser2", "season_sound_%d,Start,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHitbox, "OnUser2", "season_sound_%d,Kill,,0,1", g_iCounter); SpawnAndActivate(iHitbox); ParentToEntity(iHitbox, iRotating); @@ -637,74 +643,46 @@ public void HookCallback(const char[] output, int caller, int activator, float d char sSteamID[32]; GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID)); + char sName[MAX_NAME_LENGTH]; + GetClientName(client, sName, sizeof(sName)); + char sQuery[255]; - Format(sQuery, sizeof(sQuery), "SELECT collected FROM xmas_table WHERE steam_auth = '%s'", sSteamID); - SQL_TQuery(g_hDatabase, TQueryCBUpdate, sQuery, GetClientUserId(client)); + Format(sQuery, sizeof(sQuery), "INSERT INTO xmas_table (steam_auth,name,collected) VALUES ('%s','%s',1) ON DUPLICATE KEY UPDATE collected=collected+1;", sSteamID, sName); + SQL_FastQuery(g_hDatabase, sQuery); + + g_iCollected[client] += 1; + CheckAndAddFlag(client); + + CPrintToChat(client, "{green}[UNLOZE XMAS] {white}Your Team opened a present! You have collected {green}%d {white}presents so far.", g_iCollected[client]); + if (g_iCollected[client] == g_hCVar_MilestoneInfection.IntValue) + CPrintToChat(client, "{green}[UNLOZE XMAS] {white}Congratulations! You have unlocked {red}INFECTION EFFECTS{white}!"); + + if (g_iCollected[client] == g_hCVar_MilestoneGrenade.IntValue) + CPrintToChat(client, "{green}[UNLOZE XMAS] {white}Congratulations! You have unlocked {red}GRENADE SKINS{white}!"); + + if (g_iCollected[client] == g_hCVar_MilestoneSkin.IntValue) + CPrintToChat(client, "{green}[UNLOZE XMAS] {white}Congratulations! You have unlocked {red}XMAS SKINS{white}!"); } } } -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void TQueryCBUpdate(Handle owner, Handle rs, const char[] error, any data) -{ - int client = 0; - - if ((client = GetClientOfUserId(data)) == 0) - return; - - char sQuery[255]; - char sName[MAX_NAME_LENGTH]; - GetClientName(client, sName, sizeof(sName)); - char sSteamID[32]; - GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID)); - - if (SQL_GetRowCount(rs) > 0) - { - int iField; - SQL_FetchRow(rs); - SQL_FieldNameToNum(rs, "collected", iField); - g_iCollected[client] = SQL_FetchInt(rs, iField); - g_iCollected[client] += 1; - Format(sQuery, sizeof(sQuery), "UPDATE xmas_table SET name='%s', collected='%d' WHERE steam_auth='%s'", sName, g_iCollected[client], sSteamID); - SQL_FastQuery(g_hDatabase, sQuery); - } - else - { - Format(sQuery, sizeof(sQuery), "INSERT INTO xmas_table (steam_auth, name, collected) VALUES ('%s', '%s', '%d')", sSteamID, sName, 1); - SQL_FastQuery(g_hDatabase, sQuery); - g_iCollected[client] = 1; - } - delete rs; - CheckAndAddFlag(client); - - CPrintToChat(client, "{green}[UNLOZE XMAS] {white}Your Team opened a present! You have collected {green}%d {white}presents so far.", g_iCollected[client]); - if (g_iCollected[client] == g_hCVar_MilestoneInfection.IntValue) - CPrintToChat(client, "{green}[UNLOZE XMAS] {white}Congratulations! You have unlocked {red}INFECTION EFFECTS{white}!"); - - if (g_iCollected[client] == g_hCVar_MilestoneGrenade.IntValue) - CPrintToChat(client, "{green}[UNLOZE XMAS] {white}Congratulations! You have unlocked {red}GRENADE SKINS{white}!"); - - if (g_iCollected[client] == g_hCVar_MilestoneSkin.IntValue) - CPrintToChat(client, "{green}[UNLOZE XMAS] {white}Congratulations! You have unlocked {red}XMAS SKINS{white}!"); -} - public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn) { + if (!IsValidClient(attacker)) + return; + if (g_hCVar_InfectionEffectEnabled.BoolValue && ((g_iCollected[client] >= g_hCVar_MilestoneInfection.IntValue) || g_iCollected[attacker] >= g_hCVar_MilestoneInfection.IntValue)) { float fInfectionOrigin[3]; GetClientAbsOrigin(client, fInfectionOrigin); - // Rotating int iRotating = CreateEntityAtOrigin("func_rotating", fInfectionOrigin); DispatchKeyFormat(iRotating, "targetname", "season_infection_rotating_%d", g_iCounter); - DispatchKeyFormat(iRotating, "maxspeed", "13"); + DispatchKeyFormat(iRotating, "maxspeed", "13"); DispatchKeyFormat(iRotating, "spawnflags", "65"); - DispatchKeyFormat(iRotating, "OnUser1", "!self,KillHierarchy,,45,1"); - DispatchKeyFormat(iRotating, "OnUser2", "!self,KillHierarchy,,0,1"); + DispatchKeyFormat(iRotating, "OnUser1", "!self,KillHierarchy,,45,1"); + DispatchKeyFormat(iRotating, "OnUser2", "!self,KillHierarchy,,0,1"); SpawnAndActivate(iRotating); // make the trigger work. @@ -751,7 +729,7 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo DispatchKeyFormat(iModel, "disableshadows", "1"); DispatchKeyFormat(iModel, "disablereceiveshadows", "1"); - DispatchKeyFormat(iModel, "DisableBoneFollowers", "1"); + DispatchKeyFormat(iModel, "DisableBoneFollowers", "1"); DispatchKeyValueVector(iModel, "origin", fInfectionOrigin); SpawnAndActivate(iModel); ParentToEntity(iModel, iRotating); @@ -784,41 +762,50 @@ public void ProjectileSpawned(int Entity) if (g_iCollected[iOwner] >= g_hCVar_MilestoneGrenade.IntValue) { + SetEntityRenderMode(Entity, RENDER_NONE); + + float fNadeOrigin[3]; + GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", fNadeOrigin); + + int iNadeProp = CreateEntityAtOrigin("prop_dynamic_override", fNadeOrigin); + DispatchKeyFormat(iNadeProp, "targetname", "season_nade_prop_%d", g_iCounter); + DispatchKeyFormat(iNadeProp, "disableshadows", "1"); + DispatchKeyFormat(iNadeProp, "disablereceiveshadows", "1"); + DispatchKeyFormat(iNadeProp, "DisableBoneFollowers", "1"); + int iRandomSkin = GetRandomInt(0, 3); if (iRandomSkin == 0) { - SetEntityModel(Entity, "models/weapons/w_snowball_thrown.mdl"); - SetVariantString("modelscale 3.0"); - AcceptEntityInput(Entity, "AddOutput"); + DispatchKeyFormat(iNadeProp, "model", "models/weapons/w_snowball_thrown.mdl"); + DispatchKeyFormat(iNadeProp, "modelscale", "3.0"); } else if (iRandomSkin == 1) { - SetEntityModel(Entity, "models/zombieden/xmas/giftbox.mdl"); - SetVariantString("modelscale 0.6"); - AcceptEntityInput(Entity, "AddOutput"); + DispatchKeyFormat(iNadeProp, "model", "models/zombieden/xmas/giftbox.mdl"); + DispatchKeyFormat(iNadeProp, "modelscale", "0.6"); iRandomSkin = GetRandomInt(0, 1); if (iRandomSkin == 0) { - SetVariantString("0"); + DispatchKeyFormat(iNadeProp, "skin", "0"); } else if (iRandomSkin == 1) { - SetVariantString("1"); + DispatchKeyFormat(iNadeProp, "skin", "1"); } - AcceptEntityInput(Entity, "Skin"); } else if (iRandomSkin == 2) { - SetEntityModel(Entity, "models/weapons/w_ornament_thrown.mdl"); - SetVariantString("modelscale 2.0"); - AcceptEntityInput(Entity, "AddOutput"); + DispatchKeyFormat(iNadeProp, "model", "models/weapons/w_ornament_thrown.mdl"); + DispatchKeyFormat(iNadeProp, "modelscale", "2.0"); } else if (iRandomSkin == 3) { - SetEntityModel(Entity, "models/weapons/w_santa_hat_thrown.mdl"); - SetVariantString("modelscale 2.3"); - AcceptEntityInput(Entity, "AddOutput"); + DispatchKeyFormat(iNadeProp, "model", "models/weapons/w_santa_hat_thrown.mdl"); + DispatchKeyFormat(iNadeProp, "modelscale", "2.3"); } + + SpawnAndActivate(iNadeProp); + ParentToEntity(iNadeProp, Entity); } }