From 978467f3c80a61b51378ab76fcecf0ceb812cb8e Mon Sep 17 00:00:00 2001 From: zaCade Date: Thu, 18 Jul 2019 11:27:03 +0200 Subject: [PATCH] PlayerRankings: Send trough ent refs hopefully this fixes the random rotating entities, whoops. --- PlayerRankings/scripting/PlayerRankings.sp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PlayerRankings/scripting/PlayerRankings.sp b/PlayerRankings/scripting/PlayerRankings.sp index 11440e89..95df04cd 100644 --- a/PlayerRankings/scripting/PlayerRankings.sp +++ b/PlayerRankings/scripting/PlayerRankings.sp @@ -666,8 +666,8 @@ void SpawnCrown(int client) AcceptEntityInput(entity, "SetParent", client); DataPack data = new DataPack(); - data.WriteCell(entity); - data.WriteCell(client); + data.WriteCell(EntIndexToEntRef(entity)); + data.WriteCell(EntIndexToEntRef(client)); data.Reset(); CreateTimer(0.1, OnCrownUpdate, data, TIMER_REPEAT); @@ -713,8 +713,8 @@ void SpawnSkull(int client) AcceptEntityInput(entity, "SetParent", client); DataPack data = new DataPack(); - data.WriteCell(entity); - data.WriteCell(client); + data.WriteCell(EntIndexToEntRef(entity)); + data.WriteCell(EntIndexToEntRef(client)); data.Reset(); CreateTimer(0.1, OnSkullUpdate, data, TIMER_REPEAT); @@ -725,8 +725,8 @@ void SpawnSkull(int client) //---------------------------------------------------------------------------------------------------- public Action OnCrownUpdate(Handle timer, DataPack data) { - int entity = data.ReadCell(); - int client = data.ReadCell(); + int entity = EntRefToEntIndex(data.ReadCell()); + int client = EntRefToEntIndex(data.ReadCell()); data.Reset(); if (!IsValidEntity(entity) || !IsClientInGame(client) || !IsPlayerAlive(client)) @@ -752,8 +752,8 @@ public Action OnCrownUpdate(Handle timer, DataPack data) //---------------------------------------------------------------------------------------------------- public Action OnSkullUpdate(Handle timer, DataPack data) { - int entity = data.ReadCell(); - int client = data.ReadCell(); + int entity = EntRefToEntIndex(data.ReadCell()); + int client = EntRefToEntIndex(data.ReadCell()); data.Reset(); if (!IsValidEntity(entity) || !IsClientInGame(client) || !IsPlayerAlive(client))