Hello, how does one change the frags of a given client?
I have tried:
1.
Code:
SetEntProp(client, Prop_Data, "m_iFrags", amount);
I didn't even bother testing if this works server side but the frags aren't getting sent to the client and using Prop_Send instead of Prop_Data will result in a console error.
2.
Code:
new g_iGameScoreEntity;
public Action:OnRoundStart(Handle:hEvent, const String:sName[], bool:dontBroadcast)
{
g_iGameScoreEntity = CreateEntityByName("game_score");
DispatchSpawn(g_iGameScoreEntity);
}
...
stock SetClientFrags(iClient, iFrags)
{
SetEntProp(iClient, Prop_Data, "m_iFrags", iFrags);
AcceptEntityInput(g_iGameScoreEntity, "ApplyScore", iClient, g_iGameScoreEntity);
}
This will only work for a round though.
I wanted to give a frag to every player that dies by fall, in order to counter the -1 frag penalty that is built in the game.
I tested this and the next round after I died the -1 frag was back.
I'm also getting errors like this every once in a while: [SM] Native "AcceptEntityInput" reported: Entity 130 (130) is not a CBaseEntity.
I could create and destroy the entity within the SetClientFrags function and the problem would probably be gone.
I could update the score every round I guess, but it's weird that this is happening. Why would it even happen?
Any suggestions?
__________________