Plugin ! ! !

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
krystann
Membru eXtream
Membru eXtream
Posts: 2552
Joined: 16 May 2009, 10:37
Detinator Steam: Nu
CS Status: Vine criza!
Reputatie: Fost moderator
Has thanked: 321 times
Been thanked: 141 times

29 Jul 2012, 11:52

Pentru pluginul splayed time .. nu cred ca exista la ora actuala ceva mai bun .. mai exista un plugin asemanator dar are un bug foarte mare !
User avatar
Andrei.B
Fost administrator
Fost administrator
Posts: 6481
Joined: 17 Aug 2009, 08:15
Detinator Steam: Da
CS Status: Plecat pe mari si tari
Detinator server CS: Nu detin !
SteamID: andreybci94
Reputatie: Fost Membru Club eXtreamCS (o luna)
Fost Administrator
Nume anterior : bLack, Andrei,krusc
Contribuitor
Location: ConstanTa
Has thanked: 275 times
Been thanked: 556 times
Contact:

29 Jul 2012, 12:50

Doar acest plugin l-am gasit click

Mereu in suflet culorile ( Roş -Albastru )
Image
ImageImage
User avatar
K1d0x
Fost moderator
Fost moderator
Posts: 800
Joined: 26 Feb 2012, 15:57
Detinator Steam: Da
CS Status: We Build Together ;3 RedFear
Detinator server CS: PuB.RedFear.Ro
SteamID: k1dox
Reputatie: Fost moderator ajutator
Location: Reșița
Been thanked: 152 times
Contact:

29 Jul 2012, 14:07

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#pragma semicolon 1

/* Globals */
new gSteamSlot;
new gPlayedMinutes;
new gAdminsFile;

/* Arrays */
new szAdminsFile[16];
new TotalPlayedTime[33];
new szFile[256];

public plugin_init() {
	register_plugin("Steam Slot at x Hours", "1.0", "K!D()X");
	
	register_clcmd("say /slot", "iGive_Slot");
	register_clcmd("say /time", "ShowTime");

	gSteamSlot = register_cvar("steam_slot_on", "1");
	gPlayedMinutes = register_cvar("steam_slot_min", "1");
	gAdminsFile = register_cvar("steam_slot_file", "accese.ini");

	get_configsdir(szFile, 255);
	get_pcvar_string(gAdminsFile, szAdminsFile, 15);
	format(szFile, 255, "%s/%s", szFile, szAdminsFile);
}

public plugin_cfg() {
	if(!file_exists(szFile)) {
		server_print("[Steam Slot] Fisierul %s nu a fost gasit, plugin-ul a fost oprit", szFile);
		set_pcvar_num(gSteamSlot, 0);
	}
}

public iGive_Slot(id) {
	if(get_pcvar_num(gSteamSlot) == 0) {
		client_print(id, print_chat, "[Steam Slot] Plugin-ul este dezactivat");
		return PLUGIN_HANDLED;
	}

	static ctime[64], timep, szSteamID[32], szName[32];
	timep = get_user_time(id, 1) / 60;
	get_time("%H:%M:%S", ctime, 63);
	get_user_authid(id, szSteamID, 31);
	get_user_name(id, szName, 31);

	
	if((containi(szSteamID, "STEAM_0:") != - 1)) {
		if(timep+TotalPlayedTime[id] >= get_pcvar_num(gPlayedMinutes)) {
			new szParName[33], szPareName[33], txtlen, line = 0;
			
			new szLogData[200], szReadData[200];
			while(read_file(szFile, line++, szReadData, 199, txtlen)) {
				parse(szReadData, szPareName, 32, szParName, 32);
				
				if(equal(szSteamID, szPareName)) {
					client_print(id, print_chat, "[Steam Slot] You already have a admin or slot on steamid -> %s!", szSteamID);
					return PLUGIN_HANDLED;
				}
			}
			
			format(szLogData, 199, "^"%s^" ^"^" ^"b^" ^"ce^" ; Slot %s", szSteamID, szName);
			write_file(szFile, szLogData);
			client_print(id, print_chat, "[Steam Slot] You received successfully a slot on steamid -> (%s)", szSteamID);
			server_cmd("amx_reloadadmins");
		} else {
			client_print(id, print_chat, "[Steam Slot] You can use this command only when you have %d minute(s) playerd on this server.", get_pcvar_num(gPlayedMinutes));
			client_print(id, print_chat, "[Steam Slot] You have %d min(s) played on this server !", timep+TotalPlayedTime[id]);
		}
	} else {
		client_print(id, print_chat, "[Steam Slot] You Don't have an steam, free slots is only for STEAM Players !!!");
		client_print(id, print_chat, "[Steam Slot] Your Authentification ID is -> %s", szSteamID);
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_HANDLED;
}

public ShowTime(id) {
	new timep;
	timep = get_user_time(id, 1) / 60;
	client_print(id, print_chat, "[Played Time] You have played on this server %d min", timep+TotalPlayedTime[id]);
}

public client_disconnect(id) {
	TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
	SaveTime(id, TotalPlayedTime[id]);
}

public client_putinserver(id) {
	TotalPlayedTime[id] = LoadTime(id);
}

public LoadTime(id) {
	new valut = nvault_open("Time_played");
	new authid[33];
	new vaultkey[64], vaultdata[64];
	
	get_user_authid(id, authid, 32);
	
	format(vaultkey, 63, "TIMEPLAYED%s", authid);
	
	nvault_get(valut, vaultkey, vaultdata, 63);
	nvault_close(valut);
	
	return str_to_num(vaultdata);
}

public SaveTime(id,PlayedTime) {
	new valut = nvault_open("Time_played");
	
	if(valut == INVALID_HANDLE)
		set_fail_state("nValut returned invalid handle");
	
	new authid[33];
	new vaultkey[64], vaultdata[64];
	
	get_user_authid(id, authid, 32);
	
	format(vaultkey, 63, "TIMEPLAYED%s", authid); 
	format(vaultdata, 63, "%d", PlayedTime); 
	
	nvault_set(valut, vaultkey, vaultdata);
	nvault_close(valut);
}
Cvar-uri:
steam_slot_on - 1 plugin activat / 0 dezactivat
steam_slot_file - fisierul cu admine (ex: users.ini) (trebuie neaparat sa fie in folderul configs)
steam_slot_min - minutele necesare pentru a putea primii slot

Comenzi chat:
say /time (afiseaza timpul jucat pe server)
say /slot free steam slot

Good Luck !
Image
32slots.net - Sursa ta de încredere de KIT-uri CS 1.6
RedFear.Ro România - | Afiseaza codul
Vă aştept cu un Register pe Forum
- Suntem în căutare de Dezvoltatori & Administratori :
HTML
PHP
MYSQL
C++
Ofer Server CS spre administrare | Afiseaza codul
Condiții : 
- Să dispui de timp liber
- Să ai cunoștințe AMXX & HLDS
Boostul este asigurat de către Mine (PM pentru. detalii)
ik1d0x@redfear.ro
User avatar
K1d0x
Fost moderator
Fost moderator
Posts: 800
Joined: 26 Feb 2012, 15:57
Detinator Steam: Da
CS Status: We Build Together ;3 RedFear
Detinator server CS: PuB.RedFear.Ro
SteamID: k1dox
Reputatie: Fost moderator ajutator
Location: Reșița
Been thanked: 152 times
Contact:

29 Jul 2012, 19:48

brown wrote:ms mult !
Cu placere, o sa iti dau un PM dupa ce o sa public versiunea FULL :p
Image
32slots.net - Sursa ta de încredere de KIT-uri CS 1.6
RedFear.Ro România - | Afiseaza codul
Vă aştept cu un Register pe Forum
- Suntem în căutare de Dezvoltatori & Administratori :
HTML
PHP
MYSQL
C++
Ofer Server CS spre administrare | Afiseaza codul
Condiții : 
- Să dispui de timp liber
- Să ai cunoștințe AMXX & HLDS
Boostul este asigurat de către Mine (PM pentru. detalii)
ik1d0x@redfear.ro
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests