Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================= ALT CHAT =======================================
- new altchatonoff[MAX_PLAYERS];
- #define MAX_WARNS 8
- new Text: WarnTD;
- enum warnData {
- Text[128],
- Zauzet
- };
- new AdminWarns[ MAX_WARNS ][ warnData ];
- pod OnGameModeInit
- // ================================ ALT CHAT =================================
- WarnTD = TextDrawCreate(26.875000, 214.083435, "Text");
- TextDrawLetterSize(WarnTD, 0.187499, 0.800832);
- TextDrawAlignment(WarnTD, 1);
- TextDrawColor(WarnTD, -1);
- TextDrawSetShadow(WarnTD, 0);
- TextDrawSetOutline(WarnTD, 1);
- TextDrawBackgroundColor(WarnTD, 255);
- TextDrawFont(WarnTD, 1);
- TextDrawSetProportional(WarnTD, 1);
- OcistiWarnove();
- //==============================================================================
- //=========================== ALT CHAT =========================================
- stock OcistiWarnove() {
- for( new i = 0; i < MAX_WARNS; i++)
- {
- format(AdminWarns[ i ][ Text ], 128 ,"~r~(AC) ~w~Nema");
- AdminWarns[ i] [ Zauzet ] = 0;
- }
- }
- stock OcistiWarn(id) {
- format(AdminWarns[ id ][ Text ], 128 ,"~r~(AC) ~w~Nema");
- AdminWarns[ id ] [ Zauzet ] = 0;
- }
- stock OsvjeziWarn() {
- new updatewarntd[MAX_WARNS*128];
- strdel( updatewarntd, 0, sizeof(updatewarntd) );
- for( new i = 0; i < MAX_WARNS; i++)
- {
- if( AdminWarns [ i ] [ Zauzet ] == 0) { continue; }
- format(updatewarntd, sizeof( updatewarntd ), "%s%s~n~",updatewarntd, AdminWarns[ i ] [ Text ]);
- }
- TextDrawSetString(WarnTD, updatewarntd);
- }
- stock SviZauzeti() {
- new koliko=0;
- for( new i = 0; i < MAX_WARNS; i++)
- {
- if( AdminWarns[ i ] [ Zauzet ] == 1)
- {
- koliko+=1;
- }
- }
- if(koliko == MAX_WARNS) return 1;
- return 0;
- }
- stock DodajWarnRed(text[]) {
- if(strlen(text)>=100) { return 1; }
- if(SviZauzeti()) { OcistiWarn(MAX_WARNS-1); OsvjeziWarn(); DodajWarnRed(text); return 1; }
- for( new i = 0; i < MAX_WARNS; i++)
- {
- if( AdminWarns[ i ] [ Zauzet ] == 0)
- {
- format(AdminWarns[ i ][ Text ], 128 , text );
- AdminWarns[ i ] [ Zauzet ] = 1;
- OsvjeziWarn();
- break;
- }
- }
- return 1;
- }
- //==============================================================================
- komande //
- //=================================== ALT CHAT =================================
- YCMD:altchat(playerid, params[],help)
- {
- #pragma unused help
- #pragma unused params
- if(PlayerInfo[playerid][xAdmin] < 1) return Ovlascenje(playerid);
- if(altchatonoff[playerid] == 1)
- {
- TextDrawShowForPlayer(playerid,WarnTD);
- altchatonoff[playerid] = 0;
- SCM(playerid, -1, ""C_CRVENA"Server:"C_BELA"Upalili ste ALTERNATIVNI chat!");
- }
- else if(altchatonoff[playerid] == 0)
- {
- TextDrawHideForPlayer(playerid,WarnTD);
- altchatonoff[playerid] = 1;
- SCM(playerid, -1, ""C_CRVENA"Server:"C_BELA"Ugasili ste ALTERNATIVNI chat!");
- }
- return 1;
- }
- YCMD:altchatcc(playerid, params[],help)
- {
- #pragma unused help
- #pragma unused params
- if(UlogovanProvera[playerid] == 0) return Error(playerid, "Prvo se prijavite pa koristite komande!");
- if(PlayerInfo[playerid][xAdmin] >= 1)
- {
- new string3g[256];
- format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
- DodajWarnRed(string3g);
- format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
- DodajWarnRed(string3g);
- format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
- DodajWarnRed(string3g);
- format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
- DodajWarnRed(string3g);
- format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
- DodajWarnRed(string3g);
- format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
- DodajWarnRed(string3g);
- format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
- DodajWarnRed(string3g);
- format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
- DodajWarnRed(string3g);
- new string[70];
- format(string,sizeof(string), ""C_CRVENA"AdmCmd: "C_BELA"%s je ocistio ALT CHAT!", Ime_Igraca(playerid));
- AdminPoruka(-1,string);
- }
- else
- {
- Ovlascenje(playerid);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement