Advertisement
dh240473

[Filterscript]Dh240473 Object Editor

Jan 10th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 38.62 KB | None | 0 0
  1. //============================================================================//
  2. //  Credits:
  3. //  Zeex = ZCMD Include
  4. //  Y_Less = Y_Timers Include
  5. //  OArray = ArYzal
  6. //  Draco = Dini
  7. //  Incognito = Streamer
  8. //  Emmet_ = SScanf2
  9. //  Garsino = Making This FS
  10. //  DH240473 = Edit This FS
  11. //============================================================================//
  12. //============================================================================//
  13. //     Include
  14. //============================================================================//
  15. #include <a_samp>
  16. #include <sscanf2>
  17. #include <streamer>
  18. #include <YSI\y_timers>
  19. #include <dini>
  20. #include <zcmd>
  21. #include <oarray>
  22. //============================================================================//
  23. //       Define
  24. //============================================================================//
  25. #define GOBJ_MAX_OBJECTS_CREATED    1000
  26. #define G_OBJ_DID                   12357
  27. #define MappingFiles                "Maps/%s.ini"
  28. #define SaveFiles                   "Maps/%s.txt"
  29. #define Loop(%0,%1) for(new %0 = 0; %0 < %1; %0++)
  30. //============================================================================//
  31. //         New Stuff                                                          //
  32. //============================================================================//
  33. new Objects[MAX_PLAYERS][GOBJ_MAX_OBJECTS_CREATED],
  34.     ObjectCreator[MAX_OBJECTS];
  35.  
  36. new Float:oOffset[MAX_OBJECTS][3],                  Float:oRot[MAX_OBJECTS][3],
  37.     Float:oPos[MAX_OBJECTS][3],                           ModelID[MAX_OBJECTS],
  38.     ML[MAX_PLAYERS],                                bool:xonsudah[MAX_PLAYERS],
  39.     Timer:jajatimerlala[MAX_PLAYERS],                    lelpcout[MAX_PLAYERS],
  40.     diadaadaindicator[MAX_PLAYERS];
  41.  
  42. new PlayerText:IO[12][MAX_PLAYERS];
  43.  
  44. new Float:X,
  45.     Float:Y,
  46.     Float:Z;
  47. //============================================================================//
  48. //    Color
  49. //============================================================================//
  50. #define COLOUR_INFO                     0x00FFFFFF
  51. #define COLOUR_SYSTEM                   0xB60000FF
  52. //============================================================================//
  53. public OnFilterScriptInit()
  54. {
  55.     Loop(obj, MAX_OBJECTS)
  56.     {
  57.         ObjectCreator[obj] = INVALID_PLAYER_ID;
  58.         ModelID[obj] = -1;
  59.     }
  60.     Loop(i, MAX_PLAYERS)
  61.     {
  62.         Loop(o, GOBJ_MAX_OBJECTS_CREATED)
  63.         {
  64.             Objects[i][o] = INVALID_OBJECT_ID;
  65.         }
  66.     }
  67.     print("\n>> DH240473 Object Creator Loaded <<\n");
  68.     return 1;
  69. }
  70. //============================================================================//
  71. public OnFilterScriptExit()
  72. {
  73.     Loop(obj, MAX_OBJECTS)
  74.     {
  75.         if(ObjectCreator[obj] != INVALID_PLAYER_ID && ModelID[obj] != -1)
  76.         {
  77.             DestroyObject(obj);
  78.             ModelID[obj] = -1;
  79.         }
  80.     }
  81.     print("\n>> DH240473 Object Creator Unloaded <<\n");
  82.     return 1;
  83. }
  84. //============================================================================//
  85. public OnPlayerConnect(playerid)
  86. {
  87.     new file[MAX_PLAYERS];
  88.     format(file, sizeof(file), MappingFiles, pnama(playerid));
  89.     if(!fexist(file))
  90.     {
  91.     dini_Create(file);
  92.     dini_IntSet(file, "ML", 0);
  93.     ML[playerid] = dini_Int(file, "ML");
  94.     } else {
  95.     ML[playerid] = dini_Int(file, "ML");
  96.     }
  97.     Loop(o, GOBJ_MAX_OBJECTS_CREATED)
  98.     {
  99.         Objects[playerid][o] = INVALID_OBJECT_ID;
  100.     }
  101.     destroyobjindicator(playerid);
  102.     diadaadaindicator[playerid] = 0;
  103.     return 1;
  104. }
  105. public OnPlayerDisconnect(playerid, reason)
  106. {
  107.     new file[MAX_PLAYERS];
  108.     format(file, sizeof(file), MappingFiles, pnama(playerid));
  109.     dini_IntSet(file, "ML", ML[playerid]);
  110.     ML[playerid] = 0;
  111.     destroyobjindicator(playerid);
  112.     if(xonsudah[playerid] == true) stop jajatimerlala[playerid];
  113.     lelpcout[playerid] = 0;
  114.     diadaadaindicator[playerid] = 0;
  115.     Loop(o, MAX_OBJECTS)
  116.     {
  117.         if(ObjectCreator[o] == playerid)
  118.         {
  119.             if(ModelID[o] != -1)
  120.             {
  121.                 DestroyObject(o);
  122.                 ModelID[o] = -1;
  123.             }
  124.             ObjectCreator[o] = INVALID_PLAYER_ID;
  125.         }
  126.     }
  127.     Loop(o2, GOBJ_MAX_OBJECTS_CREATED)
  128.     {
  129.         Objects[playerid][o2] = INVALID_OBJECT_ID;
  130.     }
  131.     return 1;
  132. }
  133. public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
  134. {
  135.     GetObjectPos(objectid, oPos[objectid][0], oPos[objectid][1], oPos[objectid][2]);
  136.     GetObjectRot(objectid, oRot[objectid][0], oRot[objectid][1], oRot[objectid][2]);
  137.     if(!IsValidObject(objectid)) return 0;
  138.     MoveObject(objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
  139.     SetObjectPos(objectid, fX, fY, fZ);
  140.     SetObjectRot(objectid, fRotX, fRotY, fRotZ);
  141.     if(response == EDIT_RESPONSE_FINAL)
  142.     {
  143.         SetObjectPos(objectid, fX, fY, fZ);
  144.         SetObjectRot(objectid, fRotX, fRotY, fRotZ);
  145.         oPos[objectid][0] = fX;
  146.         oPos[objectid][1] = fY;
  147.         oPos[objectid][2] = fZ;
  148.         oRot[objectid][0] = fRotX;
  149.         oRot[objectid][1] = fRotY;
  150.         oRot[objectid][2] = fRotZ;
  151.         SendClientMessage(playerid, 0x00FFFFFF, "Object's position and rotation saved.");
  152.         new obj = GetFreeObjectID(playerid);
  153.         DestroyObject(ObjectCreator[playerid]);
  154.         Objects[playerid][obj] = CreateObject(obj, oPos[objectid][0], oPos[objectid][1], oPos[objectid][2], oRot[objectid][0], oRot[objectid][1], oRot[objectid][2],0);
  155.     }
  156.     return 1;
  157. }
  158.  
  159. CMD:editobject(playerid,params[])
  160. {
  161.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  162.     {
  163.         new objectid, string[MAX_PLAYERS];
  164.         if(sscanf(params,"i",objectid)) return SendClientMessage(playerid,COLOUR_SYSTEM,"USAGE: /eo [objectid]");
  165.         if(objectid < 1 || objectid >= GOBJ_MAX_OBJECTS_CREATED-1 || Objects[playerid][objectid] == INVALID_OBJECT_ID) return SendClientMessage(playerid, COLOUR_SYSTEM, "Invalid object ID!");
  166.         new obj = Objects[playerid][objectid];
  167.         EditObject(playerid, obj);
  168.         GetObjectPos(objectid, oPos[objectid][0], oPos[objectid][1], oPos[objectid][2]);
  169.         format(string, sizeof(string), "You Have Choose ObjectID %d To Edit", objectid);
  170.         SendClientMessage(playerid, -1, string);
  171.     }
  172.     return 1;
  173. }
  174.  
  175. CMD:createobject(playerid, params[])
  176. {
  177.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  178.     {
  179.         new modelid, Float:rX, Float:rY, Float:rZ, string[128], objid = GetFreeObjectID(playerid);
  180.         if(sscanf(params, "dF(0)F(0)F(0)", modelid, rX, rY, rZ)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /createobject (object id) (rotX) (rotY) (rotZ)");
  181.         if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT && !IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOUR_SYSTEM, "You need to spawn to be able to use this command.");
  182.         if(GetTotalNativeObjects() >= (MAX_OBJECTS-1)) return SendClientMessage(playerid, COLOUR_SYSTEM, "The SA:MP object limit has been reached. You can not spawn any more objects.");
  183.         if(objid < 1)  return SendClientMessage(playerid, COLOUR_SYSTEM, "You can not spawn any more objects. Please delete one of the current ones first.");
  184.         if(modelid == 614) return SendClientMessage(playerid,COLOUR_SYSTEM,"Error: Bad Object !");
  185.         if(modelid == 1225) return SendClientMessage(playerid,COLOUR_SYSTEM,"Error: Bad Object !");
  186.         if(modelid == 18863) return SendClientMessage(playerid,COLOUR_SYSTEM,"Error: Bad Object !");
  187.         if(modelid == 18864) return SendClientMessage(playerid,COLOUR_SYSTEM,"Error: Bad Object !");
  188.         else
  189.         {
  190.             GetPlayerPos(playerid, X, Y, Z);
  191.             Objects[playerid][objid] = CreateObject(modelid, X, Y, Z, rX, rY, rZ);
  192.             new o = Objects[playerid][objid];
  193.             ModelID[o] = modelid;
  194.             ObjectCreator[o] = playerid;
  195.             oPos[o][0] = X, oPos[o][1] = Y, oPos[o][2] = Z;
  196.             oRot[o][0] = rX, oRot[o][1] = rY, oRot[o][2] = rZ;
  197.             format(string, sizeof(string), "Object ID %d created. Modelid: %d. Rotation: X: %0.2f | Y: %0.2f | Z: %0.2f.", objid, modelid, rX, rY, rZ);
  198.             SendClientMessage(playerid, COLOUR_INFO, string);
  199. //            format(string, sizeof(string), "[ Object ID: %d ]|[ Model ID: %d ]", objid, modelid);
  200. //          oText[objid] = CreateDynamic3DTextLabel(string, -1, X, Y, Z, 10);
  201.         }
  202.         return 1;
  203.     }
  204.     else return 0;
  205. }
  206. CMD:copyobject(playerid, params[])
  207. {
  208.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  209.     {
  210.         new string[128], objectid, objid = GetFreeObjectID(playerid);
  211.         if(sscanf(params, "d", objectid)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /copyobject (objectid)");
  212.         if(GetTotalNativeObjects() >= (MAX_OBJECTS-1)) return SendClientMessage(playerid, COLOUR_SYSTEM, "The SA:MP object limit has been reached. You can not spawn any more objects.");
  213.         if(objid < 1) return SendClientMessage(playerid, COLOUR_SYSTEM, "You can not spawn any more objects. Please delete one of the current ones first.");
  214.         else
  215.         {
  216.             new o2 = Objects[playerid][objectid];
  217.             Objects[playerid][objid] = CreateObject(ModelID[o2], oPos[o2][0], oPos[o2][1], oPos[o2][2], oRot[o2][0], oRot[o2][1], oRot[o2][2]);
  218.             new o = Objects[playerid][objid];
  219.             ModelID[o] = ModelID[o2];
  220.             ObjectCreator[o] = playerid;
  221.             oPos[o][0] = oPos[o2][0], oPos[o][1] = oPos[o2][1], oPos[o][2] = oPos[o2][2];
  222.             oRot[o][0] = oRot[o2][0], oRot[o][1] = oRot[o2][1], oRot[o][2] = oRot[o2][2];
  223.             format(string, sizeof(string), "Object ID %d copied. Object ID for the copied object is %d.", objectid, objid);
  224.             SendClientMessage(playerid, COLOUR_INFO, string);
  225. //            format(string, sizeof(string), "[ Object ID: %d ]|[ Model ID: %d ]", objid, ModelID[o2]);
  226. //          oText[objid] = CreateDynamic3DTextLabel(string, -1, X, Y, Z, 10);
  227.         }
  228.         return 1;
  229.     }
  230.     else return 0;
  231. }
  232. CMD:rotateobject(playerid, params[])
  233. {
  234.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  235.     {
  236.         new objectid, Float:rX, Float:rY, Float:rZ, string[128];
  237.         if(sscanf(params, "dF(0)F(0)F(0)", objectid, rX, rY, rZ)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /rotateobject (object id) (rotX) (rotY) (rotZ)");
  238.         if(objectid < 1 || objectid >= GOBJ_MAX_OBJECTS_CREATED-1 || Objects[playerid][objectid] == INVALID_OBJECT_ID) return SendClientMessage(playerid, COLOUR_SYSTEM, "Invalid object ID!");
  239.         else
  240.         {
  241.             if(ObjectCreator[Objects[playerid][objectid]] == playerid)
  242.             {
  243.                 new o = Objects[playerid][objectid];
  244.                 SetObjectRot(o, rX, rY, rZ);
  245.                 oRot[o][0] = rX, oRot[o][1] = rY, oRot[o][2] = rZ;
  246.                 format(string, sizeof(string), "Object ID %d rotated. New rotation: X: %0.2f | Y: %0.2f | Z: %0.2f.", objectid, rX, rY, rZ);
  247.                 SendClientMessage(playerid, COLOUR_INFO, string);
  248.             }
  249.         }
  250.         return 1;
  251.     }
  252.     else return 0;
  253. }
  254.  
  255. CMD:rotateallobject(playerid, params[])
  256. {
  257.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  258.     {
  259.         new Float:rX, Float:rY, Float:rZ, string[128];
  260.         if(sscanf(params, "F(0)F(0)F(0)", rX, rY, rZ)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /rotateallobject (rotX) (rotY) (rotZ)");
  261.         else
  262.         {
  263.             Loop(o, MAX_OBJECTS)
  264.             {
  265.                 if(ObjectCreator[o] == playerid)
  266.                 {
  267.                     SetObjectRot(o, rX, rY, rZ);
  268.                     oRot[o][0] = rX, oRot[o][1] = rY, oRot[o][2] = rZ;
  269.                 }
  270.             }
  271.             format(string, sizeof(string), "All of your objects have been rotated. New rotation: X: %0.2f | Y: %0.2f | Z: %0.2f.", rX, rY, rZ);
  272.             SendClientMessage(playerid, COLOUR_INFO, string);
  273.         }
  274.         return 1;
  275.     }
  276.     else return 0;
  277. }
  278.  
  279. CMD:destroyobject(playerid, params[])
  280. {
  281.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  282.     {
  283.         new objectid, string[128];
  284.         if(sscanf(params, "d", objectid)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /destroyobjectGetPlayerVehicleID() (object id)");
  285.         if(objectid < 1 || objectid >= GOBJ_MAX_OBJECTS_CREATED-1 || Objects[playerid][objectid] == INVALID_OBJECT_ID) return SendClientMessage(playerid, COLOUR_SYSTEM, "Invalid object ID!");
  286.         else
  287.         {
  288.             if(ObjectCreator[Objects[playerid][objectid]] == playerid)
  289.             {
  290.                 new o = Objects[playerid][objectid];
  291.                 if(ModelID[o] != -1)
  292.                 {
  293. //                  DestroyDynamic3DTextLabel(oText[o]);
  294.                     DestroyObject(o);
  295.                     ModelID[o] = -1;
  296.                 }
  297.                 ObjectCreator[o] = INVALID_PLAYER_ID;
  298.                 oOffset[o][0] = -1, oOffset[o][1] = -1, oOffset[o][2] = -1;
  299.                 oPos[o][0] = -1, oPos[o][1] = -1, oPos[o][2] = -1;
  300.                 oRot[o][0] = -1, oRot[o][1] = -1, oRot[o][2] = -1;
  301.                 format(string, sizeof(string), "Object ID %d destroyed.", objectid);
  302.                 SendClientMessage(playerid, COLOUR_INFO, string);
  303.                 Objects[playerid][objectid] = INVALID_OBJECT_ID;
  304.             }
  305.         }
  306.         return 1;
  307.     }
  308.     else return 0;
  309. }
  310. CMD:destroyallobject(playerid, params[])
  311. {
  312.     #pragma unused params
  313.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  314.     {
  315.         if(GetFreeObjectID(playerid) >= GOBJ_MAX_OBJECTS_CREATED-1) return SendClientMessage(playerid, COLOUR_SYSTEM, "You haven't created any objects.");
  316.         else
  317.         {
  318.             Loop(o, MAX_OBJECTS)
  319.             {
  320.                 if(ObjectCreator[o] == playerid)
  321.                 {
  322.                     if(ModelID[o] != -1)
  323.                     {
  324.                         DestroyObject(o);
  325. //                          DestroyDynamic3DTextLabel(oText[o]);
  326.                         ModelID[o] = -1;
  327.                     }
  328.                     ObjectCreator[o] = INVALID_PLAYER_ID;
  329.                     oOffset[o][0] = -1, oOffset[o][1] = -1, oOffset[o][2] = -1;
  330.                     oPos[o][0] = -1, oPos[o][1] = -1, oPos[o][2] = -1;
  331.                     oRot[o][0] = -1, oRot[o][1] = -1, oRot[o][2] = -1;
  332.                 }
  333.             }
  334.             Loop(o2, GOBJ_MAX_OBJECTS_CREATED)
  335.             {
  336.                 Objects[playerid][o2] = INVALID_OBJECT_ID;
  337.             }
  338.             SendClientMessage(playerid, COLOUR_SYSTEM, "All of your objects have been destroyed.");
  339.             return 1;
  340.         }
  341.     }
  342.     else return 0;
  343. }
  344.  
  345. CMD:moveobject(playerid, params[])
  346. {
  347.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  348.     {
  349.         new objectid, direction[6], Float:amount, Float:speed, string[128];
  350.         if(sscanf(params, "ds[6]F(10)F(10)", objectid, direction, amount, speed)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /moveobject (object id) (direction) (amount) (speed) - Accepted directions are: north, south, east, west, up and down.");
  351.         if(objectid < 1 || objectid >= GOBJ_MAX_OBJECTS_CREATED-1 || Objects[playerid][objectid] == INVALID_OBJECT_ID) return SendClientMessage(playerid, COLOUR_SYSTEM, "Invalid object ID!");
  352.         if(strlen(direction) < 2 || strlen(direction) > 5) return SendClientMessage(playerid, COLOUR_SYSTEM, "Invalid direction. Accepted directions are: north, south, east, west, up and down.");
  353.         if(strcmp(direction, "north", true) && strcmp(direction, "south", true) && strcmp(direction, "east", true) && strcmp(direction, "west", true) && strcmp(direction, "up", true) && strcmp(direction, "down", true)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Invalid direction. Accepted directions are: north, south, east, west, up and down.");
  354.         else
  355.         {
  356.             if(ObjectCreator[Objects[playerid][objectid]] == playerid)
  357.             {
  358.                 new o = Objects[playerid][objectid];
  359.                 GetObjectPos(o, X, Y, Z);
  360.                 if(!strcmp(direction, "north", true)) MoveObject(o, X, Y+amount, Z, speed), oPos[o][1]+=amount;
  361.                 if(!strcmp(direction, "south", true)) MoveObject(o, X, Y-amount, Z, speed), oPos[o][1]-=amount;
  362.                 if(!strcmp(direction, "east", true)) MoveObject(o, X+amount, Y, Z, speed), oPos[o][0]+=amount;
  363.                 if(!strcmp(direction, "west", true)) MoveObject(o, X-amount, Y, Z, speed), oPos[o][0]-=amount;
  364.                 if(!strcmp(direction, "up", true)) MoveObject(o, X, Y, Z+amount, speed), oPos[o][2]+=amount;
  365.                 if(!strcmp(direction, "down", true)) MoveObject(o, X, Y, Z-amount, speed), oPos[o][2]-=amount;
  366. //              if(IsValidDynamic3DTextLabel(oText[o]))DestroyDynamic3DTextLabel(oText[o]);
  367.                 format(string, sizeof(string), "Object ID %d moved. Direction: %s (%d meters, %0.2f speed).", objectid, direction, speed);
  368.                 SendClientMessage(playerid, COLOUR_INFO, string);
  369. //              format(string, sizeof(string), "[ Object ID: %d ]|[ Model ID: %d ]", o, ModelID[o]);
  370. //              oText[o] = CreateDynamic3DTextLabel(string, -1, X, Y, Z, 10);
  371.             }
  372.         }
  373.         return 1;
  374.     }
  375.     else return 0;
  376. }
  377. CMD:moveallobject(playerid, params[])
  378. {
  379.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  380.     {
  381.         new direction[6], Float:amount, Float:speed, string[128], count;
  382.         if(sscanf(params, "s[6]F(10)F(10)", direction, amount, speed)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /moveallobject (direction) (amount) (speed) - Accepted directions are: north, south, east, west, up and down.");
  383.         if(strlen(direction) < 2 || strlen(direction) > 5) return SendClientMessage(playerid, COLOUR_SYSTEM, "Invalid direction. Accepted directions are: north, south, east, west, up and down.");
  384.         if(strcmp(direction, "north", true) && strcmp(direction, "south", true) && strcmp(direction, "east", true) && strcmp(direction, "west", true) && strcmp(direction, "up", true) && strcmp(direction, "down", true)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Invalid direction. Accepted directions are: north, south, east, west, up and down.");
  385.         else
  386.         {
  387.             Loop(o, MAX_OBJECTS)
  388.             {
  389.                 if(ObjectCreator[o] == playerid)
  390.                 {
  391.                     GetObjectPos(o, X, Y, Z);
  392.                     if(!strcmp(direction, "north", true)) MoveObject(o, X, Y+amount, Z, speed), oPos[o][1]+=amount;
  393.                     if(!strcmp(direction, "south", true)) MoveObject(o, X, Y-amount, Z, speed), oPos[o][1]-=amount;
  394.                     if(!strcmp(direction, "east", true)) MoveObject(o, X+amount, Y, Z, speed), oPos[o][0]+=amount;
  395.                     if(!strcmp(direction, "west", true)) MoveObject(o, X-amount, Y, Z, speed), oPos[o][0]-=amount;
  396.                     if(!strcmp(direction, "up", true)) MoveObject(o, X, Y, Z+amount, speed), oPos[o][2]+=amount;
  397.                     if(!strcmp(direction, "down", true)) MoveObject(o, X, Y, Z-amount, speed), oPos[o][2]-=amount;
  398. //                  if(IsValidDynamic3DTextLabel(oText[o]))DestroyDynamic3DTextLabel(oText[o]);
  399. //                  format(string, sizeof(string), "[ Object ID: %d ]|[ Model ID: %d ]", o, ModelID[o]);
  400. //                  oText[o] = CreateDynamic3DTextLabel(string, -1, X, Y, Z, 10);
  401.                     count++;
  402.                 }
  403.             }
  404.             format(string, sizeof(string), "Moved %d objects. Direction: %s (%d meters, %0.2f speed).", count, direction, speed);
  405.             SendClientMessage(playerid, COLOUR_INFO, string);
  406.         }
  407.         return 1;
  408.     }
  409.     else return 0;
  410. }
  411. CMD:getallobject(playerid, params[])
  412. {
  413.     #pragma unused params
  414.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  415.     {
  416.         GetPlayerPos(playerid, X, Y, Z);
  417.         Loop(o, MAX_OBJECTS)
  418.         {
  419.             if(ObjectCreator[o] == playerid)
  420.             {
  421. //              new string[999];
  422.                 SetObjectPos(o, X, Y, Z);
  423.                 GetObjectPos(o, oPos[o][0], oPos[o][1], oPos[o][2]);
  424. //              if(IsValidDynamic3DTextLabel(oText[o]))DestroyDynamic3DTextLabel(oText[o]);
  425. //              format(string, sizeof(string), "[ Object ID: %d ]|[ Model ID: %d ]", o, ModelID[o]);
  426. //              oText[o] = CreateDynamic3DTextLabel(string, -1, X, Y, Z, 10);
  427.             }
  428.         }
  429.         return 1;
  430.     }
  431.     else return 0;
  432. }
  433. CMD:objecttele(playerid, params[])
  434. {
  435.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  436.     {
  437.         new objectid;
  438.         if(sscanf(params, "d", objectid)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /objecttele (objectid)");
  439.         if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT && !IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOUR_SYSTEM, "You need to spawn to be able to use this command.");
  440.         if(objectid < 1 || objectid >= GOBJ_MAX_OBJECTS_CREATED-1 || Objects[playerid][objectid] == INVALID_OBJECT_ID) return SendClientMessage(playerid, COLOUR_SYSTEM, "Invalid object ID!");
  441.         else
  442.         {
  443.             if(ObjectCreator[Objects[playerid][objectid]] == playerid)
  444.             {
  445.                 GetObjectPos(Objects[playerid][objectid], X, Y, Z);
  446.                 SetPlayerPos(playerid, X, Y, Z+1);
  447.             }
  448.         }
  449.         return 1;
  450.     }
  451.     else return 0;
  452. }
  453. CMD:saveobject(playerid, params[])
  454. {
  455.     #pragma unused params
  456.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  457.     {
  458.         return ShowPlayerDialog(playerid, G_OBJ_DID, DIALOG_STYLE_INPUT, "{009900}Object Saving", "{FF0000}Warning! {FFFFFF}You're about to save objects to a file.\nYou must include the .txt tag at the end of the filename.\nAll existing text in the file you're saving to will be overwritten.\n\nEnter the filename where you want to save the objects below:", "Save", "Cancel");
  459.     }
  460.     else return 0;
  461. }
  462. CMD:loadobject(playerid, params[])
  463. {
  464.     #pragma unused params
  465.     if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  466.     {
  467.         return ShowPlayerDialog(playerid, (G_OBJ_DID+1), DIALOG_STYLE_INPUT, "{009900}Object Loading", "{FF0000}Warning! {FFFFFF}You're about to load objects from a file.\nYou must include the .txt tag at the end of the filename.\n\nEnter the filename where you want to load the objects from below:", "Load", "Cancel");
  468.     }
  469.     else return 0;
  470. }
  471. CMD:io(playerid,params[])
  472. {
  473.  if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  474.  {
  475.    if(xonsudah[playerid] == false)
  476.    {
  477.      SendClientMessage(playerid,-1,"Info : Object Info Textdraw Has Been Turned ON");
  478.      jajatimerlala[playerid] = repeat checkobjectinfo[1000](playerid);
  479.      xonsudah[playerid] = true;
  480.    }
  481.    else if(xonsudah[playerid] == true)
  482.    {
  483.      SendClientMessage(playerid,-1,"Info : Object Info Textdraw Has Been Turned OFF");
  484.      stop jajatimerlala[playerid];
  485.      xonsudah[playerid] = false;
  486.      destroyobjindicator(playerid);
  487.    }
  488.  }
  489.  return 1;
  490. }
  491. CMD:setml(playerid, params[])
  492. {
  493.         if(IsPlayerAdmin(playerid) || ML[playerid] == 1)
  494.         {
  495.                 new string[MAX_PLAYERS], targetid, license;
  496.                 if(sscanf(params, "ud", targetid, license)) return SendClientMessage(playerid, -1, "Usage: /setml [playerid] [1 - 0]");
  497.                 if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Error: That player is not connected!");
  498.                 if(license == 1)
  499.                 {
  500.                 ML[targetid] = 1;
  501.                 format(string, sizeof(string), "{FFFF00}• You Have Promote %s Mapping License •", pnama(targetid));
  502.                 SendClientMessage(playerid, -1, string);
  503.                 format(string, sizeof(string), "{FFFF00}• Administrator %s Has Promote Your Mapping License •", pnama(playerid));
  504.                 SendClientMessage(targetid, -1, string);
  505.                 } else {
  506.                 ML[targetid] = 0;
  507.                 format(string, sizeof(string), "{FFFF00}• You Have Demote %s Mapping License •", pnama(targetid));
  508.                 SendClientMessage(playerid, -1, string);
  509.                 format(string, sizeof(string), "{FFFF00}• Administrator %s Has Demote Your Mapping License •", pnama(playerid));
  510.                 SendClientMessage(targetid, -1, string);
  511.                 }
  512.                 return 1;
  513.         } else return 0;
  514. }
  515.  
  516. CMD:co(playerid, params[]) return cmd_createobject(playerid, params);
  517. CMD:rto(playerid, params[]) return cmd_rotateobject(playerid, params);
  518. CMD:rtoall(playerid, params[]) return cmd_rotateallobject(playerid, params);
  519. CMD:do(playerid, params[]) return cmd_destroyobject(playerid, params);
  520. CMD:dao(playerid, params[]) return cmd_destroyallobject(playerid, params);
  521. CMD:mvo(playerid, params[]) return cmd_moveobject(playerid, params);
  522. CMD:mvoall(playerid, params[]) return cmd_moveallobject(playerid, params);
  523. CMD:ogall(playerid, params[]) return cmd_getallobject(playerid, params);
  524. CMD:ot(playerid, params[]) return cmd_objecttele(playerid, params);
  525. CMD:so(playerid, params[]) return cmd_saveobject(playerid, params);
  526. CMD:lo(playerid, params[]) return cmd_loadobject(playerid, params);
  527. CMD:eo(playerid, params[]) return cmd_editobject(playerid, params);
  528.  
  529. stock pnama(playerid)
  530. {
  531.   new f[128];
  532.   GetPlayerName(playerid,f,sizeof(f));
  533.   return f;
  534. }
  535. stock GetFreeObjectID(playerid)
  536. {
  537.     for(new a = 1; a < GOBJ_MAX_OBJECTS_CREATED; a++)
  538.     {
  539.         if(Objects[playerid][a] == INVALID_OBJECT_ID)
  540.         {
  541.             return a;
  542.         }
  543.     }
  544.     return -1;
  545. }
  546. stock GetTotalNativeObjects()
  547. {
  548.     new tmpcount = 0;
  549.     Loop(o, MAX_OBJECTS)
  550.     {
  551.         if(IsValidObject(o))
  552.         {
  553.             tmpcount++;
  554.         }
  555.     }
  556.     return tmpcount;
  557. }
  558. stock pNick(playerid)
  559. {
  560.     new GFSnick[MAX_PLAYER_NAME];
  561.     GetPlayerName(playerid, GFSnick, MAX_PLAYER_NAME);
  562.     return GFSnick;
  563. }
  564. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  565. {
  566.     if(dialogid == G_OBJ_DID && response)
  567.     {
  568.         return SOTFile(playerid, inputtext);
  569.     }
  570.     if(dialogid == (G_OBJ_DID + 1) && response)
  571.     {
  572.         return LOTFile(playerid, inputtext);
  573.     }
  574.     return 0;
  575. }
  576. stock SOTFile(playerid, filename[], sendmsg = 1)
  577. {
  578.     new File:gFile, string[158], count;
  579.     if(strlen(filename) < 4) return SendClientMessage(playerid, COLOUR_SYSTEM, "{FF0000}Error! {FFFFFF}The filename you entered is shorter than 4 characters. Minimum filename is 4 characters including the .txt extension.");
  580.     if(strfind(filename, ".txt", true) == -1) return SendClientMessage(playerid, COLOUR_SYSTEM, "{FF0000}Error! {FFFFFF}The filename you entered didn't have the .txt extension at the end. Please add it and continue.");
  581.     else
  582.     {
  583.         new filename2[999];
  584.         format(filename2, sizeof(filename2), SaveFiles,filename);
  585.         if(fexist(filename2))
  586.         {
  587.            fremove(filename2);
  588.         }
  589.         gFile = fopen(filename2, io_write);
  590.         fclose(gFile);
  591.         gFile = fopen(filename2, io_append);
  592.         Loop(o, MAX_OBJECTS)
  593.         {
  594.             if(ObjectCreator[o] == playerid && ModelID[o] != -1)
  595.             {
  596.                 format(string, sizeof(string), "CreateObject(%d, %f, %f, %f, %f, %f, %f);\r\n", ModelID[o], oPos[o][0], oPos[o][1], oPos[o][2], oRot[o][0], oRot[o][1], oRot[o][2]);
  597.                 fwrite(gFile, string);
  598.                 DestroyObject(o);
  599.                 ModelID[o] = -1;
  600.                 count++;
  601.             }
  602.         }
  603.         fclose(gFile);
  604.         if(sendmsg == 1)
  605.         {
  606.             format(string, sizeof(string), "{009900}%d Object Saved To %s!.", count, filename);
  607.             SendClientMessage(playerid, COLOUR_INFO, string);
  608.         }
  609.     }
  610.     return 1;
  611. }
  612.  
  613. stock LOTFile(playerid, filename[], sendmsg = 1)
  614. {
  615.     new File:file_ptr, modelid, Float:pos[3], Float:rot[3], count, line[256],filename2[500];
  616.     if(strlen(filename) < 4) return SendClientMessage(playerid, COLOUR_SYSTEM, "{FF0000}Error! {FFFFFF}The filename you entered is shorter than 4 characters. Minimum filename is 4 characters including the .txt extension.");
  617.     if(strfind(filename, ".txt", true) == -1) return SendClientMessage(playerid, COLOUR_SYSTEM, "{FF0000}Error! {FFFFFF}The filename you entered didn't have the .txt extension at the end. Please add it and continue.");
  618.     format(filename2, sizeof(filename2), "Maps/%s",filename);
  619.     if(!fexist(filename2)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Error !This file does not exist.");
  620.     else
  621.     {
  622.         file_ptr = fopen(filename2, io_read);
  623.         while(fread(file_ptr, line) > 0)
  624.         {
  625.             if(GetTotalNativeObjects() >= (MAX_OBJECTS-1)) return SendClientMessage(playerid, COLOUR_SYSTEM, "The SA:MP object limit has been reached. You can not spawn any more objects.");
  626.             if(GetFreeObjectID(playerid) < 0) return SendClientMessage(playerid, COLOUR_SYSTEM, "You can not spawn any more objects. Please delete one of the current ones first.");
  627.             if(!sscanf(line, "p<,>'('ifffffp<)>f", modelid, pos[0], pos[1], pos[2], rot[0], rot[1], rot[2]))
  628.             {
  629.                 new obj = GetFreeObjectID(playerid);
  630.                 Objects[playerid][obj] = CreateObject(modelid, pos[0], pos[1], pos[2], rot[0], rot[1], rot[2]);
  631.                 new o = Objects[playerid][obj];
  632.                 ObjectCreator[o] = playerid, ModelID[o] = modelid, oPos[o][0] = pos[0], oPos[o][1] = pos[1], oPos[o][2] = pos[2], oRot[o][0] = rot[0], oRot[o][1] = rot[1], oRot[o][2] = rot[2];
  633.                 count++;
  634.             }
  635.         }
  636.         fclose(file_ptr);
  637.         if(sendmsg == 1)
  638.         {
  639.             format(line, sizeof(line), "{009900}%d Object Loaded From %s!.", count, filename);
  640.             SendClientMessage(playerid, COLOUR_INFO, line);
  641.         }
  642.     }
  643.     return 1;
  644. }
  645.  
  646. stock Float:GetDisFromPlayerToPoint(playerid,Float:x,Float:y,Float:z)
  647. {
  648.     new Float:xp,Float:yp,Float:zp;
  649.     GetPlayerPos(playerid,xp,yp,zp);
  650.     return floatsqroot(floatpower(floatabs(floatsub(x,xp)),2)+floatpower(floatabs(floatsub(y,yp)),2)+floatpower(floatabs(floatsub(z,zp)),2));
  651.  
  652. }
  653.  
  654. stock createobjindicator(playerid,modelid,owner[],objectid,Float:rx,Float:ry,Float:rz)
  655. {
  656.  if(diadaadaindicator[playerid] == 1) destroyobjindicator(playerid);
  657.  new f[128];
  658.  
  659.  IO[6][playerid] = CreatePlayerTextDraw(playerid,563.000000, 351.000000, "    ");
  660.  PlayerTextDrawAlignment(playerid,IO[6][playerid], 2);
  661.  PlayerTextDrawBackgroundColor(playerid,IO[6][playerid], 255);
  662.  PlayerTextDrawFont(playerid,IO[6][playerid], 3);
  663.  PlayerTextDrawLetterSize(playerid,IO[6][playerid], 0.660000, -1.099999);
  664.  PlayerTextDrawColor(playerid,IO[6][playerid], -1);
  665.  PlayerTextDrawSetOutline(playerid,IO[6][playerid], 0);
  666.  PlayerTextDrawSetProportional(playerid,IO[6][playerid], 0);
  667.  PlayerTextDrawSetShadow(playerid,IO[6][playerid], 1);
  668.  PlayerTextDrawUseBox(playerid,IO[6][playerid], 1);
  669.  PlayerTextDrawBoxColor(playerid,IO[6][playerid], 102);
  670.  PlayerTextDrawTextSize(playerid,IO[6][playerid], 263.000000, -75.000000);
  671.  PlayerTextDrawSetSelectable(playerid,IO[6][playerid], 0);
  672.  
  673.  IO[7][playerid] = CreatePlayerTextDraw(playerid,563.000000, 327.000000, "    ");
  674.  PlayerTextDrawAlignment(playerid,IO[7][playerid], 2);
  675.  PlayerTextDrawBackgroundColor(playerid,IO[7][playerid], 255);
  676.  PlayerTextDrawFont(playerid,IO[7][playerid], 3);
  677.  PlayerTextDrawLetterSize(playerid,IO[7][playerid], 0.660000, -1.099999);
  678.  PlayerTextDrawColor(playerid,IO[7][playerid], -1);
  679.  PlayerTextDrawSetOutline(playerid,IO[7][playerid], 0);
  680.  PlayerTextDrawSetProportional(playerid,IO[7][playerid], 0);
  681.  PlayerTextDrawSetShadow(playerid,IO[7][playerid], 1);
  682.  PlayerTextDrawUseBox(playerid,IO[7][playerid], 1);
  683.  PlayerTextDrawBoxColor(playerid,IO[7][playerid], 102);
  684.  PlayerTextDrawTextSize(playerid,IO[7][playerid], 263.000000, -75.000000);
  685.  PlayerTextDrawSetSelectable(playerid,IO[7][playerid], 0);
  686.  
  687.  IO[8][playerid] = CreatePlayerTextDraw(playerid,563.000000, 302.000000, "    ");
  688.  PlayerTextDrawAlignment(playerid,IO[8][playerid], 2);
  689.  PlayerTextDrawBackgroundColor(playerid,IO[8][playerid], 255);
  690.  PlayerTextDrawFont(playerid,IO[8][playerid], 3);
  691.  PlayerTextDrawLetterSize(playerid,IO[8][playerid], 0.660000, -1.099999);
  692.  PlayerTextDrawColor(playerid,IO[8][playerid], -1);
  693.  PlayerTextDrawSetOutline(playerid,IO[8][playerid], 0);
  694.  PlayerTextDrawSetProportional(playerid,IO[8][playerid], 0);
  695.  PlayerTextDrawSetShadow(playerid,IO[8][playerid], 1);
  696.  PlayerTextDrawUseBox(playerid,IO[8][playerid], 1);
  697.  PlayerTextDrawBoxColor(playerid,IO[8][playerid], 102);
  698.  PlayerTextDrawTextSize(playerid,IO[8][playerid], 263.000000, -75.000000);
  699.  PlayerTextDrawSetSelectable(playerid,IO[8][playerid], 0);
  700.  
  701.  IO[9][playerid] = CreatePlayerTextDraw(playerid,563.000000, 275.000000, "    ");
  702.  PlayerTextDrawAlignment(playerid,IO[9][playerid], 2);
  703.  PlayerTextDrawBackgroundColor(playerid,IO[9][playerid], 255);
  704.  PlayerTextDrawFont(playerid,IO[9][playerid], 3);
  705.  PlayerTextDrawLetterSize(playerid,IO[9][playerid], 0.660000, -1.099999);
  706.  PlayerTextDrawColor(playerid,IO[9][playerid], -1);
  707.  PlayerTextDrawSetOutline(playerid,IO[9][playerid], 0);
  708.  PlayerTextDrawSetProportional(playerid,IO[9][playerid], 0);
  709.  PlayerTextDrawSetShadow(playerid,IO[9][playerid], 1);
  710.  PlayerTextDrawUseBox(playerid,IO[9][playerid], 1);
  711.  PlayerTextDrawBoxColor(playerid,IO[9][playerid], 102);
  712.  PlayerTextDrawTextSize(playerid,IO[9][playerid], 263.000000, -145.000000);
  713.  PlayerTextDrawSetSelectable(playerid,IO[9][playerid], 0);
  714.  
  715.  IO[10][playerid] = CreatePlayerTextDraw(playerid,563.000000, 249.000000, "    ");
  716.  PlayerTextDrawAlignment(playerid,IO[10][playerid], 2);
  717.  PlayerTextDrawBackgroundColor(playerid,IO[10][playerid], 255);
  718.  PlayerTextDrawFont(playerid,IO[10][playerid], 3);
  719.  PlayerTextDrawLetterSize(playerid,IO[10][playerid], 0.660000, -1.099999);
  720.  PlayerTextDrawColor(playerid,IO[10][playerid], -1);
  721.  PlayerTextDrawSetOutline(playerid,IO[10][playerid], 0);
  722.  PlayerTextDrawSetProportional(playerid,IO[10][playerid], 0);
  723.  PlayerTextDrawSetShadow(playerid,IO[10][playerid], 1);
  724.  PlayerTextDrawUseBox(playerid,IO[10][playerid], 1);
  725.  PlayerTextDrawBoxColor(playerid,IO[10][playerid], 102);
  726.  PlayerTextDrawTextSize(playerid,IO[10][playerid], 263.000000, -145.000000);
  727.  PlayerTextDrawSetSelectable(playerid,IO[10][playerid], 0);
  728.  
  729.  IO[11][playerid] = CreatePlayerTextDraw(playerid,563.000000, 222.000000, "    ");
  730.  PlayerTextDrawAlignment(playerid,IO[11][playerid], 2);
  731.  PlayerTextDrawBackgroundColor(playerid,IO[11][playerid], 255);
  732.  PlayerTextDrawFont(playerid,IO[11][playerid], 3);
  733.  PlayerTextDrawLetterSize(playerid,IO[11][playerid], 0.660000, -1.099999);
  734.  PlayerTextDrawColor(playerid,IO[11][playerid], -1);
  735.  PlayerTextDrawSetOutline(playerid,IO[11][playerid], 0);
  736.  PlayerTextDrawSetProportional(playerid,IO[11][playerid], 0);
  737.  PlayerTextDrawSetShadow(playerid,IO[11][playerid], 1);
  738.  PlayerTextDrawUseBox(playerid,IO[11][playerid], 1);
  739.  PlayerTextDrawBoxColor(playerid,IO[11][playerid], 102);
  740.  PlayerTextDrawTextSize(playerid,IO[11][playerid], 263.000000, -145.000000);
  741.  PlayerTextDrawSetSelectable(playerid,IO[11][playerid], 0);
  742.  
  743.   //start modelid indicator
  744.  format(f,sizeof(f),"~H~~H~ModelID:~G~~H~~H~%d",modelid);
  745.  IO[0][playerid] = CreatePlayerTextDraw(playerid,563.000000, 199.000000,f);
  746.  PlayerTextDrawAlignment(playerid,IO[0][playerid], 2);
  747.  PlayerTextDrawBackgroundColor(playerid,IO[0][playerid], 255);
  748.  PlayerTextDrawFont(playerid,IO[0][playerid], 1);
  749.  PlayerTextDrawLetterSize(playerid,IO[0][playerid], 0.400000, 1.800000);
  750.  PlayerTextDrawColor(playerid,IO[0][playerid], -65281);
  751.  PlayerTextDrawSetOutline(playerid,IO[0][playerid], 1);
  752.  PlayerTextDrawSetProportional(playerid,IO[0][playerid], 1);
  753.  PlayerTextDrawSetShadow(playerid,IO[0][playerid], 1);
  754.  PlayerTextDrawSetSelectable(playerid,IO[0][playerid], 0);
  755.  //end modelid indicator
  756.  
  757.  //start owner indicator
  758.  format(f,sizeof(f),"~H~~H~Creator:~G~~H~~H~%s",owner);
  759.  IO[1][playerid] = CreatePlayerTextDraw(playerid,563.000000, 224.000000,f);
  760.  PlayerTextDrawAlignment(playerid,IO[1][playerid], 2);
  761.  PlayerTextDrawBackgroundColor(playerid,IO[1][playerid], 255);
  762.  PlayerTextDrawFont(playerid,IO[1][playerid], 1);
  763.  PlayerTextDrawLetterSize(playerid,IO[1][playerid], 0.370000, 1.800000);
  764.  PlayerTextDrawColor(playerid,IO[1][playerid], -65281);
  765.  PlayerTextDrawSetOutline(playerid,IO[1][playerid], 1);
  766.  PlayerTextDrawSetProportional(playerid,IO[1][playerid], 1);
  767.  PlayerTextDrawSetShadow(playerid,IO[1][playerid], 1);
  768.  PlayerTextDrawSetSelectable(playerid,IO[1][playerid], 0);
  769.  //end owner indicator
  770.  
  771.  //start objectid indicator
  772.  format(f,sizeof(f),"~H~~H~ObjectID:~G~~H~~H~%d",objectid);
  773.  IO[2][playerid] = CreatePlayerTextDraw(playerid,563.000000, 249.000000,f);
  774.  PlayerTextDrawAlignment(playerid,IO[2][playerid], 2);
  775.  PlayerTextDrawBackgroundColor(playerid,IO[2][playerid], 255);
  776.  PlayerTextDrawFont(playerid,IO[2][playerid], 1);
  777.  PlayerTextDrawLetterSize(playerid,IO[2][playerid], 0.360000, 1.900000);
  778.  PlayerTextDrawColor(playerid,IO[2][playerid], -65281);
  779.  PlayerTextDrawSetOutline(playerid,IO[2][playerid], 1);
  780.  PlayerTextDrawSetProportional(playerid,IO[2][playerid], 1);
  781.  PlayerTextDrawSetShadow(playerid,IO[2][playerid], 1);
  782.  PlayerTextDrawSetSelectable(playerid,IO[2][playerid], 0);
  783.  //end objectid indicator
  784.  
  785.  //start rx indicator
  786.  format(f,sizeof(f),"~H~~H~RX:~G~~H~~H~%0.2f",rx);
  787.  IO[3][playerid] = CreatePlayerTextDraw(playerid,563.000000, 277.000000,f);
  788.  PlayerTextDrawAlignment(playerid,IO[3][playerid], 2);
  789.  PlayerTextDrawBackgroundColor(playerid,IO[3][playerid], 255);
  790.  PlayerTextDrawFont(playerid,IO[3][playerid], 1);
  791.  PlayerTextDrawLetterSize(playerid,IO[3][playerid], 0.360000, 1.900000);
  792.  PlayerTextDrawColor(playerid,IO[3][playerid], -65281);
  793.  PlayerTextDrawSetOutline(playerid,IO[3][playerid], 1);
  794.  PlayerTextDrawSetProportional(playerid,IO[3][playerid], 1);
  795.  PlayerTextDrawSetShadow(playerid,IO[3][playerid], 1);
  796.  PlayerTextDrawSetSelectable(playerid,IO[3][playerid], 0);
  797.  
  798.  //end rx indicator
  799.  
  800.  //start ry indicator
  801.  format(f,sizeof(f),"~H~~H~RY:~G~~H~~H~%0.2f",ry);
  802.  IO[4][playerid] = CreatePlayerTextDraw(playerid,563.000000, 301.000000,f);
  803.  PlayerTextDrawAlignment(playerid,IO[4][playerid], 2);
  804.  PlayerTextDrawBackgroundColor(playerid,IO[4][playerid], 255);
  805.  PlayerTextDrawFont(playerid,IO[4][playerid], 1);
  806.  PlayerTextDrawLetterSize(playerid,IO[4][playerid], 0.360000, 1.900000);
  807.  PlayerTextDrawColor(playerid,IO[4][playerid], -65281);
  808.  PlayerTextDrawSetOutline(playerid,IO[4][playerid], 1);
  809.  PlayerTextDrawSetProportional(playerid,IO[4][playerid], 1);
  810.  PlayerTextDrawSetShadow(playerid,IO[4][playerid], 1);
  811.  PlayerTextDrawSetSelectable(playerid,IO[4][playerid], 0);
  812.  //end ry indicator
  813.  
  814.  //start rz indicator
  815.  format(f,sizeof(f),"~H~~H~RZ:~G~~H~~H~%0.2f",rz);
  816.  IO[5][playerid] = CreatePlayerTextDraw(playerid,563.000000, 326.000000,f);
  817.  PlayerTextDrawAlignment(playerid,IO[5][playerid], 2);
  818.  PlayerTextDrawBackgroundColor(playerid,IO[5][playerid], 255);
  819.  PlayerTextDrawFont(playerid,IO[5][playerid], 1);
  820.  PlayerTextDrawLetterSize(playerid,IO[5][playerid], 0.360000, 1.900000);
  821.  PlayerTextDrawColor(playerid,IO[5][playerid], -65281);
  822.  PlayerTextDrawSetOutline(playerid,IO[5][playerid], 1);
  823.  PlayerTextDrawSetProportional(playerid,IO[5][playerid], 1);
  824.  PlayerTextDrawSetShadow(playerid,IO[5][playerid], 1);
  825.  PlayerTextDrawSetSelectable(playerid,IO[5][playerid], 0);
  826.  //end rz indicator
  827.  
  828.  PlayerTextDrawShow(playerid,IO[6][playerid]);
  829.  PlayerTextDrawShow(playerid,IO[7][playerid]);
  830.  PlayerTextDrawShow(playerid,IO[8][playerid]);
  831.  PlayerTextDrawShow(playerid,IO[9][playerid]);
  832.  PlayerTextDrawShow(playerid,IO[10][playerid]);
  833.  PlayerTextDrawShow(playerid,IO[11][playerid]);
  834.  
  835.  PlayerTextDrawShow(playerid,IO[0][playerid]);
  836.  PlayerTextDrawShow(playerid,IO[1][playerid]);
  837.  PlayerTextDrawShow(playerid,IO[2][playerid]);
  838.  PlayerTextDrawShow(playerid,IO[3][playerid]);
  839.  PlayerTextDrawShow(playerid,IO[4][playerid]);
  840.  PlayerTextDrawShow(playerid,IO[5][playerid]);
  841.  
  842.  
  843.  return 1;
  844. }
  845.  
  846. stock destroyobjindicator(playerid)
  847. {
  848.  PlayerTextDrawDestroy(playerid,IO[0][playerid]);
  849.  PlayerTextDrawDestroy(playerid,IO[1][playerid]);
  850.  PlayerTextDrawDestroy(playerid,IO[2][playerid]);
  851.  PlayerTextDrawDestroy(playerid,IO[3][playerid]);
  852.  PlayerTextDrawDestroy(playerid,IO[4][playerid]);
  853.  PlayerTextDrawDestroy(playerid,IO[5][playerid]);
  854.  PlayerTextDrawDestroy(playerid,IO[6][playerid]);
  855.  PlayerTextDrawDestroy(playerid,IO[7][playerid]);
  856.  PlayerTextDrawDestroy(playerid,IO[8][playerid]);
  857.  PlayerTextDrawDestroy(playerid,IO[9][playerid]);
  858.  PlayerTextDrawDestroy(playerid,IO[10][playerid]);
  859.  PlayerTextDrawDestroy(playerid,IO[11][playerid]);
  860.  
  861.  diadaadaindicator[playerid] = 0;
  862.  return 1;
  863. }
  864.  
  865. timer checkobjectinfo[500](playerid)
  866. {
  867.  lel(playerid);
  868.  return 1;
  869. }
  870.  
  871.  
  872. stock lel(playerid)
  873. {
  874.  new Float:dis = 999999.0;
  875.  for(new p = 0; p < MAX_PLAYERS; p++)
  876.  {
  877.    for(new i = 1; i < MAX_OBJECTS; i++)
  878.    {
  879.     if(ModelID[i] <= 0) continue;
  880.     if(ModelID[i] > 0)
  881.     {
  882.       if(GetDisFromPlayerToPoint(playerid,oPos[i][0],oPos[i][1],oPos[i][2]) < 20 && GetDisFromPlayerToPoint(playerid,oPos[i][0],oPos[i][1],oPos[i][2]) < dis)
  883.       {
  884.          dis = GetDisFromPlayerToPoint(playerid,oPos[i][0],oPos[i][1],oPos[i][2]);
  885.          createobjindicator(playerid,ModelID[i],pNick(p),i,oRot[i][0],oRot[i][1],oRot[i][2]);
  886.          lelpcout[playerid]++;
  887.          diadaadaindicator[playerid] = 1;
  888.       }
  889.     }
  890.    }
  891.  }
  892.  if(lelpcout[playerid] <= 0) lelpcout[playerid] = 0 , destroyobjindicator(playerid);
  893.  else if(lelpcout[playerid] >= 1) lelpcout[playerid] =0;
  894.  return 1;
  895. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement