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))