Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <csstats>
- #include <colorchat>
- #define MAXRANG 14
- enum _:CHAT
- {
- Rang[32],
- Cost[8]
- }
- new const rangok[MAXRANG][CHAT] = {
- {"Amatőr", 0},
- {"Kezdő", 25},
- {"Lelkes", 75},
- {"Játékos", 150},
- {"Kocka", 250},
- {"FĂ©l-profi", 420},
- {"Profi", 600},
- {"Edző", 850},
- {"Felsőbbrendű", 1200},
- {"Természetfeletti", 1600},
- {"FĂ©listen", 2000},
- {"MindenhatĂł", 2500},
- {"ISTEN", 3500},
- {"MLG Profi", 4000}
- }
- new szint[33]
- #define GetBit(%1,%2) (%1 & (1 << (%2 & 31)))
- #define SetBit(%1,%2) %1 |= (1 << (%2 & 31))
- #define ResetBit(%1,%2) %1 &= ~(1 << (%2 & 31))
- new bitadmin, bitelo;
- public plugin_init() {
- register_plugin("Chat", "1.1", "neygomon & mforce, LyleChriss edit")
- register_clcmd("say", "HandlerSay");
- register_clcmd("say_team", "HandlerSayTeam");
- register_clcmd("say /rang", "RangKiir");
- register_event("ResetHUD", "eResetHUD", "be");
- register_event("DeathMsg", "eDeathMsg", "a", "1>0");
- }
- public RangKiir(id)
- {
- new szStats[8],szBHits[8];
- get_user_stats(id,szStats,szBHits);
- ColorChat(id, NORMAL, "^4[West Side] ^1Jelenlegi rangod: ^4%s ^1| Öléseid: ^3%d ^1| Következő rang: ^4%s ^1| Szükséges ölések: ^3%d", rangok[szint[id]][Rang], szStats[0], rangok[szint[id]+1][Rang], rangok[szint[id]+1][Cost]-szStats[0])
- }
- public client_putinserver(id)
- {
- szint[id] = 0
- if(get_user_flags(id) & ADMIN_CHAT) SetBit(bitadmin, id);
- else ResetBit(bitadmin, id);
- }
- public client_disconnect(id)
- {
- ResetBit(bitelo, id);
- szint[id] = 0
- }
- public eResetHUD(id, level, cid) {
- SetBit(bitelo, id);
- new szStats[8],szBHits[8];
- get_user_stats(id,szStats,szBHits);
- while(szStats[0] >= rangok[szint[id]+1][Cost]&&szint[id]<MAXRANG)
- szint[id]++
- return PLUGIN_CONTINUE
- }
- public eDeathMsg() ResetBit(bitelo, read_data(2));
- public HandlerSay(id) return uzenetformazas(id, false);
- public HandlerSayTeam(id) return uzenetformazas(id, true);
- uzenetformazas(id, bool:csapat)
- {
- #define MAX_BIT 180
- static uzenet[MAX_BIT], stringkonvertalas[charsmax(uzenet) * 2 + 1];
- read_args(uzenet, charsmax(uzenet));
- remove_quotes(uzenet);
- if(uzenet[0] == EOS || uzenet[0] == '/' || equal(uzenet, " "))
- return PLUGIN_HANDLED_MAIN;
- static fullos, tagek[MAX_BIT], team_lekeres, sTeam[16];
- team_lekeres = get_user_team(id, sTeam, charsmax(sTeam));
- switch(team_lekeres)
- {
- case 1: fullos = formatex(tagek, charsmax(tagek), "%s%s", GetBit(bitelo, id) ? "^1" : "^1*Halott* ", csapat ? "^1[T] " : "");
- case 2: fullos = formatex(tagek, charsmax(tagek), "%s%s", GetBit(bitelo, id) ? "^1" : "^1*Halott* ", csapat ? "^1[CT] " : "");
- default:fullos = formatex(tagek, charsmax(tagek), "^1*Spec* ");
- }
- new stats[8], bodyhits[8]
- new iRank;
- iRank = get_user_stats(id, stats, bodyhits)
- if(get_user_flags(id)&ADMIN_RCON)
- fullos += formatex(tagek[fullos], charsmax(tagek)-fullos, "^4[Tulaj]")
- else if(get_user_flags(id)&ADMIN_CVAR)
- fullos += formatex(tagek[fullos], charsmax(tagek)-fullos, "^4[FĹ‘admin]")
- else if((get_user_flags(id)&ADMIN_BAN) && (get_user_flags(id)&ADMIN_LEVEL_H))
- fullos += formatex(tagek[fullos], charsmax(tagek)-fullos, "^4[Admin+VIP]")
- else if(get_user_flags(id)&ADMIN_BAN)
- fullos += formatex(tagek[fullos], charsmax(tagek)-fullos, "^4[Admin]")
- else if(get_user_flags(id)&ADMIN_LEVEL_H)
- fullos += formatex(tagek[fullos], charsmax(tagek)-fullos, "^4[VIP]")
- else if(iRank && iRank == 1)
- fullos += formatex(tagek[fullos], charsmax(tagek)-fullos, "^4[TOP1]")
- fullos += formatex(tagek[fullos], charsmax(tagek)-fullos, "^4[%s]", rangok[szint[id]][Rang])
- if(is_user_admin(id) || (iRank && iRank == 1)) fullos += formatex(tagek[fullos], charsmax(tagek) - fullos, "^3%%s1^1 : ^4%%s2");
- else formatex(tagek[fullos], charsmax(tagek) - fullos, "^3%%s1^1 : %%s2");
- stringkonvertalas = uzenet;
- replace_all( stringkonvertalas, charsmax( stringkonvertalas ), "", " " );
- replace_all( stringkonvertalas, charsmax( stringkonvertalas ), "", " " );
- static bitlimit; bitlimit = MAX_BIT;
- while(fullos + strlen(stringkonvertalas) > MAX_BIT) stringkonvertalas[bitlimit -= 10] = 0;
- static players[32], pcount; get_players(players, pcount, "c");
- switch(csapat)
- {
- case true:
- {
- for(new i; i < pcount; i++)
- {
- if(GetBit(bitadmin, players[i]) || (GetBit(bitelo, id) == GetBit(bitelo, players[i]) && team_lekeres == get_user_team(players[i])))
- PrintChat(players[i], id, tagek, stringkonvertalas);
- }
- }
- case false:
- {
- for(new i; i < pcount; i++)
- PrintChat(players[i], id, tagek, stringkonvertalas);
- }
- }
- static sAuthId[25], sName[32];
- get_user_name(id, sName, charsmax(sName));
- get_user_authid(id, sAuthId, charsmax(sAuthId));
- log_message("^"%s<%d><%s><%s>^" %s ^"%s^"", sName, get_user_userid(id), sAuthId, sTeam, csapat ? "say_team" : "say" , stringkonvertalas);
- return PLUGIN_HANDLED;
- }
- PrintChat(iReceiver, iSender, const tagek[], const uzenet[])
- {
- message_begin(MSG_ONE, 76, .player=iReceiver);
- write_byte(iSender);
- write_string(tagek);
- write_string("");
- write_string(uzenet);
- message_end();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement