Advertisement
Guest User

Untitled

a guest
Nov 20th, 2012
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 KB | None | 0 0
  1. //=====================================================================================
  2. /* FS created by Vegas. 20.11.2012
  3.  
  4. You can:
  5. - Make objects.
  6. - Make object for player. (SetPlayerAttachedObject)
  7. - Make labels.
  8. - Make pickups.
  9. - Make checkpoints.
  10. */
  11. //=====================================================================================
  12. #include <a_samp>
  13. #include <streamer>
  14. #include <zcmd>
  15. #include <sscanf2>
  16. //=============================================
  17. #define SCM SendClientMessage
  18. //=============================================
  19. new editing[MAX_PLAYERS];
  20. new LogStr[256];
  21. new obc;
  22. new Float:x,Float:y,Float:z;
  23. new lol;
  24.  
  25. CMD:makeobject(playerid, params[])
  26. {
  27. new obj, str[128];
  28. if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
  29. if(sscanf(params, "i", obj)) return SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makeobject [objectid]");
  30. format(str, sizeof(str), "{80FF00}You are editing object %d.", obj);
  31. SCM(playerid, -1, str);
  32. GetPlayerPos(playerid, x,y,z);
  33. obc = CreateObject(obj, x, y, z, 0, 0, 0);
  34. EditObject(playerid, obc);
  35. editing[playerid] = 1;
  36. obj = lol;
  37. return 1;
  38. }
  39.  
  40. CMD:makepickup(playerid, params[])
  41. {
  42. new id, tip, vw, str[128];
  43. if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
  44. if(sscanf(params, "iii", id, tip, vw))
  45. {
  46. SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makepickup [id] [type] [virtual world]");
  47. SCM(playerid, -1, "{00FFFF}You can see pickups id at http://wiki.sa-mp.com/wiki/Pickup_IDs");
  48. SCM(playerid, -1, "{00FFFF}You can see pickups type at http://wiki.sa-mp.com/wiki/PickupTypes");
  49. return 1;
  50. }
  51. GetPlayerPos(playerid, x,y,z);
  52. AddStaticPickup(id, tip, x, y, z, vw);
  53. format(str, sizeof(str), "{80FF00}You made an pickup. ID: %d -- Type: %d -- VW: %d", id, tip, vw);
  54. SCM(playerid, -1, str);
  55. format(LogStr, sizeof(LogStr), "AddStaticPickup(%d, %d, %f, %f, %f, %d);\r\n", id, tip, x, y, z, vw);
  56. Pickup(LogStr);
  57. return 1;
  58. }
  59.  
  60. CMD:makelabel(playerid, params[])
  61. {
  62. new txt[40],col, draw, vw, str[128];
  63. if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
  64. if(sscanf(params, "s[40]iiii", txt, col, draw, vw)) return SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makelabel [labelid] [col] [distance] [vw]");
  65. GetPlayerPos(playerid, x,y,z);
  66. Create3DTextLabel(txt, col, x, y, z, draw, vw, 1);
  67. format(str, sizeof(str), "{80FF00}You made an label. Text: %s -- Distance: %d -- VW: %d", txt, draw, vw);
  68. SCM(playerid, -1, str);
  69. format(LogStr, sizeof(LogStr), "Create3DTextLabel('%s', %d, %f, %f, %f, %d, %d, 1);\r\n", txt, col, x, y, z, draw, vw);
  70. Label(LogStr);
  71. return 1;
  72. }
  73.  
  74. CMD:makeplayerobject(playerid, params[])
  75. {
  76. new str[128], obcs, bone;
  77. if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
  78. if(sscanf(params, "ii", obcs, bone)) return SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makeplayerobject [objectid] [bone]");
  79. SetPlayerAttachedObject(playerid, 0, obcs, 1);
  80. EditAttachedObject(playerid,0);
  81. editing[playerid] = 2;
  82. format(str, sizeof(str), "{80FF00}You are editing object %d with %d bone", obcs, bone);
  83. SCM(playerid, -1, str);
  84. return 1;
  85. }
  86.  
  87. CMD:makecp(playerid, params[])
  88. {
  89. new str[128], rng;
  90. if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
  91. if(sscanf(params, "i", rng)) return SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makecp [range]");
  92. GetPlayerPos(playerid, x,y,z);
  93. SetPlayerCheckpoint(playerid, x,y,z, rng);
  94. format(str, sizeof(str), "{80FF00}You made an checkpoint with range %d", rng);
  95. SCM(playerid, -1, str);
  96. format(LogStr, sizeof(LogStr), "SetPlayerCheckpoint(playerid, %f,%f,%f, %d);\r\n", x,y,z,rng);
  97. Label(LogStr);
  98. return 1;
  99. }
  100.  
  101. forward Object(string[]);
  102. public Object(string[])
  103. {
  104. new entry[128];
  105. format(entry, sizeof(entry), "%s\n",string);
  106. new File:hFile;
  107. hFile = fopen("MGK_FS/Object.log", io_append);
  108. fwrite(hFile, entry);
  109. fclose(hFile);
  110. }
  111.  
  112. forward Pickup(string[]);
  113. public Pickup(string[])
  114. {
  115. new entry[128];
  116. format(entry, sizeof(entry), "%s\n",string);
  117. new File:hFile;
  118. hFile = fopen("MGK_FS/Pickup.log", io_append);
  119. fwrite(hFile, entry);
  120. fclose(hFile);
  121. }
  122.  
  123. forward Label(string[]);
  124. public Label(string[])
  125. {
  126. new entry[128];
  127. format(entry, sizeof(entry), "%s\n",string);
  128. new File:hFile;
  129. hFile = fopen("MGK_FS/Label.log", io_append);
  130. fwrite(hFile, entry);
  131. fclose(hFile);
  132. }
  133.  
  134. forward Attach(string[]);
  135. public Attach(string[])
  136. {
  137. new entry[128];
  138. format(entry, sizeof(entry), "%s\n",string);
  139. new File:hFile;
  140. hFile = fopen("MGK_FS/Attach.log", io_append);
  141. fwrite(hFile, entry);
  142. fclose(hFile);
  143. }
  144.  
  145. forward CheckP(string[]);
  146. public CheckP(string[])
  147. {
  148. new entry[128];
  149. format(entry, sizeof(entry), "%s\n",string);
  150. new File:hFile;
  151. hFile = fopen("MGK_FS/CPs.log", io_append);
  152. fwrite(hFile, entry);
  153. fclose(hFile);
  154. }
  155.  
  156. public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
  157. {
  158. if(editing[playerid] == 1)
  159. {
  160. editing[playerid] = 0;
  161. CreateObject(objectid, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ);
  162. format(LogStr, sizeof(LogStr), "CreateObject(%d,%f,%f,%f,%f,%f,%f);\n", lol, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ);
  163. Object(LogStr);
  164. }
  165. }
  166.  
  167.  
  168. 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)
  169. {
  170. if(editing[playerid] == 2)
  171. {
  172. SetPlayerAttachedObject(playerid,index,modelid,boneid,Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);
  173. format(LogStr, sizeof(LogStr), "SetPlayerAttachedObject(playerid,index,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f);\r\n",modelid,boneid,Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);
  174. Attach(LogStr);
  175. editing[playerid] = 0;
  176. }
  177. return 1;
  178. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement