Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===========================
- // * * |
- // * * |
- // * * |
- // ** Box |
- // * * |
- // * * |
- // * * |
- // |
- // Dont NOT Re-Upload it |
- // Do not Remove the credits |
- // By XtremeR |
- //===========================
- #include <a_samp>
- #include <zcmd>
- //new textdraws
- new Text:XMsg[15];
- new XMsgStr[15][128];
- new Text:Textdraw0;
- main()
- {
- print("\n--------------------------------------------------------");
- print(" XBox By XtremeR");
- print("--------------------------------------------------------\n");
- }
- public OnFilterScriptInit()
- {
- print("-----------------------------");
- print("X - Box By XtremeR Loaded !");
- print("-----------------------------");
- for(new line; line<15; line++)
- {
- format(XMsgStr[line], 128, " ");
- }
- XMsg[1] = TextDrawCreate(365, 342+38, XMsgStr[1]);
- XMsg[2] = TextDrawCreate(365, 349+38, XMsgStr[2]);
- XMsg[3] = TextDrawCreate(365, 356+38, XMsgStr[3]);
- XMsg[4] = TextDrawCreate(365, 363+38, XMsgStr[4]);
- XMsg[5] = TextDrawCreate(365, 370+38, XMsgStr[5]);
- XMsg[6] = TextDrawCreate(365, 377+38, XMsgStr[6]);
- XMsg[7] = TextDrawCreate(365, 384+38, XMsgStr[7]);
- XMsg[8] = TextDrawCreate(365, 391+38, XMsgStr[8]);
- XMsg[9] = TextDrawCreate(365, 398+38, XMsgStr[9]);
- for(new line; line<15; line++)
- {
- TextDrawLetterSize(XMsg[line], 0.40, 0.90);
- TextDrawSetShadow(XMsg[line], 0);
- TextDrawAlignment(XMsg[line], 1);
- TextDrawFont(XMsg[line], 1);
- TextDrawShowForAll(XMsg[line]);
- }
- for(new line; line<15; line++)
- {
- TextDrawLetterSize(XMsg[line], 0.28, 0.83);
- TextDrawSetShadow(XMsg[line], 0);
- TextDrawAlignment(XMsg[line], 1);
- TextDrawTextSize(XMsg[line], 640, 480);
- TextDrawBoxColor(XMsg[line], 0x000000FF);
- TextDrawFont(XMsg[line], 1);
- TextDrawSetOutline(XMsg[line], 1);
- TextDrawShowForAll(XMsg[line]);
- }
- for(new i; i < MAX_PLAYERS; i ++)
- {
- if(IsPlayerConnected(i))
- {
- TextDrawShowForPlayer(i, Textdraw0);
- }
- }
- Textdraw0 = TextDrawCreate(642.000000, 373.000000, " ");
- TextDrawBackgroundColor(Textdraw0, 255);
- TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
- TextDrawSetOutline(Textdraw0, 0);
- TextDrawSetProportional(Textdraw0, 1);
- TextDrawSetShadow(Textdraw0, 1);
- TextDrawUseBox(Textdraw0, 1);
- TextDrawBoxColor(Textdraw0, 0x00000033);
- TextDrawTextSize(Textdraw0, 357.000000, 0.000000);
- return 1;
- }
- public OnFilterScriptExit()
- {
- TextDrawHideForAll(Textdraw0);
- TextDrawDestroy(Textdraw0);
- for(new line; line<15; line++)
- {
- TextDrawDestroy(XMsg[line]);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawShowForPlayer(playerid, Textdraw0);
- for(new line; line<15; line++)
- {
- TextDrawShowForPlayer(playerid, XMsg[line]);
- }
- //sending Box a MSG when some one joins
- new string[64], pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string,sizeof string,"~g~%s has joined the server.",pName);
- SendXMessage(playerid, string);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- //sending Box a MSG When someone Leaves
- new string1[64], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- switch(reason)
- {
- case 0: format(string1,sizeof string1,"~r~%s has left the server. [Timed out]",name);//timeout
- case 1: format(string1,sizeof string1,"~r~%s has left the server. [Leaving]",name);//leaving
- case 2: format(string1,sizeof string1,"~r~%s has left the server. [Kicked/Banned]",name);//kicked or banned
- }
- SendXMessage(playerid, string1);
- return 1;
- }
- CMD:box(playerid,params[]) {
- #pragma unused params
- IsPlayerAdmin(playerid);
- if(isnull(params)) return SendClientMessage(playerid,0xBD34DAFF,"Current Usage: /boxchat [text]");
- SendClientMessage(playerid,0x20B2AAFF,"Message Sended!");
- new string[128],name[24];
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string),"Admin %s[ID:%i]: %s",name,playerid,params);
- SendXMessage(playerid,string);
- return 1;
- }
- CMD:abox(playerid,params[]) {
- #pragma unused params
- IsPlayerAdmin(playerid);
- if(isnull(params)) return SendClientMessage(playerid,0xBD34DAFF,"Current Usage: /boxchat [text]");
- SendClientMessage(playerid,0x20B2AAFF,"Message Sended!");
- new string[128],name[24];
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string),"%s",params);
- SendXMessage(playerid,string);
- return 1;
- }
- CMD:clearbox(playerid,params[]) {
- #pragma unused params
- IsPlayerAdmin(playerid);
- SendXMessage(playerid," ");
- SendXMessage(playerid," ");
- SendXMessage(playerid," ");
- SendXMessage(playerid," ");
- SendXMessage(playerid," ");
- SendXMessage(playerid," ");
- SendXMessage(playerid," ");
- SendXMessage(playerid," ");
- SendXMessage(playerid," ");
- return 1;
- }
- stock SendXMessage(playerid, const text[])
- {
- for(new line; line < 15; line++)
- {
- TextDrawShowForPlayer(playerid, XMsg[line]);//show the lines
- }
- for(new line; line < 15; line++)
- {
- TextDrawHideForAll(XMsg[line]);//hide the line
- if(line < 14)
- {
- XMsgStr[line] = XMsgStr[line+1];//Message going up ^
- TextDrawSetString(XMsg[line], XMsgStr[line]);
- }
- }
- format(XMsgStr[9], 128, "%s",text);//Message !
- TextDrawSetString(XMsg[9], XMsgStr[9]);//Start fron Line 9
- for(new line; line < 15; line++) // goes up
- {
- TextDrawShowForAll(XMsg[line]);//TextDraw show for player
- }
- return 1;
- }
- //ALL BY XTREMER!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement