Advertisement
Guest User

Lorenc tools

a guest
Aug 10th, 2010
1,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.24 KB | None | 0 0
  1. /* Lorenc tools by Lorenc */
  2.  
  3. #include <a_samp>
  4.  
  5. #define COLOR_LIGHT_GREEN 0x00D67EFF
  6. #define COLOR_BLUE 0x00B7FFFF
  7.  
  8. #define D1 1237
  9. #define D2 2352
  10. #define D3 2134
  11. #define D4 8472
  12.  
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n--------------------------------------");
  16.     print(" Lorenc Tools by Lorenc loaded.");
  17.     print("--------------------------------------\n");
  18.     return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23.     print("\n--------------------------------------");
  24.     print(" Lorenc Tools by Lorenc deloaded.");
  25.     print("--------------------------------------\n");
  26.     return 1;
  27. }
  28.  
  29.  
  30. public OnPlayerCommandText(playerid, cmdtext[])
  31. {
  32.     if (strcmp("/loptions", cmdtext, true, 10) == 0) {
  33.         if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You need to be a rcon admin to use this command.");
  34.         ShowPlayerDialog(playerid, D1, DIALOG_STYLE_LIST, "Lorenc's 3D Text, Map Icon & Pickup creator - Options", "Create a 3D Text here.\nCreate a Map Icon here\nCreate a pickup here", "Select", "Cancel");
  35.         return 1;
  36.     }
  37.     return 0;
  38. }
  39.  
  40.  
  41. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  42. {
  43.     if(dialogid == D1) {
  44.         if(response) {
  45.             if(listitem == 0) {
  46. /* 3D Text creator */
  47.                 ShowPlayerDialog(playerid,D2,DIALOG_STYLE_INPUT,"Lorenc's 3D Text creator","We will create a 3D text here but\nyou will need to input a message for the 3D Text.\n\nNote: The regular color that will be saved with this 3D Text is blue\nand the regular view distance is 20.","Accept","Decline");
  48.                 return 1;
  49.             }
  50.             if(listitem == 1) {
  51. /* Map icon maker */
  52.                 ShowPlayerDialog(playerid,D3,DIALOG_STYLE_INPUT,"Lorenc's Map Icon Creator","We will create the map icon here,\nhowever you will need to input a map icon id below:","Accept","Decline");
  53.                 return 1;
  54.             }
  55.             if(listitem == 2) {
  56. /* Pickup creator */
  57.                 ShowPlayerDialog(playerid,D4,DIALOG_STYLE_INPUT,"Lorenc's 3D Pickup creator","We will create the pickup here although\nyou will need to choose a pickup icon,\n\nList (Use numbers): \nHealth - 1240\nArmour - 1240\nInfo icon - 1239\nBlue house - 1272\nGreen house - 1273\nCash -1212\nAdrenaline - 1241\nBribe - 1247","Accept","Decline");
  58.                 return 1;
  59.             }
  60.             else
  61.                 {SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You have canceled");}
  62.         }
  63.     }
  64.     if(dialogid == D2) {
  65.         if(response) {
  66.             new string[126];
  67.             new Float:X, Float:Y, Float:Z;
  68.             GetPlayerPos(playerid, X, Y, Z);
  69.             format(string, sizeof string, "%s",inputtext);
  70.             Create3DTextLabel(string,COLOR_BLUE,X,Y,Z,20.0,0);
  71.             new File:pos = fopen("3DTexts.LTOOLS", io_append);
  72.             format(string, sizeof string, "Create3DTextLabel(\"%s\",0x00B7FFFF,%.2f, %.2f, %.2f,20.0,0); //3D Text created by Lorenc's 3D Text creator \r\n",inputtext, X, Y, Z);
  73.             fwrite(pos, string);
  74.             fclose(pos);
  75.             SendClientMessage(playerid, COLOR_LIGHT_GREEN, string);
  76.             SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Your 3D Text has been saved to 3DTexts.LTOOLS.");
  77.         }
  78.         else {
  79.             SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You have canceled");
  80.         }
  81.         return 1;
  82.     }
  83.     if(dialogid == D3) {
  84.         if(response) {
  85.             if(IsNumeric(inputtext)) {
  86.                 new string[126];
  87.                 new Float:X, Float:Y, Float:Z;
  88.                 GetPlayerPos(playerid, X, Y, Z);
  89.                 SetPlayerMapIcon( playerid, 46, X, Y, Z, strval(inputtext), 0 );
  90.                 new File:pos2 = fopen("MapIcons.LTOOLS", io_append);
  91.                 format(string, sizeof string, "SetPlayerMapIcon(playerid, 46, %.2f, %.2f, %.2f, %i, 0); //Map icon created by Lorenc's Map icon creator \r\n", X, Y, Z, strval(inputtext));
  92.                 fwrite(pos2, string);
  93.                 fclose(pos2);
  94.                 SendClientMessage(playerid, COLOR_LIGHT_GREEN, string);
  95.                 SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Map icon has been saved to the file MapIcons.LTOOLS.");
  96.             }
  97.             else {
  98.                 SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Numbers Only!");
  99.                 ShowPlayerDialog(playerid,D3,DIALOG_STYLE_INPUT,"Lorenc's Map Icon Creator","The map icon will be saved at this location\nhowever you will need to input a map icon id below:","Accept","Decline");
  100.             }
  101.         }
  102.         else {
  103.             SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You have canceled");
  104.         }
  105.         return 1;
  106.     }
  107.     if(dialogid == D4) {
  108.         if(response) {
  109.             if(IsNumeric(inputtext)) {
  110.                 new string[126];
  111.                 new Float:X, Float:Y, Float:Z;
  112.                 GetPlayerPos(playerid, X, Y, Z);
  113.                 AddStaticPickup(strval(inputtext), 1, X, Y, Z, 0);
  114.                 new File:pos3 = fopen("PickUps.LTOOLS", io_append);
  115.                 format(string, sizeof string, "AddStaticPickup(%i, 1, %.2f, %.2f, %.2f, 0); //Pickup created by Lorenc's pickup creator \r\n", strval(inputtext), X, Y, Z);
  116.                 fwrite(pos3, string);
  117.                 fclose(pos3);
  118.                 SendClientMessage(playerid, COLOR_LIGHT_GREEN, string);
  119.                 SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Pickup has been saved to PickUps.LTOOLS");
  120.             }
  121.             else {
  122.                 SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Numbers Only!");
  123.                 ShowPlayerDialog(playerid,D4,DIALOG_STYLE_INPUT,"Lorenc's 3D Pickup creator","We will create the pickup here although\nyou will need to choose a pickup icon,\n\nList (Use numbers): \nHealth - 1240\nArmour - 1240\nInfo icon - 1239\nBlue house - 1272\nGreen house - 1273\nCash -1212\nAdrenaline - 1241\nBribe - 1247","Accept","Decline");
  124.             }
  125.         }
  126.         else {
  127.             SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You have canceled");
  128.         }
  129.         return 1;
  130.     }
  131.     return 1;
  132. }
  133.  
  134.  
  135. stock IsNumeric(string[])
  136. {
  137.     for (new i = 0, j = strlen(string); i < j; i++) {
  138.         if (string[i] > '9' || string[i] < '0') return 0;
  139.     }
  140.     return 1;
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement