[ AMXX ] Auto-Lights (luminozitate in functie de ora)

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Edi
Membru, skill +3
Membru, skill +3
Posts: 1447
Joined: 16 Mar 2012, 17:30
Detinator Steam: Da
CS Status: Stii ce zic?
SteamID: Privat
Reputatie: Nume anterior: aimshot.
Has thanked: 58 times
Been thanked: 102 times
Contact:

29 Jan 2014, 14:56

Descriere: Pluginul seteaza automat lumina de pe server in functie de ora, acesta facand zi / noapte automat (lumina nu este setata brusc ci treptat mai multe ore)

Nume: Auto-Lights
Versiune: 0.1
Link oficial: -

Instalare:
1. Fisierul auto_lights.sma il puneti in addons/amxmodx/scripting
2. Fisierul auto_lights.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

auto_lights.amxx
4. Alti pasi necesari....

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • -
Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
  • -
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • -
SURSA (.SMA) | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <engine>


new const PLUGIN[] = "Auto-Lights"
new const VERSION[] = "0.1"
new const AUTHOR[] = "Edi"

new Float:g_CheckTime = 60.0  // Aici setam timpul in care pluginul verifica ora si schimba luminile (default 1 minut - 60s)
new h

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	set_task( g_CheckTime, "SetLights" )
}

public SetLights(){
	
	time( h, _, _ ) 	
	
	if ( h == 00 ){
	
			set_lights( "b" )
	
	}
	
	if ( h == 06 ){
		
			set_lights( "d" )
		
	}
	
	if ( h == 07 ){
		
			set_lights( "f" )
		
	}
	
	if ( h == 08 ){
		
			set_lights( "i" )
		
	}
	
	if ( h == 09 ){
		
			set_lights( "k" )
		
	}
	
	if ( h == 10 ){
		
			set_lights( "l" )
		
	}
	
	if ( h == 12 ){
		
			set_lights( "m" )
		
	}
	
	if ( h == 17 ){
		
			set_lights( "i" )
		
	}
	
	if ( h == 18 ){
		
			set_lights( "g" )
		
	}
	
	if ( h == 19 ){
		
			set_lights( "f" )
		
	}
	
	if ( h == 20 ){
		
			set_lights( "e" )
		
	}
	
	if ( h == 21 ){
		
			set_lights( "d" )
		
	}
	
	if ( h == 22 ){
		
			set_lights( "c" )
		
	}
}
Last edited by Alexeey on 21 Jul 2016, 22:44, edited 1 time in total.
Reason: Am scos link de download deoarece nu era valid.Avem SMA!
Cine vine beat beat
Cine vine rupt
Cine bea, Cine trage, Cine sare la f**ut
RoyalServer
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

29 Jan 2014, 15:02

Felicitari , mai bine il faceai sa mearga pe anumite harti.
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
User avatar
Edi
Membru, skill +3
Membru, skill +3
Posts: 1447
Joined: 16 Mar 2012, 17:30
Detinator Steam: Da
CS Status: Stii ce zic?
SteamID: Privat
Reputatie: Nume anterior: aimshot.
Has thanked: 58 times
Been thanked: 102 times
Contact:

29 Jan 2014, 15:04

Fantasy1 wrote:Felicitari , mai bine il faceai sa mearga pe anumite harti.
Merci :) e prima versiune, o sa vin cu anumite update-uri.
Cine vine beat beat
Cine vine rupt
Cine bea, Cine trage, Cine sare la f**ut
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

29 Jan 2014, 15:17

Simplu si original! :)>-
Bravo!
M.am uitat prin sursa si am observat ca librariile astea sunt incluse degeaba!

Code: Select all

#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

29 Jan 2014, 15:21

Foarte frumoasa ideea,in functie de ora se intuneca/lumineaza,gj :)
Chiar excelent.
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

29 Jan 2014, 15:26

Foloseste ceva mai compresat..
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>


new const PLUGIN[] = "Auto-Lights"
new const VERSION[] = "0.1"
new const AUTHOR[] = "Edi"

new Float:g_CheckTime = 60.0  // Aici setam timpul in care pluginul verifica ora si schimba luminile (default 1 minut - 60s)
new h

