[ Cerere Plugin ] /Harti

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
(c) WaRninG.
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 261
Joined: 13 Jul 2018, 14:44
Detinator Steam: Da
Detinator server CS: 《ZP.PLAYARENA.RO 》
SteamID: Andu
Reputatie: Utilizator neserios (tepar!)
Membru Club eXtreamCS (4 Ian - 4 Mai)
Nick anterior: Andrei # QualTech
-1 avertisment (2 luni club)
Fond eXtream: 0
Location: Câmpulung
Has thanked: 3 times
Contact:

20 Mar 2019, 10:26

Plugin Cerut: /harti
Descriere (adica ce face el mai exact): arata ultimele harti jucate
Serverul ruleaza (HLDS/ReHLDS): ReHLDS
Versiune AMX Mod X: 1.8.2
Modul Serverului: PUBG MOD & Zombie plague.

Vreau sa arate asa va rog :

!n[!gNUME!n] Hartile jucate anterior sunt: !gextreamcs
RoyalServer 2
User avatar
DanN
Membru, skill 0
Membru, skill 0
Posts: 70
Joined: 30 Sep 2017, 22:12
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: RobertshemA
SteamID: 84638588213
Fond eXtream: 0
Location: Cape Verde
Has thanked: 1 time
Contact:

20 Mar 2019, 22:22

| Afiseaza codul

#include <amxmodx>
#include <amxmisc>

// number of last maps to save
#define LAST_MAPS_SAVE 5

new gSaveFile[64];
new gLastMapName[LAST_MAPS_SAVE][32];
new gLastMapTime[LAST_MAPS_SAVE];
new gNumLastMaps;

public plugin_init() {
	register_plugin("Last Maps Time", "0.0.1", "Exolent");
	
	register_clcmd("say /harti", "CmdLastMaps");
	
	get_datadir(gSaveFile, charsmax(gSaveFile));
	add(gSaveFile, charsmax(gSaveFile), "/harti.txt");
	
	new f = fopen(gSaveFile, "rt");
	
	if(f) {
		new line[64], minutes[12];
		
		while(!feof(f) && gNumLastMaps < LAST_MAPS_SAVE) {
			fgets(f, line, charsmax(line));
			trim(line);
			
			if(line[0]) {
				parse(line, gLastMapName[gNumLastMaps], charsmax(gLastMapName[]), minutes, charsmax(minutes));
				gLastMapTime[gNumLastMaps++] = str_to_num(minutes);
			}
		}
		
		fclose(f);
	}
}

public plugin_end() {
	new minutes = floatround(get_gametime() / 60.0, floatround_ceil);
	
	new map[32];
	get_mapname(map, charsmax(map));
	
	new f = fopen(gSaveFile, "wt");
	
	fprintf(f, "^"%s^" %d", map, minutes);
	
	if(gNumLastMaps == LAST_MAPS_SAVE) {
		gNumLastMaps--;
	}
	
	for(new i = 0; i < gNumLastMaps; i++) {
		fprintf(f, "^n^"%s^" %d", gLastMapName, gLastMapTime);
	}
	
	fclose(f);
}

public CmdLastMaps(id) {
	if(gNumLastMaps) {
		new maps[192], len;
		for(new i = 0; i < gNumLastMaps; i++) {
			len += formatex(maps[len], charsmax(maps) - len, "%s%s (%dmin)", len ? ", " : "", gLastMapName, gLastMapTime);
		}
		
		client_print(id, print_chat, "%s Hartile jucate anterior sunt: %s", get_name(id), maps);
	} else {
		client_print(id, print_chat, "");
	}
}

stock get_name ( id ) {
	
	new name [ 32 ] ;
	get_user_name ( id, name, 31 );
	
	return name;
}


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/


Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests