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

Vip pisze na zielono :)


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
10 odpowiedzi w tym temacie

#1 H.W.D.P

    Zaawansowany

  • Zbanowany

Reputacja: 37
Życzliwy

  • Postów:92
  • Imię:Marek
  • Lokalizacja:Worcław
Offline

Napisano 13.12.2011 17:08

Czee ! To znowu ja ;) Lecz teraz mam problem aby do pluginu dodać opcje iż pisze on na zielono :)

Za pomoc leci oczywiście + :)

#2 Fili:P

    Godlike

  • Power User

Reputacja: 754
Guru

  • Postów:1 679
  • Imię:Darek
  • Lokalizacja:Warszawa
Offline

Napisano 13.12.2011 17:43

Jakie pluginu, daj sma !
  • +
  • -
  • 0

#3 H.W.D.P

    Zaawansowany

  • Autor tematu
  • Zbanowany

Reputacja: 37
Życzliwy

  • Postów:92
  • Imię:Marek
  • Lokalizacja:Worcław
Offline

Napisano 13.12.2011 17:47

Ale mi chodzi o kod :)
Nie mogę dać sma !

#4 FORMOZA

    KDE User

  • Power User

Reputacja: 416
Wszechobecny

  • Postów:758
  • Imię:Kamil
  • Lokalizacja:Łowicz
Offline

Napisano 13.12.2011 17:53

Możesz przerobić z tego:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "User Chat Colors"
#define VERSION "2.0"
#define AUTHOR "Arion"
#define ACCESS_LEVEL ADMIN_USER
#define ADMIN_LISTEN ADMIN_USER

new message[192]
new sayText
new teamInfo
new maxPlayers
new g_MessageColor
new g_NameColor
new g_AdminListen
new strName[191]
new strText[191]
new alive[11]
public plugin_init()
{
register_plugin (PLUGIN, VERSION, AUTHOR)

g_MessageColor = register_cvar ("amx_color", "2") // Message colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red
g_NameColor = register_cvar ("amx_namecolor", "6") // Name colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red, [6] Team-color

g_AdminListen = register_cvar ("amx_listen", "1") // Set whether admins see or not all messages (Alive, dead and team-only)


sayText = get_user_msgid ("SayText")
teamInfo = get_user_msgid ("TeamInfo")
maxPlayers = get_maxplayers()


register_message (sayText, "avoid_duplicated")

register_clcmd ("amx_color", "set_color", ACCESS_LEVEL, "<color>")
register_clcmd ("amx_namecolor", "set_name_color", ACCESS_LEVEL, "<color>")
register_clcmd ("amx_listen", "set_listen", ACCESS_LEVEL, "<1 | 0>")

register_clcmd ("say", "hook_say")
register_clcmd ("say_team", "hook_teamsay")
}

public avoid_duplicated (msgId, msgDest, receiver)
{
return PLUGIN_HANDLED
}

public hook_say(id)
{
read_args (message, 191)
remove_quotes (message)

if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
// Gungame commands and empty messages
return PLUGIN_CONTINUE

new name[32]
get_user_name (id, name, 31)

new bool:admin = false

if (get_user_flags(id) & ACCESS_LEVEL)
admin = true


new isAlive

if (is_user_alive (id))
{
isAlive = 1
alive = "^x01"
}
else
{
isAlive = 0
alive = "^x01*DEAD* "
}

static color[10]

if (admin)
{
// Name
switch (get_pcvar_num (g_NameColor))
{
case 1:
format (strName, 191, "%s%s", alive, name)
case 2:
format (strName, 191, "%s^x04%s", alive, name)

case 3:
{
color = "SPECTATOR"
format (strName, 191, "%s^x03%s", alive, name)
}

case 4:
{
color = "CT"
format (strName, 191, "%s^x03%s", alive, name)
}
case 5:
{
color = "TERRORIST"
format (strName, 191, "%s^x03%s", alive, name)
}

case 6:
{
get_user_team (id, color, 9)

format (strName, 191, "%s^x03%s", alive, name)
}
}


// Message
switch (get_pcvar_num (g_MessageColor))
{
case 1: // Yellow
format (strText, 191, "%s", message)

case 2: // Green
format (strText, 191, "^x04%s", message)

case 3: // White
{
copy (color, 9, "SPECTATOR")
format (strText, 191, "^x03%s", message)
}
case 4: // Blue
{
copy (color, 9, "CT")
format (strText, 191, "^x03%s", message)
}

case 5: // Red
{
copy (color, 9, "TERRORIST")
format (strText, 191, "^x03%s", message)
}
}
}

else // Player is not admin. Team-color name : Yellow message
{
get_user_team (id, color, 9)

format (strName, 191, "%s^x03%s", alive, name)

format (strText, 191, "%s", message)
}
format (message, 191, "%s^x01 : %s", strName, strText)

sendMessage (color, isAlive) // Sends the colored message

return PLUGIN_CONTINUE
}

public hook_teamsay(id)
{
new playerTeam = get_user_team(id)
new playerTeamName[19]

switch (playerTeam) // Team names which appear on team-only messages
{
case 1:
copy (playerTeamName, 11, "Terrorists")

case 2:
copy (playerTeamName, 18, "Counter-Terrorists")

default:
copy (playerTeamName, 9, "Spectator")
}

read_args (message, 191)
remove_quotes (message)

if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
// Gungame commands and empty messages
return PLUGIN_CONTINUE

new name[32]
get_user_name (id, name, 31)

new bool:admin = false

if (get_user_flags(id) & ACCESS_LEVEL)
admin = true


new isAlive

if (is_user_alive (id))
{
isAlive = 1
alive = "^x01"
}
else
{
isAlive = 0
alive = "^x01*DEAD* "
}

static color[10]

if (admin)
{
// Name
switch (get_pcvar_num (g_NameColor))
{
case 1:
format (strName, 191, "%s(%s) %s", alive, playerTeamName, name)
case 2:
format (strName, 191, "%s(%s) ^x04%s", alive, playerTeamName, name)

case 3:
{
color = "SPECTATOR"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 4:
{
color = "CT"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}
case 5:
{
color = "TERRORIST"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 6:
{
get_user_team (id, color, 9)

format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}
}


// Message
switch (get_pcvar_num (g_MessageColor))
{
case 1: // Yellow
format (strText, 191, "%s", message)

case 2: // Green
format (strText, 191, "^x04%s", message)

case 3: // White
{
copy (color, 9, "SPECTATOR")
format (strText, 191, "^x03%s", message)
}
case 4: // Blue
{
copy (color, 9, "CT")
format (strText, 191, "^x03%s", message)
}

case 5: // Red
{
copy (color, 9, "TERRORIST")
format (strText, 191, "^x03%s", message)
}
}
}

else // Player is not admin. Team-color name : Yellow message
{
get_user_team (id, color, 9)

format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)

format (strText, 191, "%s", message)
}

format (message, 191, "%s ^x01: %s", strName, strText)

sendTeamMessage (color, isAlive, playerTeam) // Sends the colored message

return PLUGIN_CONTINUE
}

public set_color (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newColor
read_argv (1, arg, 1)

newColor = str_to_num (arg)

if (newColor >= 1 && newColor <= 5)
{
set_cvar_num ("amx_color", newColor)
set_pcvar_num (g_MessageColor, newColor)

if (get_pcvar_num (g_NameColor) != 1 &&
((newColor == 3 && get_pcvar_num (g_NameColor) != 3)
|| (newColor == 4 && get_pcvar_num (g_NameColor) != 4)
|| (newColor == 5 && get_pcvar_num (g_NameColor) != 5)))
{
set_cvar_num ("amx_namecolor", 2)
set_pcvar_num (g_NameColor, 2)
}
}

return PLUGIN_HANDLED
}

public set_name_color (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newColor
read_argv (1, arg, 1)

newColor = str_to_num (arg)

if (newColor >= 1 && newColor <= 6)
{
set_cvar_num ("amx_namecolor", newColor)
set_pcvar_num (g_NameColor, newColor)

if ((get_pcvar_num (g_MessageColor) != 1
&& ((newColor == 3 && get_pcvar_num (g_MessageColor) != 3)
|| (newColor == 4 && get_pcvar_num (g_MessageColor) != 4)
|| (newColor == 5 && get_pcvar_num (g_MessageColor) != 5)))
|| get_pcvar_num (g_NameColor) == 6)
{
set_cvar_num ("amx_color", 2)
set_pcvar_num (g_MessageColor, 2)
}
}

return PLUGIN_HANDLED
}

public set_listen (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newListen
read_argv(1, arg, 1)

newListen = str_to_num (arg)

set_cvar_num ("amx_listen", newListen)
set_pcvar_num (g_AdminListen, newListen)

return PLUGIN_HANDLED
}

public sendMessage (color[], alive)
{
new teamName[10]

for (new player = 1; player < maxPlayers; player++)
{
if (!is_user_connected(player))
continue
if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message

changeTeamInfo (player, color) // Changes user's team according to color choosen

writeMessage (player, message) // Writes the message on player's chat

changeTeamInfo (player, teamName) // Changes user's team back to original
}
}
}

public sendTeamMessage (color[], alive, playerTeam)
{
new teamName[10]

for (new player = 1; player < maxPlayers; player++)
{
if (!is_user_connected(player))
continue
if (get_user_team(player) == playerTeam || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message

changeTeamInfo (player, color) // Changes user's team according to color choosen

writeMessage (player, message) // Writes the message on player's chat

changeTeamInfo (player, teamName) // Changes user's team back to original
}
}
}
}

public changeTeamInfo (player, team[])
{
message_begin (MSG_ONE, teamInfo, _, player) // Tells to to modify teamInfo (Which is responsable for which time player is)
write_byte (player) // Write byte needed
write_string (team) // Changes player's team
message_end() // Also Needed
}

public writeMessage (player, message[])
{
message_begin (MSG_ONE, sayText, {0, 0, 0}, player) // Tells to modify sayText (Which is responsable for writing colored messages)
write_byte (player) // Write byte needed
write_string (message) // Effectively write the message, finally, afterall
message_end () // Needed as always
}

  • +
  • -
  • 0

Diablo Mod V9 Demonic by FORMOZA *Updated 21-12-2013*

Perki by Pas (FORMOZA) cz1 %5BPaczka%5D

Perki by J River (FORMOZA) cz2 %5BPaczka%5D

Dołączona grafika

=================================

Załączony plik  Diablo Install_9.zip   1,2 MB  1172 Ilość pobrań

Załączony plik  Perki by Pas DOWNLOAD.zip   127,12 KB  1702 Ilość pobrań


Załączony plik  Perks_by_J_River.zip   178,98 KB  2343 Ilość pobrań

=================================


http://kdemaker.blogspot.com/


#5 H.W.D.P

    Zaawansowany

  • Autor tematu
  • Zbanowany

Reputacja: 37
Życzliwy

  • Postów:92
  • Imię:Marek
  • Lokalizacja:Worcław
Offline

Napisano 13.12.2011 17:59

Kod dłużysz niż 200 linijek dajemy na wklejke :)
Ale co odpowiada za ten kolor :)?

#6 Lelek

    Zaawansowany

  • Użytkownik

Reputacja: 22
Życzliwy

  • Postów:105
  • GG:
  • Imię:Adam
  • Lokalizacja:*
Offline

Napisano 13.12.2011 20:52


#include <amxmodx>
public plugin_init(){
register_plugin("New", "1.0", "Lelek");
register_message(get_user_msgid("SayText"), "HandleSay");

}
public HandleSay(msgId,msgDest,msgEnt)
{
new id = get_msg_arg_int(1);

if(get_user_flags(id) & ADMIN_LEVEL_A)
{
if(!is_user_connected(id)) return PLUGIN_CONTINUE;

new szTmp[256],szTmp2[256];
get_msg_arg_string(2,szTmp, charsmax( szTmp ) )

if(!equal(szTmp,"#Cstrike_Chat_All"))
{
add(szTmp2,charsmax(szTmp2),szTmp);
}
else{
add(szTmp2,charsmax(szTmp2),"^x03%s1^x01 : ^x04%s2");
}

set_msg_arg_string(2,szTmp2);

}
return PLUGIN_CONTINUE;
}

Użytkownik Lelek919 edytował ten post 13.12.2011 21:08

  • +
  • -
  • 1

#7 prokox22

    Pomocny

  • Użytkownik

Reputacja: 15
Początkujący

  • Postów:47
  • GG:
  • Imię:andrzej
  • Lokalizacja:słupsk
Offline

Napisano 29.12.2011 11:37

siema, podłączyłem się do tego pluginu, bo jak wgrałem ten plugin na serwa, to wszyscy gracze pisali na zielono a ja nie.
Streszczę, że dodałem plugin "Acze"

Czy można napisać plugin, aby tylko gracze z flagą G mogli pisać na zielone ?

Użytkownik prokox22 edytował ten post 29.12.2011 11:41

  • +
  • -
  • 0

#8 Lelek

    Zaawansowany

  • Użytkownik

Reputacja: 22
Życzliwy

  • Postów:105
  • GG:
  • Imię:Adam
  • Lokalizacja:*
Offline

Napisano 29.12.2011 19:43

W tym pluginie wyżej zamień:


if(get_user_flags(id) & ADMIN_LEVEL_A)

na
if(get_user_flags(id)& ADMIN_LEVEL_G)
  • +
  • -
  • 0

#9 Mr. Dziwny

    Wyrafinowany

  • Power User

Reputacja: 68
Pomocny

  • Postów:429
  • GG:
  • Imię:Marcin
  • Lokalizacja:Lębork
Offline

Napisano 30.12.2011 02:59

trzymaj ;) http://amxx.pl/topic...min-color-chat/
Na flagę "i"

Użytkownik Proxma edytował ten post 30.12.2011 03:03

  • +
  • -
  • 0

[ CS-Sfera.pl - Forum ogólnotematyczne ]

Sprzedam paczkę AMXX - COD MOD a la LOL (100k LVL):

IP serwera - 31.186.82.137:27106 (podgląd), pisać GG!
Kontakt:
GG: 46592283
E-mail: marcin@cs-sfera.pl


#10 Sniperek19

    Życzliwy

  • Użytkownik

Reputacja: 4
Nowy

  • Postów:38
  • GG:
  • Imię:Sław
  • Lokalizacja:Poznań
Offline

Napisano 05.02.2012 15:37

No w końcu to znalazłem dziękuje :)
  • +
  • -
  • 0

Wiele razy w życiu zostałem oszukany, może to przez to, że jestem zbyt naiwny albo głup hmm może to i to?! Ostatnio ukradli mi  mój rozkręcony serwerek.. Ale kogo to interesuje?! :} Po co ja to pisze LOL...  


#11 JunE

    Pomocny

  • Użytkownik

Reputacja: -3
Nowy

  • Postów:68
  • Imię:Sebastian
  • Lokalizacja:Polska
Offline

Napisano 01.04.2012 19:04

Fajny plugin tylko nie wiem dlaczego ale mam problem z tym
że gdy ktoś jest dead to nie pisze na zielono.

Tzn. gdy zyje say na zielono gdy dead normalnie.Daloby rade naprawic?>
  • +
  • -
  • 0




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

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