Raised This Month: $12 Target: $400
 3% 

Modify Score csgo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gena
Member
Join Date: May 2022
Location: Uruguay
Old 06-23-2022 , 21:17   Modify Score csgo
Reply With Quote #1

How can I do so that a death or kill does not affect the score at certain times, I have something like this, but I know it's wrong.
Code:
public Action Event_PlayerDeath(Handle event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	int victim = GetClientOfUserId(GetEventInt(event, "userid"));
	int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));

	if	(g_indm[client])
	{
	        SetEntProp(victim, Prop_Data, "m_iDeaths", GetClientDeaths(victim) - 1);
                SetEntProp(attacker, Prop_Data, "m_iKills", GetClientFrags(attacker) - 1);
	}
__________________
Servers of CS:GO - Private Plugins
Steam ~ GenaEscobar#2338
sorry for my english as a translator d:

Last edited by Gena; 06-29-2022 at 20:51.
Gena is offline
analepic
Junior Member
Join Date: Apr 2022
Old 06-29-2022 , 18:51   Re: Modify Score csgo
Reply With Quote #2

Quote:
Originally Posted by Gena View Post
How can I do so that a death or kill does not affect the score at certain times, I have something like this, but I know it's wrong.
(It's from a long time ago so it's probably mixed up)
Code:
public Action Event_PlayerDeath(Handle event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	int victim = GetClientOfUserId(GetEventInt(event, "userid"));
	int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));

	if	(g_indm[client])
	{
	        SetEntProp(GetPlayerResourceEntity(), Prop_Send, "m_iDeaths", _, victim);
		SetEntProp(client, Prop_Data, "m_iDeaths", -1);
		
                SetEntProp(attacker, Prop_Data, "m_iKills", GetClientFrags(attacker) -1);
		SetEntProp(GetPlayerResourceEntity(), Prop_Send, "m_iKills", g_indm[attacker], _, attacker);
	}
Would you be comfortable sharing that with us since Im guessing that the original owner stopped updating this plugin. Thanks in advance.
analepic is offline
Gena
Member
Join Date: May 2022
Location: Uruguay
Old 06-29-2022 , 20:43   Re: Modify Score csgo
Reply With Quote #3

Quote:
Originally Posted by analepic View Post
Would you be comfortable sharing that with us since Im guessing that the original owner stopped updating this plugin. Thanks in advance.
it is payment made by me.
if you are interested just here.
__________________
Servers of CS:GO - Private Plugins
Steam ~ GenaEscobar#2338
sorry for my english as a translator d:

Last edited by Gena; 07-05-2022 at 23:01.
Gena is offline
Cruze
Veteran Member
Join Date: May 2017
Old 06-30-2022 , 11:09   Re: Modify Score csgo
Reply With Quote #4

PHP Code:
public Action Event_PlayerDeath(Handle event, const char[] namebool dontBroadcast)
{
    
int victim GetClientOfUserId(GetEventInt(event"userid"));
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    

    if(
attacker && attacker <= MaxClients && g_indm[attacker])
    {
        
SetEntProp(attackerProp_Data"m_iFrags"GetClientFrags(attacker) - 1);
    }
    if(
victim && victim <= MaxClients && g_indm[victim])
    {
        
SetEntProp(victimProp_Data"m_iDeaths"GetClientDeaths(victim) - 1);
    }

__________________
Taking paid private requests! Contact me

Last edited by Cruze; 07-01-2022 at 15:49. Reason: my bad. didn't check netprop
Cruze is offline
Gena
Member
Join Date: May 2022
Location: Uruguay
Old 07-01-2022 , 14:50   Re: Modify Score csgo
Reply With Quote #5

Quote:
Originally Posted by Cruze View Post
PHP Code:
public Action Event_PlayerDeath(Handle event, const char[] namebool dontBroadcast)
{
    
int victim GetClientOfUserId(GetEventInt(event"userid"));
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    

    if(
attacker && attacker <= MaxClients && g_indm[attacker])
    {
        
SetEntProp(attackerProp_Data"m_iKills"GetClientFrags(attacker) - 1);
    }
    if(
victim && victim <= MaxClients && g_indm[victim])
    {
        
SetEntProp(victimProp_Data"m_iDeaths"GetClientDeaths(victim) - 1);
    }

L 07/01/2022 - 15:49:27: [SM] Exception reported: Property "m_iKills" not found (entity 2/player)
This came out putting me as I had from the beginning.
Code:
PrintToServer("REDIEDM %i", GetClientDeaths(attacker)); //log
so i put it:
Code:
		if(attacker > 0 && attacker <= MaxClients && g_indm[attacker])
    {
        PrintToServer("REDIEDM attacker before SetEntProp"); //log
		SetEntProp(attacker, Prop_Data, "m_iKills", GetClientFrags(attacker) - 1); //this not work
		PrintToServer("REDIEDM %i", GetClientFrags(attacker)); //log
    }
    if(victim > 0 && victim <= MaxClients && g_indm[victim])
    {
        g_indm[client] = true;
		CreateTimer(1.0, TSPAWNP, GetClientUserId(victim), TIMER_FLAG_NO_MAPCHANGE); //respawn on mode dm
		PrintToServer("REDIEDM victim before SetEntProp"); //log
		SetEntProp(victim, Prop_Data, "m_iDeaths", GetClientDeaths(victim) - 1);
		PrintToServer("REDIEDM %i", GetClientDeaths(victim)); //log
    }
this came out:
Code:
REDIEDM attacker before SetEntProp
L 07/01/2022 - 16:28:21: [SM] Exception reported: Property "m_iKills" not found (entity 2/player)
L 07/01/2022 - 16:28:21: [SM] Blaming: Gena-DeathMatchRedie.smx
L 07/01/2022 - 16:28:21: [SM] Call stack trace:
L 07/01/2022 - 16:28:21: [SM]   [0] SetEntProp
L 07/01/2022 - 16:28:21: [SM]   [1] Line 149, Gena-DeathMatchRedie.sp::Event_PlayerDeath
and it doesn't respawn me, this means that something is wrong
__________________
Servers of CS:GO - Private Plugins
Steam ~ GenaEscobar#2338
sorry for my english as a translator d:

Last edited by Gena; 07-01-2022 at 15:29.
Gena is offline
Cruze
Veteran Member
Join Date: May 2017
Old 07-01-2022 , 15:50   Re: Modify Score csgo
Reply With Quote #6

my bad. updated my post
__________________
Taking paid private requests! Contact me
Cruze is offline
Gena
Member
Join Date: May 2022
Location: Uruguay
Old 07-01-2022 , 17:16   Re: Modify Score csgo
Reply With Quote #7

Quote:
Originally Posted by Cruze View Post
my bad. updated my post
kills work, but getting deaths doesn't, but at least it detects them.
Code:
L 07/01/2022 - 18:14:22: "Jerry<11><BOT><TERRORIST>" [-609 2965 -344] killed "gena<3><STEAM_1:1:115569836><CT>" [-572 2969 -280] with "knife_t"
REDIEDM attacker before SetEntProp
REDIEDM 7
REDIEDM victim before SetEntProp
REDIEDM 7
__________________
Servers of CS:GO - Private Plugins
Steam ~ GenaEscobar#2338
sorry for my english as a translator d:
Gena is offline
Reply


Thread Tools
Display Modes

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 01:27.


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