PDA

View Full Version : Getting/setting player's score


beatcomet
12-31-2011, 05:44
Is there a way to get/set players score (not kill count)

MindeLT
12-31-2011, 05:52
// Let's get clients death count
if(GetClientDeaths(client) == 20) // Client have 20 deaths
{
SetClientDeaths( client, 100 ); // Set him 100 deaths instead!
}

if(GetClientFrags(client) == 20) // Client have 20 Frags/Kills
{
SetClientFrags( client, 100 ); // Set him 100 instead!
}
stock SetClientFrags( index, frags )
{
SetEntProp( index, Prop_Data, "m_iFrags", frags );
return 1;
}
stock SetClientDeaths( index, deaths )
{
SetEntProp( index, Prop_Data, "m_iDeaths", deaths );
return 1;
}

beatcomet
12-31-2011, 06:21
I don't quite understand that, can you pleas explain what are "m_iFrags" and "m_iDeaths"?
The problem is that the score (the one displayed in the table ) stays the same, the only thing that rises is the kill count

MindeLT
12-31-2011, 09:13
Please use search.

You only need this part SetClientFrags( client, 100 ); // Set him 100 instead!
m_iFrags is entities. Just add those stocks to your script.

beatcomet
12-31-2011, 11:30
The problem is that the score is left the same, the only thing that is being changed is the kill count...

TnTSCS
12-31-2011, 13:19
what game are you scripting for?

beatcomet
12-31-2011, 14:21
TF2