Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Przeróbka


  • Zamknięty Temat jest zamknięty
9 odpowiedzi w tym temacie

#1 AdiX

    Nowy

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:4
Offline

Napisano 01.07.2008 14:02

Przerobi mi ktoś plugin o nazwie "lastround" aby podczas ostaniej rundy leciała nutka , nazwa piosenki remix , ścieżka misc/mxt.
Wyglądać to będzie tak misc/mxt/remix podaję kod .sma :

/*
 *
 * bAnTAi - Last Round
 * (c) 2004-2005
 *
 */
	  
#include <amxmodx>

#pragma semicolon                1      // force ; usage, just 'cause
    
new g_scTitle[]   = "Last Round";
new g_scVersion[] = "1.0";
new g_scAuthor[]  = "bAnTAi";
    
new bool:g_lastround = false;
new bool:g_changemap = false;
new Float:g_timelimit = 0.0;
new Float:g_maxspeed;

#define INITIATE_LAST_ROUND_TASK 545454
#define CHANGE_MAP_TASK 545455
#define DISABLE_PLAYERS_TASK 545456

public evRoundStart() {
	if (!get_cvar_num("lastround")) return PLUGIN_CONTINUE;

	// Wanted this in init but never got a value 
	if (g_timelimit == 0.0)
		g_timelimit = get_cvar_float("mp_timelimit");

	if (g_lastround) {
		new Float:roundtime = get_cvar_float("mp_roundtime");
		new Float:c4timer = get_cvar_float("mp_c4timer")/60;
	        // Extend the maps time one round + c4timer + some buffer
	        set_cvar_float("mp_timelimit", g_timelimit + roundtime + c4timer + 0.5);
					
		new text[256];
		format(text, 255, ".Ostatnia runda!");
		doTypesay(text, 5, 210, 0, 0);

		g_changemap = true;
		g_lastround = false;
	} else if (g_changemap) {
		new nextmap[32];
	        get_cvar_string("amx_nextmap", nextmap, 31);
	
		new text[256];
		format(text, 255, "Thank you for playing. Now switching to %s!", nextmap);
		doTypesay(text, 5, 210, 0, 0);

		g_maxspeed = get_cvar_float("sv_maxspeed");
		set_cvar_float("sv_maxspeed", 0.0);

                set_task(0.1, "disablePlayers", DISABLE_PLAYERS_TASK, "", 0, "a", 3);
                set_task(6.0, "changeMap", CHANGE_MAP_TASK);
	}

        return PLUGIN_CONTINUE;
}

public initiateLastRound() {
	if (!get_cvar_num("lastround")) return PLUGIN_CONTINUE;

	remove_task(INITIATE_LAST_ROUND_TASK);

	new text[256];
	format(text, 255, "Zaraz bedzie ostatnia runda!");
        doTypesay(text, 5, 210, 0, 0);

        new Float:roundtime = get_cvar_float("mp_roundtime");
	new Float:c4timer = get_cvar_float("mp_c4timer")/60;

	// (2* roundtime since it is possible that the even occurs at the beginning of a round)
	set_cvar_float("mp_timelimit", g_timelimit + (2.0*roundtime) + (2.0*c4timer));

	g_lastround = true;

	return PLUGIN_CONTINUE;
}

public disablePlayers() {
        new players[32], num;
        get_players(players, num, "c");
        for(new i=0;i<num; i++) {
		client_cmd(players[i],"drop");
	}
}

public changeMap() {
	remove_task(CHANGE_MAP_TASK);

        new nextmap[32];
        get_cvar_string("amx_nextmap", nextmap, 31);
        server_cmd("changelevel %s", nextmap);
}

doTypesay(string[], duration, r, g, <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> {
        set_hudmessage(r, g, b, 0.05, 0.45, 0, 6.0, float(duration) , 0.5, 0.15, 4);
        show_hudmessage(0, string);
}
					
public plugin_init() {
        register_plugin(g_scTitle, g_scVersion, g_scAuthor);

        register_cvar("lastround", "1");
	register_logevent("evRoundStart", 2, "0=World triggered", "1=Round_Start");

	// Chose 90 seconds not to clash with other events
	set_task(90.0, "initiateLastRound", INITIATE_LAST_ROUND_TASK, "", 0, "d");

	return PLUGIN_CONTINUE;
}

public plugin_end() {
	set_cvar_float("mp_timelimit", g_timelimit);
	set_cvar_float("sv_maxspeed", g_maxspeed);

	remove_task(DISABLE_PLAYERS_TASK);

	return PLUGIN_CONTINUE;
}

  • +
  • -
  • 0

#2 Salamon

    Profesjonalista

  • Użytkownik

Reputacja: 43
Pomocny

  • Postów:199
Offline

Napisano 01.07.2008 14:31

/*

 *

 * bAnTAi - Last Round

 * (c) 2004-2005

 *

 */

     

#include <amxmodx>



#pragma semicolon                1      // force ; usage, just 'cause

   

new g_scTitle[]   = "Last Round";

new g_scVersion[] = "1.0";

new g_scAuthor[]  = "bAnTAi";

   

new bool:g_lastround = false;

new bool:g_changemap = false;

new Float:g_timelimit = 0.0;

new Float:g_maxspeed;



#define INITIATE_LAST_ROUND_TASK 545454

#define CHANGE_MAP_TASK 545455

#define DISABLE_PLAYERS_TASK 545456



public evRoundStart() {

    if (!get_cvar_num("lastround")) return PLUGIN_CONTINUE;



    // Wanted this in init but never got a value

    if (g_timelimit == 0.0)

        g_timelimit = get_cvar_float("mp_timelimit");



    if (g_lastround) {

        new Float:roundtime = get_cvar_float("mp_roundtime");

        new Float:c4timer = get_cvar_float("mp_c4timer")/60;

            // Extend the maps time one round + c4timer + some buffer

            set_cvar_float("mp_timelimit", g_timelimit + roundtime + c4timer + 0.5);

                   

        new text[256];

        format(text, 255, ".Ostatnia runda!");

        doTypesay(text, 5, 210, 0, 0);



        for (new i = 1; i <= 33; i++)

        {

        client_cmd(i, "spk sound/misc/mxt/remix");

        }



        g_changemap = true;

        g_lastround = false;

    } else if (g_changemap) {

        new nextmap[32];

            get_cvar_string("amx_nextmap", nextmap, 31);

   

        new text[256];

        format(text, 255, "Thank you for playing. Now switching to %s!", nextmap);

        doTypesay(text, 5, 210, 0, 0);



        g_maxspeed = get_cvar_float("sv_maxspeed");

        set_cvar_float("sv_maxspeed", 0.0);



                set_task(0.1, "disablePlayers", DISABLE_PLAYERS_TASK, "", 0, "a", 3);

                set_task(6.0, "changeMap", CHANGE_MAP_TASK);

    }



        return PLUGIN_CONTINUE;

}



public initiateLastRound() {

    if (!get_cvar_num("lastround")) return PLUGIN_CONTINUE;



    remove_task(INITIATE_LAST_ROUND_TASK);



    new text[256];

    format(text, 255, "Zaraz bedzie ostatnia runda!");

        doTypesay(text, 5, 210, 0, 0);



        new Float:roundtime = get_cvar_float("mp_roundtime");

    new Float:c4timer = get_cvar_float("mp_c4timer")/60;



    // (2* roundtime since it is possible that the even occurs at the beginning of a round)

    set_cvar_float("mp_timelimit", g_timelimit + (2.0*roundtime) + (2.0*c4timer));



    g_lastround = true;



    return PLUGIN_CONTINUE;

}



public disablePlayers() {

        new players[32], num;

        get_players(players, num, "c");

        for(new i=0;i<num; i++) {

        client_cmd(players[i],"drop");

    }

}



public changeMap() {

    remove_task(CHANGE_MAP_TASK);



        new nextmap[32];

        get_cvar_string("amx_nextmap", nextmap, 31);

        server_cmd("changelevel %s", nextmap);

}



doTypesay(string[], duration, r, g, <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> {

        set_hudmessage(r, g, b, 0.05, 0.45, 0, 6.0, float(duration) , 0.5, 0.15, 4);

        show_hudmessage(0, string);

}

                   

public plugin_init() {

        register_plugin(g_scTitle, g_scVersion, g_scAuthor);



        register_cvar("lastround", "1");

    register_logevent("evRoundStart", 2, "0=World triggered", "1=Round_Start");



    // Chose 90 seconds not to clash with other events

    set_task(90.0, "initiateLastRound", INITIATE_LAST_ROUND_TASK, "", 0, "d");



    return PLUGIN_CONTINUE;

}



public plugin_precache()

{

 precache_sound("misc/mxt/remix.wav");

} 



public plugin_end() {

    set_cvar_float("mp_timelimit", g_timelimit);

    set_cvar_float("sv_maxspeed", g_maxspeed);



    remove_task(DISABLE_PLAYERS_TASK);



    return PLUGIN_CONTINUE;

}

  • +
  • -
  • 0

#3 AdiX

    Nowy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:4
Offline

Napisano 01.07.2008 14:47

Nie potrafię skomplikować ... , pomożesz ?


/home/groups/amxmodx/tmp3/textELYLOZ.sma(36) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(38) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(42) : error 017: undefined symbol "maxplayers"
/home/groups/amxmodx/tmp3/textELYLOZ.sma(45) : error 001: expected token: ";", but found "}"
/home/groups/amxmodx/tmp3/textELYLOZ.sma(50) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(52) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(59) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(63) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(73) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(76) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(97) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(111) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textELYLOZ.sma(120) : error 001: expected token: ";", but found "{"
/home/groups/amxmodx/tmp3/textELYLOZ.sma(131) : warning 203: symbol is never used: "plugin_precache"

3 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textELYLOZ.amx (compile failed).
  • +
  • -
  • 0

#4 Salamon

    Profesjonalista

  • Użytkownik

Reputacja: 43
Pomocny

  • Postów:199
Offline

Napisano 01.07.2008 20:57

lolz nie spojrzalem na to
#pragma semicolon 1 // force ; usage, just 'cause

przez to na koncu wszystkiego musi byc ";"

sprobuj teraz
  • +
  • -
  • 0

#5 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 01.07.2008 21:09

O wymuszanie zapisu z C, nie widzialem takiego czegos w pawnie :) rodzynek ^^
  • +
  • -
  • 0

#6 MafiaDL

    Naj-Najstarszy Moderator

  • Przyjaciel

Reputacja: 561
Wszechwiedzący

  • Postów:3 492
  • GG:
  • Imię:Łukasz
  • Lokalizacja:Warsaw
Offline

Napisano 01.07.2008 21:10

lolz nie spojrzalem na to
#pragma semicolon 1 // force ; usage, just 'cause

przez to na koncu wszystkiego musi byc ";"

sprobuj teraz



Wszystko okej poza tym :

/home/groups/amxmodx/tmp3/textdNEtvG.sma(36) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdNEtvG.sma(38) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdNEtvG.sma(51) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdNEtvG.sma(53) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdNEtvG.sma(60) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdNEtvG.sma(64) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdNEtvG.sma(74) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdNEtvG.sma(77) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdNEtvG.sma(98) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdNEtvG.sma(112) : warning 217: loose indentation
Header size:            648 bytes
Code size:             3292 bytes
Data size:             1884 bytes
Stack/heap size:      16384 bytes; estimated max. usage=312 cells (1248 bytes)
Total requirements:   22208 bytes

10 Warnings.
Done.

Chyba nie groźne? :P


Plugin w załączniku ^D^

Załączone pliki


  • +
  • -
  • 0

#7 Salamon

    Profesjonalista

  • Użytkownik

Reputacja: 43
Pomocny

  • Postów:199
Offline

Napisano 01.07.2008 21:23

identication to ostrzezenie o tym ze linijki nie sa rowno ^.^ wiec niegrozne :P taki u rok tego['code] :P
  • +
  • -
  • 0

#8 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 02.07.2008 08:35

identication to ostrzezenie o tym ze linijki nie sa rowno ^.^ wiec niegrozne :P taki u rok tego['code] :P

To nie jest do konca prawda...

Taki blad moze tez byc gdy:
new zmienna = get_cvar_float("mp_roundtime")
I to moze spowodowac bledne, lub calkowity brak reakcji pluga...

PS. Kto widzi co jest nie tak, to punkt dla niego ;-)
  • +
  • -
  • 0

#9 Salamon

    Profesjonalista

  • Użytkownik

Reputacja: 43
Pomocny

  • Postów:199
Offline

Napisano 02.07.2008 14:18

identication to ostrzezenie o tym ze linijki nie sa rowno ^.^ wiec niegrozne :P taki u rok tego['code] :P

To nie jest do konca prawda...

Taki blad moze tez byc gdy:
new zmienna = get_cvar_float("mp_roundtime")
I to moze spowodowac bledne, lub calkowity brak reakcji pluga...


mylisz sie ^.^ to co podales wywola tag mismatch, co moze byc przyczyna nieprawidlowej pracy pluga, lecz nie zawsze
  • +
  • -
  • 0

#10 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 02.07.2008 15:25

A faktycznie, musialem byc zmeczony xP
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych