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

Plugin resetscore - cost 2000$


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tom .
Member
Join Date: May 2016
Old 02-23-2023 , 01:20   Plugin resetscore - cost 2000$
Reply With Quote #1

I need a resetscore plugin that costs money if the player wants to reset his score.

And add the specific messages, if he has enough money or not, and so on.
tom . is offline
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 02-23-2023 , 03:11   Re: Plugin resetscore - cost 2000$
Reply With Quote #2

Post your resetscore plugin source, and i will modify it for you
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
tom .
Member
Join Date: May 2016
Old 02-23-2023 , 04:33   Re: Plugin resetscore - cost 2000$
Reply With Quote #3

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#pragma semicolon 1
#define ADMIN_ACCESS ADMIN_IMMUNITY

enum Color { NORMAL = 1, GREEN, TEAM_COLOR, GREY, RED, BLUE};
new TeamName[][] = { "", "TERRORIST", "CT", "SPECTATOR" };
new cvar_chat, cvar_on, cvar_dead, cvar_tag, cvar_time, g_Tag;

public plugin_init() {
	register_plugin("Reset score", "3.2", "Ex3cuTioN");
	
	register_clcmd("say /resetscore", "cmdReset");
	register_clcmd("say /rs", "cmdReset");
	register_clcmd("say_team /resetscore", "cmdReset");
	register_clcmd("resetscore", "cmdReset");
	
	register_concmd("amx_resetscore", "conReset", ADMIN_ACCESS, "- reseteaza scorul tuturor");
	
	cvar_chat = register_cvar("amx_reset_chat", "1");
	cvar_on = register_cvar("amx_reset_plugin", "1");
	cvar_dead = register_cvar("amx_reset_dead","1");
	cvar_tag = register_cvar("amx_reset_tag","ResetScore");
	cvar_time = register_cvar("amx_reset_time","60");
	
	if(get_pcvar_num(cvar_chat) == 1) {
		new Float:timp = get_pcvar_float(cvar_time);
		set_task(timp, "chatmsgshow", _, _, _, "b", 0);
	}
	new tag[32];
	g_Tag = get_pcvar_string(cvar_tag, tag, 31);
}

public cmdReset(id) {
	if(get_pcvar_num(cvar_on) == 0) {
		ColorChat(id, GREEN,"[%s]^x01 Pluginul este dezactivat", g_Tag);
		return PLUGIN_HANDLED;
	}
	if(get_pcvar_num(cvar_dead) == 0 && !is_user_alive(id)) {
		ColorChat(id, GREEN, "[%s]^x01 Poti folosii comanda numai atunci cand esti viu.", g_Tag);
		return PLUGIN_HANDLED;
	}
	
	new frags = get_user_frags(id);
	new deaths = get_user_deaths(id);
	
	if(frags == 0 && deaths == 0)
		ColorChat(id, GREEN, "[%s]^x01 Scorul tau este deja^x04 0",g_Tag);
	else {
		for(new i = 0; i < 2; i++) {
			cs_set_user_deaths(id, 0);
			set_user_frags(id, 0);
		}
		
		new name[32];
		get_user_name(id, name, 31);
		
		ColorChat(id, GREEN, "[%s]^x01 Scorul tau s-a resetat.", g_Tag);
		ColorChat(0, GREEN,"[%s]^x01 si-a resetat scorul.", name);
	}
	return PLUGIN_HANDLED;
}

public conReset(id) {
	if(get_user_flags(id)&ADMIN_ACCESS) {
		new players[32], num, player;
		get_players(players, num, "c");
		
		for(new i = 0; i < num; i++) {
			player = players;
			if(get_user_frags(player) != 0 && get_user_deaths(player) != 0) {
				cs_set_user_deaths(player, 0);
				set_user_frags(player, 0);
			}
		}
		
		new name[32];
		get_user_name(id, name, 31);
		
		ColorChat(0, GREEN, "[%s]^x03 %s^x01 a resetat scorul tuturor.", g_Tag, name);
	}
	else
		console_print(id, "Nu ai acces la aceasta comanda.");
		
	return PLUGIN_HANDLED;
}

public chatmsgshow(id)
	ColorChat(id, GREEN, "[%s]^x01 Daca vrei sa iti resetezi scorul, foloseste comanda^x04 /resetscore^x01 sau^x04 /rs !", g_Tag);

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...) {
	if(!get_playersnum()) 
		return;
	
	new message[256];

	switch(type) {
		case NORMAL:
		{
			message[0] = 0x01;
		}
		case GREEN:
		{
			message[0] = 0x04;
		}
		default:
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';

	new team, ColorChange, index, MSG_Type;
	
	if(id) {
		MSG_Type = MSG_ONE;
		index = id;
	}
	else {
		index = FindPlayer();
		MSG_Type = MSG_ALL;
	}
	
	team = get_user_team(index);
	ColorChange = ColorSelection(index, MSG_Type, type);

	ShowColorMessage(index, MSG_Type, message);
		
	if(ColorChange)
		Team_Info(index, MSG_Type, TeamName[team]);
}

ShowColorMessage(id, type, message[]) {
	static bool:saytext_used;
	static get_user_msgid_saytext;
	
	if(!saytext_used) {
		get_user_msgid_saytext = get_user_msgid("SayText");
		saytext_used = true;
	}
	
	message_begin(type, get_user_msgid_saytext, _, id);
	write_byte(id);
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[]) {
	static bool:teaminfo_used;
	static get_user_msgid_teaminfo;
	
	if(!teaminfo_used) {
		get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
		teaminfo_used = true;
	}
	
	message_begin(type, get_user_msgid_teaminfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

ColorSelection(index, type, Color:Type) {
	switch(Type) {
		case RED:
		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:
		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:
		{
			return Team_Info(index, type, TeamName[0]);
		}
	}

	return 0;
}

FindPlayer() {
	new i = -1;

	while(i <= get_maxplayers()) {
		if(is_user_connected(++i))
			return i;
	}

	return -1;
}
tom . is offline
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 02-23-2023 , 09:16   Re: Plugin resetscore - cost 2000$
Reply With Quote #4

Doamne cei cu codu ala ? :-j / god wath is with that code
Modifica publicul / Modify public
public conReset(id) {

cu / with this
PHP Code:
public conResetid )
{
    if(
get_user_flags(id)&ADMIN_ACCESS)
    {
        new 
players[32], numplayer;
        
get_players(playersnum"c");
        
        for(new 
0numi++)
        {
            
player players;
            if(
get_user_frags(player) != && get_user_deaths(player) != 0)
            {
                new 
iCost 2000;    // Cat va costa executare functiei - 2000 dolari
                
new iMoney cs_get user_money player );
                if ( 
iMoney iCost>
            {
                
client_print idprint_chat"[%s] Nu ai destui bani %d needed."g_TagiCost);
                return 
1;
            }
            else
            {
                
cs_set_user_money playeriMoney iCost );
                
cs_set_user_deaths(player0);
                
set_user_frags(player0);
            }
        }
        
        new 
name[33];
        
get_user_name(idnamecharsmax (name));
        
        
ColorChat(0GREEN"[%s]^x03 %s^x01 a resetat scorul tuturor."g_Tagname);
    }
    else
        
console_print(id"Nu ai acces la aceasta comanda.");
        
    return 
1;

Aici pui cat vrei tu sa coste, e pus deja la 2000$ / here is how much will cost, it's already to 2000 dollars
Code:
new iCost = 2000;	// Cat va costa executare functiei - 2000 dolari
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers

Last edited by CryWolf; 02-23-2023 at 09:19.
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
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 13:14.


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