View Single Post
pRED*
Join Date: Dec 2006
Old 12-27-2007 , 19:40   Re: Empires, get player score
Reply With Quote #5

Sorry, I don't speak spanish german.

The 'CPlayerResource' seems to be the only place that records player scores.

You first need to find the ent id of this:

Code:
new maxplayers = GetMaxClients();
new maxents = GetMaxEntities();

new String:classname[64];

for(new i = maxplayers; i <= maxents; i++)
{
	if(IsValidEntity(i))
	{
		GetEntityNetClass(i, classname, sizeof(classname));
		if(StrEqual(classname, "CTFPlayerResource"))
		{
			ent = i;
			return;
		}
	}
}
Then you can look up the offset of 'm_iScore'

Code:
new offsetFindSendPropOffs("CTFPlayerResource", "m_iScore")
Then check the offset + the client index * 4 (check the prop dump to see this)

Code:
GetEntData(ent, offset + (client*4), 4);
pRED* is offline