Advertisement
Johurt

[FS] jAO

Sep 15th, 2013
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.75 KB | None | 0 0
  1. /*
  2.         jAO by Johurt(ES.^, Edgar).
  3. */
  4. #include <a_samp>
  5. #include <sscanf2>
  6.  
  7. new bool:Object[MAX_PLAYERS];
  8.  
  9. public OnPlayerConnect(playerid)
  10. {
  11.     Object[playerid] = false;
  12.     return 1;
  13. }
  14.  
  15. public OnPlayerCommandText(playerid, cmdtext[])
  16. {
  17.     if(!strcmp("/edit", cmdtext, true, 5))
  18.     {
  19.         if(Object[playerid] == false)
  20.         {
  21.             ShowPlayerDialog(playerid, 55, DIALOG_STYLE_INPUT, "Editor", "{ffffff}Iraðyk objekto ID ir kuno dalies ID:", "Rinktis", "Uþdaryti");
  22.         }
  23.         else
  24.         {
  25.             EditAttachedObject(playerid, 0);
  26.         }
  27.         return 1;
  28.     }
  29.     return 0;
  30. }
  31.  
  32. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  33. {
  34.     if(dialogid == 55)
  35.     {
  36.         if(response)
  37.         {
  38.             new objID, boneID, Float:pPos[3];
  39.             if(sscanf(inputtext, "dd", objID, boneID)) return ShowPlayerDialog(playerid, 55, DIALOG_STYLE_INPUT, "Editor", "{ffffff}Iraðyk objekto ID ir kuno dalies ID:", "Rinktis", "Uþdaryti");
  40.             GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
  41.             SetPlayerAttachedObject(playerid, 0, objID, boneID);
  42.             EditAttachedObject(playerid, 0);
  43.             Object[playerid] = true;
  44.         }
  45.     }
  46.     return 1;
  47. }
  48.  
  49. stock IsNumeric(const string[]) // Mike
  50. {
  51.     for(new i = 0, j = strlen(string); i < j; i++) if(string[i] > '9' || string[i] < '0') return 0;
  52.     return 1;
  53. }
  54.  
  55. public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  56. {
  57.     new string[256];
  58.     format(string, sizeof(string), "SetPlayerAttachedObject(playerid, %d, %d, %d, %.4f, %.4f, %.4f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)", index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  59.     printf(string);
  60.     return 1;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement