Raised This Month: $ Target: $400
 0% 

[SOLVED][CS:GO] Change client frags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ceLoFaN
Member
Join Date: Apr 2014
Old 08-26-2014 , 10:02   [SOLVED][CS:GO] Change client frags
Reply With Quote #1

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?
__________________

Last edited by ceLoFaN; 08-29-2014 at 14:34.
ceLoFaN is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 08-26-2014 , 10:11   Re: [CS:GO] Change client frags
Reply With Quote #2

Tried this? https://forums.alliedmods.net/showth...27#post2148127
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
ceLoFaN
Member
Join Date: Apr 2014
Old 08-26-2014 , 17:19   Re: [CS:GO] Change client frags
Reply With Quote #3

That did the job. Thanks Root!
__________________
ceLoFaN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode