Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==================GrandMaster.pwn system poruka=====================//
- #include <a_samp>
- #include <zcmd>
- #define CRED "{FF0000}"
- #define CORANGE "{E68C0E}"
- #define CGREEN "{00FF00}"
- #undef MAX_PLAYERS
- #define MAX_PLAYERS (50)
- new
- Text:PBMsg[MAX_PLAYERS],
- TDBoxShown[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PBMsg[playerid] = TextDrawCreate(10.000000, 194.000000, "GrandMaster Poruke");
- TextDrawBackgroundColor(PBMsg[playerid], 255);
- TextDrawFont(PBMsg[playerid], 1);
- TextDrawLetterSize(PBMsg[playerid], 0.189999, 0.899999);
- TextDrawColor(PBMsg[playerid], -1);
- TextDrawSetOutline(PBMsg[playerid], 1);
- TextDrawSetProportional(PBMsg[playerid], 1);
- TextDrawUseBox(PBMsg[playerid], 1);
- TextDrawBoxColor(PBMsg[playerid], 69);
- TextDrawTextSize(PBMsg[playerid], 130.000000, 1.000000);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TextDrawHideForPlayer(playerid, PBMsg[playerid]);
- TextDrawDestroy(PBMsg[playerid]);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SendPBMsg(playerid, "~g~Dobro dosli na~n~nas server uzivajte!!~n~~n~~b~da zatvorite kucajte ~r~/zatvoriporuke!!!");
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- CMD:postaviporuku(playerid, params[])
- {
- if(isnull(params)) return SendClientMessage(playerid, -1, ""#CRED"Koristi: "#CGREEN"/postaviporuku [poruka]");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- SendPBMsg(i, params);
- }
- return 1;
- }
- CMD:sakrijporuke(playerid, params[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- TextDrawHideForAll(PBMsg[i]);
- TDBoxShown[i] = 0;
- }
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if((strfind(text[0], "Zatvori", true) != -1) && TDBoxShown[playerid] == 1)
- {
- TextDrawHideForPlayer(playerid, PBMsg[playerid]);
- TDBoxShown[playerid] = 0;
- printf("Igrac: %s(%d) je zatvorio poruke servera!", pName(playerid), playerid);
- return 0;
- }
- return 1;
- }
- stock SendPBMsg(iPlayer, iMsg[])
- {
- ChkColorTag(iMsg);
- TextDrawSetString(PBMsg[iPlayer], iMsg);
- TextDrawShowForPlayer(iPlayer, PBMsg[iPlayer]);
- TDBoxShown[iPlayer] = 1;
- return 1;
- }
- stock pName(iPlayer)
- {
- new
- iName[MAX_PLAYER_NAME];
- GetPlayerName(iPlayer, iName, sizeof(iName));
- return iName;
- }
- forward ChkColorTag(txtstr[]);
- public ChkColorTag(txtstr[])
- {
- new tag;
- new startpos;
- for(new i = 0; i < strlen(txtstr); i++)
- {
- switch (tag)
- {
- case 0:
- {
- if(txtstr[i] == '~')
- {
- tag = 1;
- startpos = i;
- }
- }
- case 1:
- {
- if(IsValidTagLetter(txtstr[i])) tag = 3;
- else tag = 4;
- }
- case 3:
- {
- if(txtstr[i] != '~') strdel(txtstr,startpos, startpos + 2);
- tag = 0;
- }
- case 4:
- {
- if(txtstr[i] == '~') strdel(txtstr, startpos, startpos + 3);
- else strdel(txtstr, startpos, startpos + 2);
- tag = 0;
- }
- }
- }
- return 1;
- }
- IsValidTagLetter(letter)
- {
- if(letter == 'r') return 1;
- if(letter == 'g') return 1;
- if(letter == 'b') return 1;
- if(letter == 'w') return 1;
- if(letter == 'y') return 1;
- if(letter == 'p') return 1;
- if(letter == 'l') return 1;
- if(letter == '<') return 1;
- if(letter == '>') return 1;
- return 0;
- }
- //==Vilage Rebirth Uskoro....
- // posjetite nas forum [www.village-rebirth.info]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement