Played Time[nu mai ofer suport pentru acest plugin]

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori

asdbena
Membru, skill 0
Membru, skill 0
Posts: 2
Joined: 12 Nov 2011, 14:15
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

29 Jan 2013, 21:18

ask am o rugaminte stiu ca e tarziu postul dar te rog poti sa imi scori topul din plugin :X
User avatar
Alessa_ldz
Membru, skill 0
Membru, skill 0
Posts: 4
Joined: 14 Mar 2013, 09:50
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

19 Mar 2013, 23:51

al meu l-am facut asa , am scos cateva din el +caci iti poti pune flagul dorit care vrei sa dai amx_removetop

Code: Select all

/*
*/
#include <amxmodx>
#include <amxmisc>

#include <nvault>
#include <fakemeta>

#include <ColorChat>

#pragma semicolon 1

#define INFO_ZERO 0
#define NTOP 10
#define TIME 60.0

static const PLUGIN_NAME[] 	= "Played Time";
static const PLUGIN_AUTHOR[] 	= "sPuf ?";
static const PLUGIN_VERSION[]	= "0.5.5";

new tophours[33],topminutes[33];
new topnames[33][33],topauth[33][33];

new Data[64],g_vault;
new gHours[33],gMinutes[33];

new cvar_tag,TAG[64];

public plugin_init() {
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
	register_clcmd( "say", "hook_say" );

	register_concmd("amx_removetop", "remove_info");
	register_concmd("amx_ore", "show_info");
	register_concmd("amx_topore", "show_top");
	
	cvar_tag = register_cvar("pentru_prefix","[LDZ]");
	
	register_forward(FM_ClientUserInfoChanged, "fwClientUserInfoChanged");
	g_vault = nvault_open("played_time");
	
	if(g_vault == INVALID_HANDLE){
		set_fail_state("nValut returned invalid handle");
	}
	get_datadir(Data, 63);
	read_top();
	
}

public client_putinserver(id) {
	if(!is_user_bot(id)) {
		LoadTime(id);
		set_task(TIME,"RefreshTime",id,_,_,"b",0);
		set_task(0.1,"CheckName",id);
	}
}
public client_disconnect(id) {
	if(!is_user_bot(id)) {
		SaveTime(id);
		remove_task(id);
	}
}
public plugin_end() {
	nvault_close( g_vault );
}
public hook_say(id) {
	
	static args[192], command[192];
	read_args(args,charsmax(args));
	
	if(!args[0]) {
		return PLUGIN_CONTINUE;
	}	
	remove_quotes(args[0]);
	if( equal(args, "/ore", strlen("/ore") )) {
		replace(args,charsmax(args), "/", "" );
		formatex( command, charsmax(command) , "amx_%s", args );
		client_cmd(id, command);
		return PLUGIN_HANDLED;
	}
	if( equal(args, "/topore", strlen("/topore") )) {
		replace(args,charsmax(args), "/", "" );
		formatex( command, charsmax(command) , "amx_%s", args );
		client_cmd(id, command);
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}
public RefreshTime(id) {
	gMinutes[id] += 1;
	
	if(gMinutes[id] >= 60) {
		gHours[id] += 1;
		gMinutes[id] -= 60;
	}
	checkandupdatetop(id,gHours[id],gMinutes[id]);
	return PLUGIN_HANDLED;
}
public CheckName(id) {
	static name[32];
	get_user_name(id, name, 31);
	get_pcvar_string(cvar_tag, TAG, 63);
	
	new iLen;
	while(!equali(name[iLen], "^0")) {
		iLen++;
	}
	if(iLen < 3) {
		new userid;
		userid = get_user_userid(id);
		ColorChat(0, RED, "^x04%s^x01 Jucatorul^x03 %s^x01 a primit kick datorita nick-ului prea scurt !", TAG, name);
		server_cmd("kick #%d ^"Nick prea scurt, minim 3 litere^"", userid);
		client_print(id,print_console,"Nick prea scurt, minim 3 litere");
		
	} else if(iLen > 30) {
		new userid;
		userid = get_user_userid(id);
		ColorChat(0, RED, "^x04%s^x01 Jucatorul^x03 %s^x01 a primit kick datorita nick-ului prea lung !", TAG, name);
		server_cmd("kick #%d ^"Nick prea lung, maxim 30 litere^"", userid);
		client_print(id,print_console,"Nick prea lung, maxim 30 litere");
	}
	return PLUGIN_HANDLED;
}
public fwClientUserInfoChanged(id, buffer) {
	if (!is_user_connected(id)) {
		return FMRES_IGNORED;
	}
	static val[32];
	static name[32];
	get_user_name(id, name, 31);
	engfunc(EngFunc_InfoKeyValue, buffer, "name", val, sizeof val- 1);
	if (equal(val, name)) {
		return FMRES_IGNORED;
	}
	engfunc(EngFunc_SetClientKeyValue, id, buffer, "name", name);
	get_pcvar_string(cvar_tag, TAG, 63);
	ColorChat(id, RED, "^x04%s^x03 NU este permisa schimbarea nick-ului pe server !", TAG);
	console_print(id,"NU este permisa schimbarea nick-ului pe server !");
	return FMRES_SUPERCEDE;
}
public show_info(id)  {
	get_pcvar_string(cvar_tag, TAG, 63);
	
	new target[32];
    	read_argv(1, target, 31);

	if(equali(target,"")) {
		new ptime,Steamid[35];
		get_user_authid(id, Steamid, 34);
		ptime = get_user_time(id, 1) / 60;
		ColorChat(id, BLUE, "^x04%s^x01 Statisticile tale:", TAG);
		ColorChat(id, BLUE, "^x04%s^x01 Ai jucat pana acum^x03 %d^x01 or%s si^x03 %d^x01 minut%s", TAG,gHours[id],gHours[id] == 1 ? "a" : "e",gMinutes[id],gMinutes[id] == 1 ? "" : "e");
		ColorChat(id, BLUE, "^x04%s^x01 Te-ai conectat pe server de^x03 %d^x01 minut%s", TAG, ptime, ptime == 1 ? "" : "e");
		ColorChat(id, RED, "^x04%s^x01 SteamID tau este:^x03 %s", TAG, Steamid);
		return PLUGIN_HANDLED;
	}

    	new player = cmd_target(id, target, 8);
    	if(!player || player == id) {
		return PLUGIN_HANDLED;
	}
	else {

		new name[32];
		get_user_name(player, name, 31);
	
		new ptime,Steamid[35];
		get_user_authid(player, Steamid, 34);
		ptime = get_user_time(player, 1) / 60;
	
		ColorChat(id, BLUE, "^x04%s^x01 Statisticile lui^x03 %s^x01:", TAG, name);
		ColorChat(id, BLUE, "^x04%s^x01 A jucat pana acum^x03 %d^x01 or%s si^x03 %d^x01 minut%s", TAG, gHours[player],gHours[player] == 1 ? "a" : "e",gMinutes[player],gMinutes[player] == 1 ? "" : "e");
		ColorChat(id, BLUE, "^x04%s^x01 S-a conectat pe server de^x03 %d^x01 minut%s", TAG, ptime, ptime == 1 ? "" : "e");
		ColorChat(id, RED, "^x04%s^x01 SteamID lui^x03 %s^x01 :^x03 %s", TAG,name, Steamid);
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}
public remove_info(id)  {
	if( !(get_user_flags(id) == read_flags("abcdefghijklmnopqrstu"))) {
       		return PLUGIN_HANDLED;
	}
	get_pcvar_string(cvar_tag, TAG, 63);
	new target[32];
    	read_argv(1, target, 31);
	new poz = str_to_num(target);
	if( !poz|| poz > 10 || poz < 1) {
		console_print(id,"%s Foloseste amx_removetop <pozitie>, de la 1 la 10 !",TAG);
       		return PLUGIN_HANDLED;
	}
	new aname[32],Steamid[35];
	get_user_name(id, aname, 31);
	get_user_authid(id, Steamid, 34);
	
	if(equal(topnames[poz-1],"")) {
		console_print(id,"%s Nu se afla nimeni pe aceasta pozitie !",TAG);
		ColorChat(id, RED,"^x04%s^x01 Nu se afla nimeni pe aceasta pozitie !", TAG);
		return PLUGIN_HANDLED;
	}
	ColorChat(0, BLUE,"^x04%s^x01 Adminul^x03 %s^x01 il sterge din top ore pe^x03 %s^x01 !", TAG, aname,topnames[poz-1]);
	static i;
	
	for (i= poz-1;i<NTOP;i++) {
		formatex(topauth[i], 31, topauth[i+1]);
		formatex(topnames[i], 31, topnames[i+1]);	
		tophours[i] = tophours[i+1];
		topminutes[i] = topminutes[i+1];
		
		save_top();
	}
	
	return PLUGIN_HANDLED;
}
public SaveTime(id) {
 	new Name[32];
	get_user_name(id, Name, 32);

 	new vaultkey[64],vaultdata[256];
 	format(vaultkey,63,"%s",Name);
 	format(vaultdata,255," ^"%i^" ^"%i^"",gHours[id],gMinutes[id]);
 	nvault_set(g_vault,vaultkey,vaultdata);
	
 	return PLUGIN_HANDLED;
}
public LoadTime(id) {
 	new Name[32];
	get_user_name(id, Name, 32);

 	new vaultkey[64],vaultdata[256];
 	format(vaultkey,63,"%s",Name);
 	format(vaultdata,255," ^"%i^" ^"%i^"",gHours[id],gMinutes[id]);
 	nvault_get(g_vault, vaultkey, vaultdata, 255);

 	new phours[32], pmins[32] ;

 	parse(vaultdata, phours, sizeof(phours) - 1, pmins, sizeof(pmins) - 1);

 	gHours[id] = str_to_num(phours);
 	gMinutes[id] = str_to_num(pmins);

 	return PLUGIN_HANDLED;
}
public save_top() {
	new path[128];
	formatex(path, 127, "%s/TopOre.dat", Data);
	if( file_exists(path) ) {
		delete_file(path);
	}
	new Buffer[256];
	new f = fopen(path, "at");
	for(new i = INFO_ZERO; i < NTOP; i++)
	{
		formatex(Buffer, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^"^n",topnames[i],topauth[i], tophours[i],topminutes[i] );
		fputs(f, Buffer);
	}
	fclose(f);
}
public checkandupdatetop(id, hours, minutes) {	

	new authid[35],name[32];
	get_user_name(id, name, 31);
	get_user_authid(id, authid ,34);
	for (new i = INFO_ZERO; i < NTOP; i++)
	{
		if( hours > tophours[i] || hours == tophours[i] && minutes > topminutes[i])
		{
			new pos = i;	
			while( !equal(topnames[pos],name) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(topauth[j], 31, topauth[j-1]);
				formatex(topnames[j], 31, topnames[j-1]);
				tophours[j] = tophours[j-1];
				topminutes[j] = topminutes[j-1];
				
			}
			formatex(topauth[i], 31, authid);
			formatex(topnames[i], 31, name);
			
			tophours[i]= hours;
			topminutes[i] = minutes;
			//ColorChat(0, BLUE,"^x04%s^x03 %s^x01 este pe locul^x04 %i^x01 in top ore cu^x03 %d^x01 or%s^x03 %d^x01 minut%s. ", TAG, name,(i+1),hours,hours == 1 ? "a" : "e",minutes,minutes == 1 ? "" : "e");
			save_top();
			break;
		}
		else if( equal(topnames[i], name)) 
		break;	
	}
}
public read_top() {
	new Buffer[256],path[128];
	formatex(path, 127, "%s/TopOre.dat", Data);
	
	new f = fopen(path, "rt" );
	new i = INFO_ZERO;
	while( !feof(f) && i < NTOP+1)
	{
		fgets(f, Buffer, 255);
		new hours[25], minutes[25];
		parse(Buffer, topnames[i], 31, topauth[i], 31,  hours, 25, minutes, 25);
		tophours[i]= str_to_num(hours);
		topminutes[i]= str_to_num(minutes);
		
		i++;
	}
	fclose(f);
}
public show_top(id) {	
	static buffer[2368], name[131], len, i;
	len = format(buffer[len], 2367-len,"<STYLE>body{background:#232323;color:#cfcbc2;font-family:sans-serif}table{border-style:solid;border-width:1px;border-color:#FFFFFF;font-size:13px}</STYLE><table align=center width=100%% cellpadding=2 cellspacing=0");
	len += format(buffer[len], 2367-len, "<tr align=center bgcolor=#52697B><th width=4%% > # <th width=24%%> Nume Jucator <th width=24%%>SteamID <th width=24%%> Ore Jucate <th  width=24%%> Minute Jucate");	
	for( i = INFO_ZERO; i < NTOP; i++ ) {		
			if( tophours[i] == 0 && topminutes[i] == 0) {
				len += format(buffer[len], 2367-len, "<tr align=center bgcolor=#232323><td> %d <td> %s <td> %s<td> %s <td> %s", (i+1), "-", "-", "-","-");
				//i = NTOP
			}
			else {
				name = topnames[i];
				while( containi(name, "<") != -1 )
					replace(name, 129, "<", "<");
				while( containi(name, ">") != -1 )
					replace(name, 129, ">", ">");
				new plname[32];
				get_user_name(id, plname ,32);
				if(equal(topnames[i],plname)) {
					len += format(buffer[len], 2367-len, "<tr align=center bgcolor=#2D2D2D><td> %d <td> %s <td> %s<td> %d <td> %d", (i+1), name,topauth[i], tophours[i],topminutes[i]);
				}
				else {
					len += format(buffer[len], 2367-len, "<tr align=center bgcolor=#232323><td> %d <td> %s <td> %s<td> %d <td> %d", (i+1), name,topauth[i], tophours[i],topminutes[i]);
				}
			}
		}
	len += format(buffer[len], 2367-len, "</table>");
	len += formatex(buffer[len], 2367-len, "<tr align=bottom font-size:11px><Center><br><br><br><br>Primii 10 Jucatori Cu Cele Mai Multe Ore Jucate pe CS.LDZ.RO</body>");
	static strin[20];
	format(strin,33, "Top 10 ore jucate pe CS.LDZ.RO");
	show_motd(id, buffer, strin);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
bine in loc de ldz sau la top 10 ore jucate pe va puneti tagurile voastre numele sv vostru, este editat la nume mai scurt si numele mai lung ..
server_cmd("kick #%d ^"Nick prea lung, maxim 30 litere^"", userid);
client_print(id,print_console,"Nick prea lung, maxim 30 litere");
}

eu mi-am pus maxim 30 ,astfel pierdeam multi playeri

server_cmd("kick #%d ^"Nick prea scurt, minim 3 litere^"", userid);
client_print(id,print_console,"Nick prea scurt, minim 3 litere");
cum este si regula ..e putin editat dar merge ,pacat ca nu iti poti schimba numele poate poate pe viitor se gaseste solutia
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2088
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1139 times
Contact:

20 Mar 2013, 21:00

am gasit rezolvare la faza cu numele.. adica o stiam de pe atunci doar ca nu eram sigur pe ea.. cat despre noua versiune.. am inceput cate ceva la ea.. dar acum cu munca.. cam putin timp :-s
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
mast3rwap
Membru, skill +1
Membru, skill +1
Posts: 333
Joined: 11 Feb 2012, 21:32
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: da
SteamID: berlo1990
Location: italia
Has thanked: 30 times
Been thanked: 5 times
Contact:

21 Mar 2013, 22:37

Askhanar wrote:am gasit rezolvare la faza cu numele.. adica o stiam de pe atunci doar ca nu eram sigur pe ea.. cat despre noua versiune.. am inceput cate ceva la ea.. dar acum cu munca.. cam putin timp :-s
Asteptam noua versiune :)
User avatar
SimeriaIonut
Fost moderator
Fost moderator
Posts: 480
Joined: 17 Apr 2010, 14:28
Detinator Steam: Da
Detinator server CS: XMAS.INDUNGI.RO
SteamID: _lvl4nticore_
Reputatie: Fost moderator ajutator
Location: Copenhagen, Denmark
Has thanked: 17 times
Been thanked: 25 times
Contact:

20 Jul 2013, 09:10

Inca asteptam noua versiune.
XMAS.INDUNGI.RO #Christmas Mod 2019 [Winter Mod] [Gifts] [XP Mod]
User avatar
Cristian
Fost moderator
Fost moderator
Posts: 3248
Joined: 12 Sep 2010, 12:19
Detinator Steam: Da
CS Status: None!
Detinator server CS: Nu
SteamID: -
Reputatie: Fost Moderator
Nume anterior : S!l@ba, jackanape, vengeance
Fost Membru Club eXtreamCS (doua luni)
Location: Craiova
Has thanked: 32 times
Been thanked: 149 times
Contact:

12 Oct 2013, 12:35

S-a terminat noua versiune :D ?
Last edited by Ulquiorra on 12 Oct 2013, 21:22, edited 2 times in total.
Reason: OnlyHD: Ai verificat data ultimului post? | Askhanar: am sa ma gandesc daca o sa o fac publica..
“You only live once, but if you do it right, once is enough.”
― Mae West
x3MeNToX
Membru, skill 0
Membru, skill 0
Posts: 7
Joined: 05 Dec 2013, 14:37
Detinator Steam: Nu
CS Status: OwNeR - Server
Detinator server CS: iFree.xTremeZone.Ro
Contact:

12 Dec 2013, 23:02

Foarte bun plugin-ul! Il recomand!
TeKtoniKkk
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 05 Jul 2014, 22:41
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

21 Jul 2014, 09:38

Daca ati putea va rog frumos sa postati sursa,v-ai fi recunoscator...
Al 2-lea link merge dar da eroare...
User avatar
Edy20
Membru, skill 0
Membru, skill 0
Posts: 71
Joined: 03 Nov 2014, 19:34
Detinator Steam: Da
SteamID: Fr3sH
Fond eXtream: 0
Contact:

14 Nov 2014, 10:22

foarte bun !! Respect
User avatar
CRAZE
Membru, skill +2
Membru, skill +2
Posts: 640
Joined: 04 Dec 2014, 18:39
Detinator Steam: Da
Reputatie: Fost Membru Club eXtreamCS (noua luni)
Unban achitat
Fond eXtream: 0
Location: California
Contact:

08 Dec 2014, 17:17

Minunat, THX
“Nobody dies a virgin. Life fucks us all.”
— Kurt Cobain
Zppp.Mihai94
Membru, skill 0
Membru, skill 0
Posts: 85
Joined: 26 Mar 2018, 16:51
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

02 Jan 2019, 12:38

salut poti modifica acest plugin de top ore jucate sa inregistreze doar orele adminilor de pe server? sa nu mai inregistreze si orele de la jucatori doar de la admini atat.
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 348 times
Contact:

02 Jan 2019, 13:51

Zppp.Mihai94 wrote:salut poti modifica acest plugin de top ore jucate sa inregistreze doar orele adminilor de pe server? sa nu mai inregistreze si orele de la jucatori doar de la admini atat.
fă cerere aici - click
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests