Reset Score - 2

Coding Help/Re-API Supported
Post Reply
User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

Reset Score - 2

#1

Post by ArminC » 1 Year Ago

Instead of MIN Deaths + Frags to allow you to Reset The Score at the next round/spawn :) If the score is 0.. it should say that's already .. reseted..

Code: Select all

#include <amxmodx>
#include <reapi>

#define MIN_FRAGS 3 // Player who has more than minimum frags will be able to reset his score but not lower
#define MIN_DEATHS 1 // Player who has more than minimum deaths will be able to reset his score but not lower

new const resetScoreCommands[][] =
{
	"/rs", "/resetscore", "/rscore", "/resets"
}

new sayCmd[64], sayTeamCmd[64], x

public plugin_init()
{
	register_plugin("Reset Score", "1.2", "Raheem")
	
	// Commands
	for (x = 0; x <= charsmax(resetScoreCommands); x++)
	{
		formatex(sayCmd, charsmax(sayCmd), "say %s", resetScoreCommands[x])
		formatex(sayTeamCmd, charsmax(sayTeamCmd), "say_team %s", resetScoreCommands[x])
		register_clcmd(sayCmd, "CmdSay")
		register_clcmd(sayTeamCmd, "CmdSay")
	}
}

public CmdSay(id)
{
	if (get_entvar(id, var_frags) > MIN_FRAGS || get_member(id, m_iDeaths) > MIN_DEATHS)
	{
		set_entvar(id, var_frags, 0.0)
		set_member(id, m_iDeaths, 0)
		
		message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"))
		write_byte(id) // id
		write_short(0) // Frags
		write_short(0) // Deaths
		write_short(0) // Class
		write_short(get_member(id, m_iTeam)) // Team
		message_end()
		
		client_print_color(id, print_team_default, "^1[^4RS^1] ^3Your score has been ^4reset^1.")
		client_cmd(id, "spk ^"buttons/bell1^"")
		return PLUGIN_HANDLED
	}
	else
	{
		client_print_color(id, print_team_default, "^1[^4RS^1] ^3You don't have minimum %i frags and %i deaths to ^4reset ^3the score^1.", MIN_FRAGS, MIN_DEATHS)
		client_cmd(id, "spk ^"buttons/button2^"")
	}
	
	return PLUGIN_CONTINUE
}
Last edited by ArminC on 01 Mar 2018, 17:26, edited 6 times in total.

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#2

Post by ArminC » 1 Year Ago

Bump?!

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#3

Post by ArminC » 1 Year Ago

Edited my request :oops:

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 626
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#4

Post by Mohamed Alaa » 1 Year Ago

Edit this message:
"^1[^4RS^1] ^3You don't have minimum %i frags and %i deaths to ^4reset ^3the score^1."
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest