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

Przerobienie pluginu


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

#1 ZBAGI

    Profesjonalista

  • Użytkownik

Reputacja: 15
Początkujący

  • Postów:150
  • Lokalizacja:Brak informacji ;)
Offline

Napisano 03.01.2009 23:21

witam, chciałbym by ktoś przerobił plugin lub zrobił nowy, który by po wpisaniu komendy np. "say /lvle"
pokazyawl lvl'e graczy (tak jak w diablo mod pokazuje lvl'e i postać aktualnie grających osob)

/* Plugin generated by AMXX-Studio


*/

#include <amxmodx>
#include <amxmisc>
#include <csx>

#define PLUGIN "LVL'e"
#define VERSION "1.0"
#define AUTHOR "Edit by ZBAGI"

#define TASK 666

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
}

public client_connect(id)
{
    if(is_user_bot(id))
        return
   
    new param[1]
    param[0] = id
   
    set_task(1.0,"rank",TASK+id,param,1,"b")
}

public client_disconnect(id)
    if(task_exists(TASK+id))
    remove_task(TASK+id)

public rank(param[])
{
    new id = param[0]
   
    static stats[8], body[8]
    get_user_stats(id, stats, body)
   
    new ranga[30]
   
    if ( stats[0] >= 0 && stats[0] <= 0)
        format(ranga,29,"1)")
    else if ( stats[0] >= 1 && stats[0] <= 2)
        format(ranga,29,"2)")
    else if ( stats[0] >= 3 && stats[0] <= 4)
        format(ranga,29,"3)")
    else if ( stats[0] >= 5 && stats[0] <= 9)
        format(ranga,29,"4)")
    else if ( stats[0] >= 10 && stats[0] <= 14)
        format(ranga,29,"5)")
    else if ( stats[0] >= 15 && stats[0] <= 19)
        format(ranga,29,"6)")
    else if ( stats[0] >= 20 && stats[0] <= 29)
        format(ranga,29,"7)")
    else if ( stats[0] >= 30 && stats[0] <= 39)
        format(ranga,29,"8)")
    else if ( stats[0] >= 40 && stats[0] <= 49)
        format(ranga,29,"9)")
    else if ( stats[0] >= 50 && stats[0] <= 59)
        format(ranga,29,"10)")
    else if ( stats[0] >= 60 && stats[0] <= 69)
        format(ranga,29,"11)")
    else if ( stats[0] >= 70 && stats[0] <= 79)
        format(ranga,29,"12)")
    else if ( stats[0] >= 80 && stats[0] <= 89)
        format(ranga,29,"13)")
    else if ( stats[0] >= 90 && stats[0] <= 99)
        format(ranga,29,"14)")
    else if ( stats[0] >= 100 && stats[0] <= 109)
        format(ranga,29,"15)")
    else if ( stats[0] >= 110 && stats[0] <= 119)
        format(ranga,29,"16)")
    else if ( stats[0] >= 120 && stats[0] <= 129)
        format(ranga,29,"17)")
    else if ( stats[0] >= 130 && stats[0] <= 139)
        format(ranga,29,"18)")
    else if ( stats[0] >= 140 && stats[0] <= 149)
        format(ranga,29,"19 )")
    else if ( stats[0] >= 150 )
        format(ranga,29,"BOSS)")
   
    set_hudmessage(255, 255, 255, 0.15, 0.55)
    show_hudmessage(id, "( lvl: %s^nEXP: %d",ranga,stats[0])
}

  • +
  • -
  • 0

#2 R3X

    Godlike

  • Przyjaciel

Reputacja: 2 987
Godlike

  • Postów:4 248
  • Lokalizacja:Nie
Offline

Napisano 04.01.2009 00:20

Powinno działać, może się nie kompilować przez internet, więc załączam .amxx
#include <amxmodx>
#include <csx>
#include <cstrike>

#define PLUGIN "LVL'e"
#define VERSION "1.0"
#define AUTHOR "R3X"

#define RANGI 20
new g_rangi[RANGI]={0,2,4,9,14,19,29,39,49,59,69,79,89,99,109,119,129,139,149}

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_clcmd("say /lvl","buildMotd");
}

public buildMotd(id){
	new html[1024];
	formatex(html,1023,"<html><head><style type=^"text/css^">");
	format(html,1023,"%sthead{font-weight:bold;}.nick{width:300px}.lvl,.<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />{width:20px}",html);
	format(html,1023,"%s.ct{color:#1212DE}.tt{color:#DE1212}</style></head><body><table border=1>",html);
	format(html,1023,"%s<thead><tr><td class=^"nick^">Nick</td>",html);
	format(html,1023,"%s<td class=^"lvl^">LVL</td><td class=^"xp^">EXP</td></tr></thead><tbody>",html);
	new iPlayers[32],iNum;
	get_players(iPlayers,iNum);
	for(new i=0;i<iNum;i++){
		new pid=iPlayers[i];
		new CsTeams:team=cs_get_user_team(pid);
		if((team!=CS_TEAM_T)&&(team!=CS_TEAM_CT))
			continue;
		new ranga[5],<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />=getRank(pid,ranga);
		new nick[40];
		get_user_name(pid,nick,39);
		format(html,1023,"%s<tr><td class=^"%s^">%s</td><td>%s</td><td>%d</td></tr>",html,(team==CS_TEAM_T)?"tt":"ct",nick,ranga,<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />)
	}
	format(html,1023,"%s</tbody></table></body></html>",html);
	show_motd(id, html,"Rangi");
}
public getRank(id, ranga[5])
{
	new stats[8], body[8]
	get_user_stats(id, stats, body);
	new i;
	for(i=0;i<RANGI;i++){
		if(g_rangi[i]>=stats[0])
			break;
	}
	if(i==RANGI)
		formatex(ranga,4,"BOSS");
	else
		formatex(ranga,4,"%d",i+1);
	return stats[0];
}

Załączone pliki

  • Załączony plik  lvl.amxx   3,66 KB  20 Ilość pobrań

  • +
  • -
  • 0

#3 ZBAGI

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 15
Początkujący

  • Postów:150
  • Lokalizacja:Brak informacji ;)
Offline

Napisano 04.01.2009 14:02

Biedzie +,
ale mógłbyś naprawić jeszcze jeden błąd ?
W tabeli obniża 1 lvl
Jak sie ma 1 EXP to sie ma 2 lvl a w tabeli pisze ze 1,
później wszyscy maja o 1 lvl za mało, (np. ja mam 6 lvl a w tabeli pisze ze 5)
  • +
  • -
  • 0

#4 R3X

    Godlike

  • Przyjaciel

Reputacja: 2 987
Godlike

  • Postów:4 248
  • Lokalizacja:Nie
Offline

Napisano 04.01.2009 14:10

Zmieniłem na to:
public getRank(id, ranga[5])
{
    new stats[8], body[8]
    get_user_stats(id, stats, body);
    new i;
    for(i=0;i<RANGI;i++){
        if(g_rangi[i]>stats[0])
            break;
    }
    if(i==RANGI)
        formatex(ranga,4,"BOSS");
    else
        formatex(ranga,4,"%d",i+1);
    return stats[0];
}

  • +
  • -
  • 0

#5 ZBAGI

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 15
Początkujący

  • Postów:150
  • Lokalizacja:Brak informacji ;)
Offline

Napisano 04.01.2009 14:57

czyli co mam zrobić, bo tego już nie ogarniam :)
  • +
  • -
  • 0

#6 R3X

    Godlike

  • Przyjaciel

Reputacja: 2 987
Godlike

  • Postów:4 248
  • Lokalizacja:Nie
Offline

Napisano 04.01.2009 15:13

Pokazałem Ci tylko co zmieniłem, cały poprawiony kod jest w moim pierwszym poście + skompilowany do .amxx
  • +
  • -
  • 0

#7 ZBAGI

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 15
Początkujący

  • Postów:150
  • Lokalizacja:Brak informacji ;)
Offline

Napisano 04.01.2009 20:33

teraz zawyża o 1 lvl, jak ma sie 0 exp to pisze ze 2 lvl
  • +
  • -
  • 0

#8 R3X

    Godlike

  • Przyjaciel

Reputacja: 2 987
Godlike

  • Postów:4 248
  • Lokalizacja:Nie
Offline

Napisano 04.01.2009 22:07

Teraz będzie ok, sry za zamieszanie, ale nie mam za bardzo gdzie tego przetestować :/
  • +
  • -
  • 0

#9 ZBAGI

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 15
Początkujący

  • Postów:150
  • Lokalizacja:Brak informacji ;)
Offline

Napisano 04.01.2009 22:40

Wielki + Dla ciebie, teraz wszystko OK

Można zamknąć,
  • +
  • -
  • 0




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

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