←  Pluginy

AMXX.pl: Support AMX Mod X i SourceMod

»

Modyfikacja
[ROZWIĄZANE] Najlepsi gracze rundy

Zablokowany

  • +
  • -
P@trYk^.^ - zdjęcie P@trYk^.^ 28.09.2012

Witam.
Mógłby mi ktoś przerobić ten kod:
new name[32];
new winner = starid[2];
if ( !winner )
  return;
new line[100];
line[0] = 0x04;
formatex(line[1], 98, "Najlepsi gracze na tej mapie:");
ShowColorMessage(starid[2], MSG_BROADCAST, line);
line[0] = 0x04;
get_user_name(starid[2], name, charsmax(name));
line[0] = 0x04;
formatex(line[1], 98, "1. %s - %i Fragow (+%d dosw.)", name, starfrags[2], exp_1miejsce);
ShowColorMessage(starid[2], MSG_BROADCAST, line);
get_user_name(starid[1], name, charsmax(name));
line[0] = 0x04;
formatex(line[1], 98, "2. %s - %i Fragow (+%d dosw.)", name, starfrags[1], exp_2miejsce);
ShowColorMessage(starid[2], MSG_BROADCAST, line);
get_user_name(starid[0], name, charsmax(name));
line[0] = 0x04;
formatex(line[1], 98, "3. %s - %i Fragow (+%d dosw.)", name, starfrags[0], exp_3miejsce);
ShowColorMessage(starid[2], MSG_BROADCAST, line);
}
ShowColorMessage(id, type, message[])
{
message_begin(type, gmsgSayText, _, id);
write_byte(id);
write_string(message);
message_end();
}

Tak, aby było tak jak jest tylko zmienić kolor na default, zwykły (ten żółty), a nick na kolor TEAM(drużynowy), jeśli ktoś nie wie o co chodzi wytłumacze lepiej ;d
Odpowiedz

  • +
  • -
sNH. - zdjęcie sNH. 28.09.2012

Nie wiem czy w ten sposób zadziała, ale łap. Jeżeli nie, to podeślij kod tutaj/na pw.


new name[32];
new winner = starid[2];
if ( !winner )
return;
new line[100];
line[0] = 0x04;
ColorChat(id, TEAM_COLOR, "Najlepsi gracze na tej mapie:");
ShowColorMessage(starid[2], MSG_BROADCAST, line);
line[0] = 0x04;
get_user_name(starid[2], name, charsmax(name));
line[0] = 0x04;
ColorChat(id, TEAM_COLOR, "1. %s - %i Fragow (+%d dosw.)", name, starfrags[2], exp_1miejsce);
ShowColorMessage(starid[2], MSG_BROADCAST, line);
get_user_name(starid[1], name, charsmax(name));
line[0] = 0x04;
ColorChat(id, TEAM_COLOR, "2. %s - %i Fragow (+%d dosw.)", name, starfrags[1], exp_2miejsce);
ShowColorMessage(starid[2], MSG_BROADCAST, line);
get_user_name(starid[0], name, charsmax(name));
line[0] = 0x04;
ColorChat(id, TEAM_COLOR, ". %s - %i Fragow (+%d dosw.)", name, starfrags[0], exp_3miejsce);
ShowColorMessage(starid[2], MSG_BROADCAST, line);
}
ShowColorMessage(id, type, message[])
{
message_begin(type, gmsgSayText, _, id);
write_byte(id);
write_string(message);
message_end();
}


Do include dopisujesz #include <colorchat>
Użytkownik SlaNdisH! edytował ten post 28.09.2012 18:48
Odpowiedz

  • +
  • -
P@trYk^.^ - zdjęcie P@trYk^.^ 28.09.2012

Mi to nie działa :/
Proszę o dalszą pomoc.
Odpowiedz

  • +
  • -
sNH. - zdjęcie sNH. 28.09.2012

Daj całe sma... I errory
Odpowiedz

  • +
  • -
P@trYk^.^ - zdjęcie P@trYk^.^ 28.09.2012

Proszę oto .sma

Załączone pliki

Odpowiedz

  • +
  • -
sNH. - zdjęcie sNH. 28.09.2012

Łap:


#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <colorchat>

#define PLUGIN "[COD] EXP dla najlepszych 3 graczy"
#define VERSION "0.69"
#define AUTHOR "pRED (edit by =ToRRent=)"

// Dla tych nie kumatych ;) jest to przerobiony plugin bf2medals autorstwa pRED


new cvar_exp_1miejsce, cvar_exp_2miejsce, cvar_exp_3miejsce;
new exp_1miejsce, exp_2miejsce, exp_3miejsce;

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

cvar_exp_1miejsce = register_cvar("cod_exp1", "300"); // ilosc doswiadczenia za 1 miejsce
cvar_exp_2miejsce = register_cvar("cod_exp2", "150"); // ilosc doswiadczenia za 2 miejsce
cvar_exp_3miejsce = register_cvar("cod_exp3", "75"); // ilosc doswiadczenia za 3 miejsce

register_message(SVC_INTERMISSION, "Message_Intermission");

exp_1miejsce = get_pcvar_num(cvar_exp_1miejsce);
exp_2miejsce = get_pcvar_num(cvar_exp_2miejsce);
exp_3miejsce = get_pcvar_num(cvar_exp_3miejsce);
}
public Message_Intermission(){
set_task(0.1, "przyznanie_doswiadczenia");
}
public przyznanie_doswiadczenia()
{
//uruchom podczas SVC_INTERMISSION (tuz przed zmiana mapy)
//Znajdz 3 najlepszych graczy z najwieksza liczba fragow i przyznaj doswiadczenie

new players[32], num;
get_players(players, num, "h");

new tempfrags, id;

new swapfrags, swapid;

new starfrags[3]; //0 - 3 miejsce / 1 - 2 miejsce / 2 - 1 miejsce
new starid[3];

for (new i = 0; i < num; i++)
{
id = players[i];
tempfrags = get_user_frags(id);
if ( tempfrags > starfrags[0] )
{
starfrags[0] = tempfrags;
starid[0] = id;
cod_set_user_xp(starid[0], cod_get_user_xp(starid[0])+exp_3miejsce);
if ( tempfrags > starfrags[1] )
{
swapfrags = starfrags[1];
swapid = starid[1];
starfrags[1] = tempfrags;
starid[1] = id;
starfrags[0] = swapfrags;
starid[0] = swapid;
cod_set_user_xp(starid[1], cod_get_user_xp(starid[1])+exp_2miejsce);

if ( tempfrags > starfrags[2] )
{
swapfrags = starfrags[2];
swapid = starid[2];
starfrags[2] = tempfrags;
starid[2] = id;
starfrags[1] = swapfrags;
starid[1] = swapid;
cod_set_user_xp(starid[2], cod_get_user_xp(starid[2])+exp_1miejsce);

}
}
}
}
new name[32];
new winner = starid[2];

if ( !winner )
return;

ColorChat(0, TEAM_COLOR, "Najlepsi gracze na tej mapie:");
get_user_name(starid[2], name, charsmax(name));
ColorChat(0, TEAM_COLOR, ". %s - %i Fragow (+%d dosw.)", name, starfrags[2], exp_1miejsce);

get_user_name(starid[1], name, charsmax(name));
ColorChat(0, TEAM_COLOR, ". %s - %i Fragow (+%d dosw.)", name, starfrags[1], exp_2miejsce);

get_user_name(starid[0], name, charsmax(name));
ColorChat(0, TEAM_COLOR, ". %s - %i Fragow (+%d dosw.)", name, starfrags[0], exp_3miejsce);

}
Odpowiedz

Gość_21977_* 14.10.2012

Wiadomość wygenerowana automatycznie


Ten temat został zamknięty przez moderatora.

Powód: Pomoc udzielona

Jeśli się z tym nie zgadzasz, Posted Image raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.


Z pozdrowieniami,
Zespół AMXX.PL
Odpowiedz
Zablokowany