new const hours[ ][ ] =
{
	"00",
	"06",
	"07",
	"08",
	"09",
	"10",
	"12",
	"17",
	"18",
	"19",
	"20",
	"21",
	"22"
};

new const lights[ ][ ] =
{
	"b",
	"d",
	"f",
	"i",
	"k",
	"l",
	"m",
	"i",
	"g",
	"f",
	"e",
	"d",
	"c"
};

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	set_task( g_CheckTime, "SetLights" )
}

public SetLights(){
	
	time( h, _, _ ) 	
	
	for( new i = 0; i < sizeof( hours ); i++ )
	{
		if( h == str_to_num( hours[ i ] ) )
		{
			set_lights( lights[ i ] );
			
			break;
		}
	}
}
Retras
User avatar
Edi
Membru, skill +3
Membru, skill +3
Posts: 1447
Joined: 16 Mar 2012, 17:30
Detinator Steam: Da
CS Status: Stii ce zic?
SteamID: Privat
Reputatie: Nume anterior: aimshot.
Has thanked: 58 times
Been thanked: 102 times
Contact:

29 Jan 2014, 15:38

YONTU wrote:Simplu si original! :)>-
Bravo!
M.am uitat prin sursa si am observat ca librariile astea sunt incluse degeaba!

Code: Select all

#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>
Nu deranjeaza cu nimic, sunt librarii 'default' care le gasesti in orice compiler, sunt acolo pentru ca apas pe un buton si am toate includele pe care le folosesc, mi-e mai usor decat sa le scriu eu.

cryuff merci, dar inca nu am inceput sa lucrez asa si decat sa le dau un cod gresit sau buguit, mai bine le dau asa.

Apropo, asta e ok?Adica e prima incercare si nu stiu daca e bun sau nu, sa-l pun in topic?
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <engine>


new const PLUGIN[] = "Auto-Lights"
new const VERSION[] = "0.1"
new const AUTHOR[] = "Edi"

new const g_LightsMap[][] = 
{
	
		"de_dust2",
		"de_inferno",
		"de_nuke",
		"de_dust2x2",
		"de_nuke_rarea",
		"de_train",
		"de_train32",
		"awp_bycastor",
		"awp_garden",
		"awp_india",
		"awp_zigzag",
		"fy_snow",
		"de_kabul",
		"de_kabul32",
		"de_tuscan",
		"de_tuscan32"
		
}

new Float:g_CheckTime = 60.0  // Aici setam timpul in care pluginul verifica ora si schimba luminile (default 1 minut - 60s)
new h

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	set_task( g_CheckTime, "SetLights" )
}

public SetLights(){
	
	new MapName[ 64 ]
	get_mapname( MapName, 63 )
	
	time( h, _, _ ) 	
	
	for (new i = 0; i < sizeof(g_LightsMap); i++)
	{
		if(equali( MapName, g_LightsMap ) ) {
	
	
	if ( h == 00 ){
	
			set_lights( "b" )
	
	}
	
	if ( h == 06 ){
		
			set_lights( "d" )
		
	}
	
	if ( h == 07 ){
		
			set_lights( "f" )
		
	}
	
	if ( h == 08 ){
		
			set_lights( "i" )
		
	}
	
	if ( h == 09 ){
		
			set_lights( "k" )
		
	}
	
	if ( h == 10 ){
		
			set_lights( "l" )
		
	}
	
	if ( h == 12 ){
		
			set_lights( "m" )
		
	}
	
	if ( h == 17 ){
		
			set_lights( "i" )
		
	}
	
	if ( h == 18 ){
		
			set_lights( "g" )
		
	}
	
	if ( h == 19 ){
		
			set_lights( "f" )
		
	}
	
	if ( h == 20 ){
		
			set_lights( "e" )
		
	}
	
	if ( h == 21 ){
		
			set_lights( "d" )
		
	}
	
	if ( h == 22 ){
		
			set_lights( "c" )
		
	}
	
	}
	
		else return;
}
}
Last edited by munir on 29 Jan 2014, 15:40, edited 1 time in total.
Reason: Mai aranjeaza putin codul si e ok.
Cine vine beat beat
Cine vine rupt
Cine bea, Cine trage, Cine sare la f**ut
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests