Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Commands TextDraw by CaptainJohn.
- // When you bring up a TextDraw just LMB (Left Mouse Button) click to close the TextDraw.
- // Feel free to edit.
- #include <a_samp>
- // Colours
- #define RED 0xE60000FF
- // TextDraw Variables
- new Text:CMDText;
- new Text:CMDText2;
- new Text:CMDTextR1;
- new Text:CMDTextR2;
- new Text:CMDTextR3;
- new Text:CMDTextR4;
- new Text:CMDTextR5;
- // Variable that allows you to open a another TextDraw when you type a number in.
- new OnCommandList[MAX_PLAYERS];
- public OnGameModeInit()
- {
- // Textdraws
- CMDText2=TextDrawCreate(130.000000, 120.000000, "CJWOF Commands");
- TextDrawAlignment(CMDText2, 2);
- TextDrawBoxColor(CMDText2, 0x000000FF);
- TextDrawColor(CMDText2, RED);
- TextDrawFont(CMDText2, 3);
- TextDrawTextSize(CMDText2, 20.000000, 210.000000);
- TextDrawUseBox(CMDText2, 1);
- CMDText=TextDrawCreate(25.000000, 135.000000, "Commands:~N~~N~ ~G~1. ~Y~General Commands~N~ ~G~2. ~Y~DM Zones~N~ ~G~3. ~Y~Stunt Zones~N~ ~G~4. ~Y~Houses~N~ ~G~5. ~Y~Other");
- TextDrawAlignment(CMDText, 1);
- TextDrawBoxColor(CMDText, 0x00000055);
- TextDrawFont(CMDText, 1);
- TextDrawLetterSize(CMDText, 0.250000, 0.900000);
- TextDrawSetShadow(CMDText, 0);
- TextDrawSetOutline(CMDText, 1);
- TextDrawTextSize(CMDText, 235.000000, 20.000000);
- TextDrawUseBox(CMDText, 1);
- CMDTextR1=TextDrawCreate(25.000000, 135.000000, "General Commands:~N~~N~ ~G~- ~Y~/teleports~N~ ~G~- ~Y~/stunts~N~ ~G~- ~Y~/dm~N~ ~G~- ~Y~/events~N~ ~G~- ~Y~/style~N~ ~G~- ~Y~/hit");
- TextDrawAlignment(CMDTextR1, 1);
- TextDrawBoxColor(CMDTextR1, 0x00000055);
- TextDrawFont(CMDTextR1, 1);
- TextDrawLetterSize(CMDTextR1, 0.250000, 0.900000);
- TextDrawSetShadow(CMDTextR1, 0);
- TextDrawSetOutline(CMDTextR1, 1);
- TextDrawTextSize(CMDTextR1, 235.000000, 20.000000);
- TextDrawUseBox(CMDTextR1, 1);
- CMDTextR2=TextDrawCreate(25.000000, 135.000000, "DM Zone Commands:~N~~N~ ~G~- ~Y~/dm1~N~ ~G~- ~Y~/dm2~N~ ~G~- ~Y~/dm3~N~ ~G~- ~Y~/dm4~N~ ~G~- ~Y~/dm5~N~ ~G~- ~Y~/dm6~N~ ~G~- ~Y~/dm7~N~ ~G~- ~Y~/dm8~N~ ~G~- ~Y~/sniper~N~ ~G~- ~Y~/deagle~N~ ~G~- ~Y~/jdm");
- TextDrawAlignment(CMDTextR2, 1);
- TextDrawBoxColor(CMDTextR2, 0x00000055);
- TextDrawFont(CMDTextR2, 1);
- TextDrawLetterSize(CMDTextR2, 0.250000, 0.900000);
- TextDrawSetShadow(CMDTextR2, 0);
- TextDrawSetOutline(CMDTextR2, 1);
- TextDrawTextSize(CMDTextR2, 235.000000, 20.000000);
- TextDrawUseBox(CMDTextR2, 1);
- CMDTextR3=TextDrawCreate(25.000000, 135.000000, "Stunt Zone Commands:~N~~N~ ~G~- ~Y~/s1~N~ ~G~- ~Y~/s2~N~ ~G~- ~Y~/s3~N~ ~G~- ~Y~/s4~N~ ~G~- ~Y~/s5~N~ ~G~- ~Y~/s6~N~ ~G~- ~Y~/s7~N~ ~G~- ~Y~/s8~N~ ~G~- ~Y~/s9~N~ ~G~- ~Y~/s10~N~ ~G~- ~Y~/s11");
- TextDrawAlignment(CMDTextR3, 1);
- TextDrawBoxColor(CMDTextR3, 0x00000055);
- TextDrawFont(CMDTextR3, 1);
- TextDrawLetterSize(CMDTextR3, 0.250000, 0.900000);
- TextDrawSetShadow(CMDTextR3, 0);
- TextDrawSetOutline(CMDTextR3, 1);
- TextDrawTextSize(CMDTextR3, 235.000000, 20.000000);
- TextDrawUseBox(CMDTextR3, 1);
- CMDTextR4=TextDrawCreate(25.000000, 135.000000, "House Commands:~N~~N~ ~G~- ~Y~/buyhouse~N~ ~G~- ~Y~/housemenu~N~ ~G~- ~Y~/gohome~N~ ~G~- ~Y~/exithouse");
- TextDrawAlignment(CMDTextR4, 1);
- TextDrawBoxColor(CMDTextR4, 0x00000055);
- TextDrawFont(CMDTextR4, 1);
- TextDrawLetterSize(CMDTextR4, 0.250000, 0.900000);
- TextDrawSetShadow(CMDTextR4, 0);
- TextDrawSetOutline(CMDTextR4, 1);
- TextDrawTextSize(CMDTextR4, 235.000000, 20.000000);
- TextDrawUseBox(CMDTextR4, 1);
- CMDTextR5=TextDrawCreate(25.000000, 135.000000, "Other Commands:~N~~N~ ~G~- ~Y~/carcolour~N~ ~G~- ~Y~/saveplace~N~ ~G~- ~Y~/gotoplace");
- TextDrawAlignment(CMDTextR5, 1);
- TextDrawBoxColor(CMDTextR5, 0x00000055);
- TextDrawFont(CMDTextR5, 1);
- TextDrawLetterSize(CMDTextR5, 0.250000, 0.900000);
- TextDrawSetShadow(CMDTextR5, 0);
- TextDrawSetOutline(CMDTextR5, 1);
- TextDrawTextSize(CMDTextR5, 235.000000, 20.000000);
- TextDrawUseBox(CMDTextR5, 1);
- return 1;
- }
- public OnGameModeExit()
- {
- TextDrawDestroy(CMDText);
- TextDrawDestroy(CMDText2);
- TextDrawDestroy(CMDTextR1);
- TextDrawDestroy(CMDTextR2);
- TextDrawDestroy(CMDTextR3);
- TextDrawDestroy(CMDTextR4);
- TextDrawDestroy(CMDTextR5);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(OnCommandList[playerid] == 1)
- {
- if(strval(text) == 1)
- {
- OnCommandList[playerid]=0;
- TextDrawHideForPlayer(playerid,CMDText);
- TextDrawShowForPlayer(playerid, CMDTextR1);
- return 0;
- }
- if(strval(text) == 2)
- {
- OnCommandList[playerid]=0;
- TextDrawHideForPlayer(playerid,CMDText);
- TextDrawShowForPlayer(playerid, CMDTextR2);
- return 0;
- }
- if(strval(text) == 3)
- {
- OnCommandList[playerid]=0;
- TextDrawHideForPlayer(playerid,CMDText);
- TextDrawShowForPlayer(playerid, CMDTextR3);
- return 0;
- }
- if(strval(text) == 4)
- {
- OnCommandList[playerid]=0;
- TextDrawHideForPlayer(playerid,CMDText);
- TextDrawShowForPlayer(playerid, CMDTextR4);
- return 0;
- }
- if(strval(text) == 5)
- {
- OnCommandList[playerid]=0;
- TextDrawHideForPlayer(playerid,CMDText);
- TextDrawShowForPlayer(playerid, CMDTextR5);
- return 0;
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if((strcmp("/cmds", cmdtext, true) == 0) || (strcmp("/commands", cmdtext, true) == 0))
- {
- OnCommandList[playerid]=1;
- TextDrawHideForPlayer(playerid,CMDTextR1);
- TextDrawHideForPlayer(playerid,CMDTextR2);
- TextDrawHideForPlayer(playerid,CMDTextR3);
- TextDrawHideForPlayer(playerid,CMDTextR4);
- TextDrawHideForPlayer(playerid,CMDTextR5);
- TextDrawHideForPlayer(playerid,CMDText);
- TextDrawHideForPlayer(playerid,CMDText2);
- TextDrawShowForPlayer(playerid,CMDText);
- TextDrawShowForPlayer(playerid,CMDText2);
- return 1;
- }
- return 0;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_FIRE)
- {
- TextDrawHideForPlayer(playerid,CMDText);
- TextDrawHideForPlayer(playerid,CMDText2);
- TextDrawHideForPlayer(playerid,CMDTextR1);
- TextDrawHideForPlayer(playerid,CMDTextR2);
- TextDrawHideForPlayer(playerid,CMDTextR3);
- TextDrawHideForPlayer(playerid,CMDTextR4);
- TextDrawHideForPlayer(playerid,CMDTextR5);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment