PlayerRankings: Fix error spam galore.
Seems IsValidEntity doesnt work on non CBaseEntity?? Usefull stuff here.
This commit is contained in:
		
							parent
							
								
									978467f3c8
								
							
						
					
					
						commit
						ea911ac720
					
				@ -665,6 +665,9 @@ void SpawnCrown(int client)
 | 
				
			|||||||
	SetVariantString("!activator");
 | 
						SetVariantString("!activator");
 | 
				
			||||||
	AcceptEntityInput(entity, "SetParent", client);
 | 
						AcceptEntityInput(entity, "SetParent", client);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (g_bEngineCSGO)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	DataPack data = new DataPack();
 | 
						DataPack data = new DataPack();
 | 
				
			||||||
	data.WriteCell(EntIndexToEntRef(entity));
 | 
						data.WriteCell(EntIndexToEntRef(entity));
 | 
				
			||||||
	data.WriteCell(EntIndexToEntRef(client));
 | 
						data.WriteCell(EntIndexToEntRef(client));
 | 
				
			||||||
@ -712,6 +715,9 @@ void SpawnSkull(int client)
 | 
				
			|||||||
	SetVariantString("!activator");
 | 
						SetVariantString("!activator");
 | 
				
			||||||
	AcceptEntityInput(entity, "SetParent", client);
 | 
						AcceptEntityInput(entity, "SetParent", client);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (g_bEngineCSGO)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	DataPack data = new DataPack();
 | 
						DataPack data = new DataPack();
 | 
				
			||||||
	data.WriteCell(EntIndexToEntRef(entity));
 | 
						data.WriteCell(EntIndexToEntRef(entity));
 | 
				
			||||||
	data.WriteCell(EntIndexToEntRef(client));
 | 
						data.WriteCell(EntIndexToEntRef(client));
 | 
				
			||||||
@ -725,10 +731,16 @@ void SpawnSkull(int client)
 | 
				
			|||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
public Action OnCrownUpdate(Handle timer, DataPack data)
 | 
					public Action OnCrownUpdate(Handle timer, DataPack data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int entity = EntRefToEntIndex(data.ReadCell());
 | 
					 | 
				
			||||||
	int client = EntRefToEntIndex(data.ReadCell());
 | 
					 | 
				
			||||||
	data.Reset();
 | 
						data.Reset();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						int entity = INVALID_ENT_REFERENCE;
 | 
				
			||||||
 | 
						if ((entity = EntRefToEntIndex(data.ReadCell())) == INVALID_ENT_REFERENCE)
 | 
				
			||||||
 | 
							return Plugin_Stop;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						int client = INVALID_ENT_REFERENCE;
 | 
				
			||||||
 | 
						if ((client = EntRefToEntIndex(data.ReadCell())) == INVALID_ENT_REFERENCE)
 | 
				
			||||||
 | 
							return Plugin_Stop;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!IsValidEntity(entity) || !IsClientInGame(client) || !IsPlayerAlive(client))
 | 
						if (!IsValidEntity(entity) || !IsClientInGame(client) || !IsPlayerAlive(client))
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		AcceptEntityInput(entity, "Kill");
 | 
							AcceptEntityInput(entity, "Kill");
 | 
				
			||||||
@ -752,10 +764,16 @@ public Action OnCrownUpdate(Handle timer, DataPack data)
 | 
				
			|||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
public Action OnSkullUpdate(Handle timer, DataPack data)
 | 
					public Action OnSkullUpdate(Handle timer, DataPack data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int entity = EntRefToEntIndex(data.ReadCell());
 | 
					 | 
				
			||||||
	int client = EntRefToEntIndex(data.ReadCell());
 | 
					 | 
				
			||||||
	data.Reset();
 | 
						data.Reset();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						int entity = INVALID_ENT_REFERENCE;
 | 
				
			||||||
 | 
						if ((entity = EntRefToEntIndex(data.ReadCell())) == INVALID_ENT_REFERENCE)
 | 
				
			||||||
 | 
							return Plugin_Stop;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						int client = INVALID_ENT_REFERENCE;
 | 
				
			||||||
 | 
						if ((client = EntRefToEntIndex(data.ReadCell())) == INVALID_ENT_REFERENCE)
 | 
				
			||||||
 | 
							return Plugin_Stop;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!IsValidEntity(entity) || !IsClientInGame(client) || !IsPlayerAlive(client))
 | 
						if (!IsValidEntity(entity) || !IsClientInGame(client) || !IsPlayerAlive(client))
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		AcceptEntityInput(entity, "Kill");
 | 
							AcceptEntityInput(entity, "Kill");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user