LoriYagami

H-Pickup 1.2 English

Jan 30th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.27 KB | None | 0 0
  1. //===============================================================================
  2. //|                 This Script Originaly Made by Haikal Bintang                |
  3. //===============================================================================
  4.  
  5. #include <a_samp>
  6. #include <zcmd>
  7. #include <mSelection>
  8.  
  9. #define DIALOG_PICKUP_TEXT 9999
  10.  
  11. new pickuptext[256];
  12. new pickuplist = mS_INVALID_LISTID;
  13.  
  14. public OnFilterScriptInit()
  15. {
  16.     pickuplist = LoadModelSelectionMenu("pickup.txt");
  17.     print("H-Pickup created by Haikal Bintang.");
  18.     return 1;
  19. }
  20.  
  21. public OnPlayerModelSelection(playerid, response, listid, modelid)
  22. {
  23.     new string[256], Float:X, Float:Y, Float:Z;
  24.     if((listid == pickuplist) && response)
  25.     {
  26.         GetPlayerPos(playerid, X, Y, Z);
  27.  
  28.         new File:pos=fopen("createdpickup.txt", io_append);
  29.         format(string, 256, "CreatePickup(%i, 23, %f, %f, %f, %i)\r\n",  modelid, X, Y, Z, GetPlayerVirtualWorld(playerid));
  30.         fwrite(pos, string);
  31.         format(string, 256, "Create3DTextLabel(%s, 0xFFFFFFAA, %f, %f, %f, 5.0, %i)\r\n", pickuptext, X, Y, Z+0.50, GetPlayerVirtualWorld(playerid));
  32.         fwrite(pos, string);
  33.         fclose(pos);
  34.         CreatePickup(modelid, 23, X, Y, Z, GetPlayerVirtualWorld(playerid));
  35.         Create3DTextLabel(pickuptext, 0xFFFFFFAA, X, Y, Z+0.50, 5.0, GetPlayerVirtualWorld(playerid));
  36.         SendClientMessage(playerid, -1, "{FFFFFF}Pickup created, all the pickup will be saved in scriptfiles -> createdpickup.txt.");
  37.         SendClientMessage(playerid, -1, "{FFFFFF}Type /createpickup to make an pickup.");
  38.     }
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerSpawn(playerid)
  43. {
  44.     SendClientMessage(playerid, -1, "{FFFFFF}Type /createpickup to make an pickup.");
  45.     return 1;
  46. }
  47.  
  48. CMD:createpickup(playerid, params[])
  49. {
  50.     ShowPlayerDialog(playerid, DIALOG_PICKUP_TEXT, DIALOG_STYLE_INPUT, "Pickup Text", "Enter the pickup text below :\nFor example In-Game [Press [ENTER] untuk get in]", "Create", "Cancel");
  51.     return 1;
  52. }
  53.  
  54. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  55. {
  56.     if(dialogid == DIALOG_PICKUP_TEXT)
  57.     {
  58.         if(response)
  59.         {
  60.             format(pickuptext, sizeof(pickuptext), "%s", inputtext);
  61.             ShowModelSelectionMenu(playerid, pickuplist, "Select the Pickup Models");
  62.         }
  63.     }
  64.     return 0;
  65. }
Add Comment
Please, Sign In to add comment