BigETI

bstreamer.inc - Documentation

Oct 23rd, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.69 KB | None | 0 0
  1. BStreamer include documentation made by BigETI © 2012
  2.  
  3. Requires
  4. - a_samp.inc - SA:MP Development Team
  5. - foreach.inc - Y_Less
  6. - sscanf2.inc (Plugin "sscanf.dll" or "sscanf.so") - Y_Less [ EXTENDED ]
  7.  
  8. Defines
  9. - How to use the defines?
  10. - They have to be defined before bstreamer.inc has been included!
  11.  
  12. -> USE_MAP_FILES
  13. - This definition allows you to use the file related functions.
  14. - Requires the sscanf include and plugin.
  15.  
  16. -> LIMIT_B_OBJECTS
  17. - Limits the amount of player objects streamed for each individual player.
  18. - By default (400).
  19. - It's a bad idea to use a value above 400!
  20.  
  21. -> MAX_B_OBJECTS
  22. - Limits the amount of global objects to use inside a gamemode or filterscript.
  23. - By default (2000).
  24. - Using a higher value requires more script heapspace!
  25.  
  26. -> B_OBJECT_STREAM_DISTANCE
  27. - Limits the default stream distance of a global object.
  28. - By default (200.0).
  29. - Each object can use an individual stream distance ( Good for small objects inside a map )
  30.  
  31. -> B_OBJECT_TICK
  32. - Defines the update tick in milliseconds
  33. - By default (100).
  34. - Using a value below 100 shall require more resources!
  35.  
  36. -> USE_CAMERA_STREAM
  37. - Defines that the player camera will be used as the center stream point.
  38. - This feature is experimental!
  39.  
  40. Callbacks
  41. - Callbacks are basicly event handlers to handle specific events in your script.
  42.  
  43. -> public OnBObjectStreamIn(playerid, bobjectid, pobjectid)
  44. - playerid --> Player ID (_:)
  45. - bobjectid --> Object ID from CreateBObject() (_:)
  46. - pobjectid --> Player object ID from CreatePlayerObject() (_:)
  47.  
  48. - A callback which will be called if a single object will be streamed in for a player.
  49. - Returning 0 will deny streaming in the specific object for the specific player.
  50.  
  51.  
  52. -> OnBObjectStreamOut(playerid, bobjectid, pobjectid)
  53. - playerid --> Player ID (_:)
  54. - bobjectid --> Object ID from CreateBObject() (_:)
  55. - pobjectid --> Player object ID from CreatePlayerObject() (_:)
  56.  
  57. - A callback which will be called if a single object will be streamed out for a player.
  58. - Returning 0 will deny streaming out the specific object for the specific player.
  59.  
  60.  
  61. -> OnBObjectMoved(bobjectid)
  62. - bobjectid --> Object ID from CreateBObject() (_:)
  63.  
  64. - A callback which will be called if the object has moved.
  65. - Only works with MoveBObject().
  66.  
  67. Stocks
  68. - Stocks are basicly functions which can be used in your script.
  69.  
  70. -> CreateBObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance = B_OBJECT_STREAM_DISTANCE, worldid = -1, interiorid = -1, playerid = -1)
  71. - modelid --> Object model ID (_:)
  72. X --> Set the X position of the object (Float:)
  73. Y --> Set the Y position of the object (Float:)
  74. Z --> Set the Z position of the object (Float:)
  75. rX --> Set the X rotation of the object (Float:)
  76. rY --> Set the Y rotation of the object (Float:)
  77. rZ --> Set the Z rotation of the object (Float:)
  78. DrawDistance --> Set the individual draw distance (Float:) [Optional; B_OBJECT_STREAM_DISTANCE by default]
  79. worldid --> Set the individual virtual world (_:) [Optional; (-1) by default; (-1) means all virtual worlds]
  80. interiorid --> Set the individual interior ID (_:) [Optional; (-1) by default; (-1) means all interiors]
  81. playerid --> Set the individual player ID (_:) [Optional; (-1) by default; (-1) means all players]
  82.  
  83. - Returns object ID if successful; else (-1).
  84. - Used to create a streamable object.
  85.  
  86.  
  87. -> DestroyBObject(bobjectid)
  88. - bobjectid --> Object ID from CreateBObject() (_:)
  89.  
  90. - Returns (true) if successful; else (false).
  91. - Used to destroy a specific global object.
  92.  
  93.  
  94. -> DestroyAllBObjects(single_vworld = -1)
  95. - single_vworld --> Set virtual world to clear (_:) [Optional; (-1) by default; (-1) means all virtual worlds!]
  96.  
  97. - Returns (true) if successful; else (false).
  98. - Used to destroy a specific global object.
  99.  
  100.  
  101. -> SetBObjectPos(bobjectid, Float:X, Float:Y, Float:Z)
  102. - bobjectid --> Object ID from CreateBObject() (_:)
  103. - X --> Set the X position of the object (Float:)
  104. - Y --> Set the Y position of the object (Float:)
  105. - Z --> Set the Z position of the object (Float:)
  106.  
  107. - Returns (true) if successful; else (false).
  108. - Used to set the position of a specific object.
  109.  
  110.  
  111. -> SetBObjectPosEx(bobjectid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ)
  112. - bobjectid --> Object ID from CreateBObject() (_:)
  113. - X --> Set the X position of the object (Float:)
  114. - Y --> Set the Y position of the object (Float:)
  115. - Z --> Set the Z position of the object (Float:)
  116. - rX --> Set the X rotation of the object (Float:)
  117. - rY --> Set the Y rotation of the object (Float:)
  118. - rZ --> Set the Z rotation of the object (Float:)
  119.  
  120. - Returns (true) if successful; else (false).
  121. - Used to set the position and rotation of a specific object.
  122.  
  123.  
  124. -> GetBObjectPos(bobjectid, &Float:X, &Float:Y, &Float:Z)
  125. - bobjectid --> Object ID from CreateBObject() (_:)
  126. - X --> Get the X position of the object (Float:) [Get Value]
  127. - Y --> Get the Y position of the object (Float:) [Get Value]
  128. - Z --> Get the Z position of the object (Float:) [Get Value]
  129.  
  130. - Returns nothing special.
  131. - Used to get the position of a specific object.
  132.  
  133.  
  134. -> GetBObjectPosEx(bobjectid, &Float:X, &Float:Y, &Float:Z, &Float:rX, &Float:rY, &Float:rZ)
  135. - bobjectid --> Object ID from CreateBObject() (_:)
  136. - X --> Get the X position of the object (Float:) [Get Value]
  137. - Y --> Get the Y position of the object (Float:) [Get Value]
  138. - Z --> Get the Z position of the object (Float:) [Get Value]
  139. - rX --> Get the X rotation of the object (Float:) [Get Value]
  140. - rY --> Get the Y rotation of the object (Float:) [Get Value]
  141. - rZ --> Get the Z rotation of the object (Float:) [Get Value]
  142.  
  143. - Returns nothing special.
  144. - Used to get the position and rotation of a specific object.
  145.  
  146.  
  147. -> SetBObjectRot(bobjectid, Float:rX, Float:rY, Float:rZ)
  148. - bobjectid --> Object ID from CreateBObject() (_:)
  149. - rX --> Set the X rotation of the object (Float:)
  150. - rY --> Set the Y rotation of the object (Float:)
  151. - rZ --> Set the Z rotation of the object (Float:)
  152.  
  153. - Returns nothing special.
  154. - Used to set the rotation of a specific object.
  155.  
  156.  
  157. -> GetBObjectRot(bobjectid, &Float:rX, &Float:rY, &Float:rZ)
  158. - bobjectid --> Object ID from CreateBObject() (_:)
  159. - rX --> Get the X rotation of the object (Float:) [Get Value]
  160. - rY --> Get the Y rotation of the object (Float:) [Get Value]
  161. - rZ --> Get the Z rotation of the object (Float:) [Get Value]
  162.  
  163. - Returns nothing special.
  164. - Used to get the rotation of a specific object.
  165.  
  166.  
  167. -> bStream_SetUpdate(updatetime = B_OBJECT_TICK)
  168. - updatetime --> Update time in milliseconds (_:) [Optional; B_OBJECT_TICK by default]
  169.  
  170. - Returns nothing special.
  171. - Used to manipulate the update timer of the object streamer.
  172. - Using a value below 100 shall require more resources!
  173.  
  174.  
  175. -> AssignBObjectForVirtualWorld(bobjectid, worldid = -1)
  176. - bobjectid --> Object ID from CreateBObject() (_:)
  177. - worldid --> Virtual World ID (_:) [Optional; (-1) by default; (-1) means all virtual worlds]
  178.  
  179. - Returns (true) if successful; else (false).
  180. - Used to manipulate the virtual world of a specific streamable object.
  181.  
  182.  
  183. -> AssignBObjectForInterior(bobjectid, interiorid = -1)
  184. - bobjectid --> Object ID from CreateBObject() (_:)
  185. - interiorid --> Interior ID (_:) [Optional; (-1) by default; (-1) means all interiors]
  186.  
  187. - Returns (true) if successful; else (false).
  188. - Used to manipulate the interior of a specific streamable object.
  189.  
  190.  
  191. -> AssignBObjectForPlayer(bobjectid, playerid = -1)
  192. - bobjectid --> Object ID from CreateBObject() (_:)
  193. - playerid --> Player ID (_:) [Optional; (-1) by default; (-1) means all players]
  194.  
  195. - Returns (true) if successful; else (false).
  196. - Used to manipulate the interior of a specific streamable object.
  197.  
  198.  
  199. -> MoveBObject(bobjectid, Float:X, Float:Y, Float:Z, Float:speed, Float:rX = -1000.0, Float:rY = -1000.0, Float:rZ = -1000.0)
  200. - bobjectid --> Object ID from CreateBObject() (_:)
  201. - X --> Move the object to the X position (Float:)
  202. - Y --> Move the object to the Y position (Float:)
  203. - Z --> Move the object to the Z position (Float:)
  204. - rX --> Rotate the object to the X position (Float:) [Optional; (-1000.0) by default]
  205. - rY --> Rotate the object to the Y position (Float:) [Optional; (-1000.0) by default]
  206. - rZ --> Rotate the object to the Z position (Float:) [Optional; (-1000.0) by default]
  207.  
  208. - Returns (true) if successful; else (false).
  209. - Used to move and rotate the streamable object to the given point.
  210. - Calls OnBObjectMoved() if finished.
  211.  
  212.  
  213. -> StopBObject(bobjectid)
  214. - bobjectid --> Object ID from CreateBObject() (_:)
  215.  
  216. - Returns (true) if successful; else (false).
  217. - Used to stop the streamable object.
  218.  
  219.  
  220. -> AttachCameraToBObject(playerid, bobjectid)
  221. - playerid --> Player ID (_:)
  222. - bobjectid --> Object ID from CreateBObject() (_:)
  223.  
  224. - Returns (true) if successful; else (false).
  225. - Used to attach the player camera to a specific streamable object.
  226.  
  227.  
  228. -> SaveBMap(const file_name[], bool:use_vworld = false, vworld = -1)
  229. - file_name --> File name string (const _: [])
  230. - use_vworld --> Use "vworld" value (bool:) [Optional; (false) by default]
  231. - vworld --> Virtual world (_:) [Optional; (-1) by default; -1 means all virtual worlds]
  232.  
  233. - Only works if USE_MAP_FILES has been defined!
  234. - Returns (true) if successful; else (false).
  235. - Used to save the current stack of streamable objects and vehicles as a binary type of file.
  236. - If use_vworld is (true) then only the given virtual world will be touched.
  237.  
  238.  
  239. -> LoadBMap(const file_name[], bool:error_clear = true, bool:use_vworld = false, vworld = -1)
  240. - file_name --> File name string (const _: [])
  241. - error_clear --> Destroy objects if error (bool:) [Optional; (true) by default]
  242. - use_vworld --> Use "vworld" value (bool:) [Optional; (false) by default]
  243. - vworld --> Virtual world (_:) [Optional; (-1) by default; -1 means all virtual worlds]
  244.  
  245. - Only works if USE_MAP_FILES has been defined!
  246. - Returns (true) if successful; else (false).
  247. - Used to load the stack of streamable objects and vehicles from a binary type of file.
  248. - If error_clear is (true) then it will destroy all the objects if an error occurs while loading.
  249. - If use_vworld is (true) then only the given virtual world will be touched.
  250.  
  251.  
  252. -> SavePWN(const file_name[], bool:use_vworld = false, vworld = -1)
  253. - file_name --> File name string (const _: [])
  254. - use_vworld --> Use "vworld" value (bool:) [Optional; (false) by default]
  255. - vworld --> Virtual world (_:) [Optional; (-1) by default; -1 means all virtual worlds]
  256.  
  257. - Only works if USE_MAP_FILES has been defined!
  258. - Returns (true) if successful; else (false).
  259. - Used to save the current stack of streamable objects and vehicles as a script file.
  260. - If use_vworld is (true) then only the given virtual world will be touched.
  261.  
  262.  
  263. -> LoadPWN(const file_name[], bool:error_clear = true, bool:use_vworld = false, vworld = -1)
  264. - file_name --> File name string (const _: [])
  265. - error_clear --> Destroy objects if error (bool:) [Optional; (true) by default]
  266. - use_vworld --> Use "vworld" value (bool:) [Optional; (false) by default]
  267. - vworld --> Virtual world (_:) [Optional; (-1) by default; -1 means all virtual worlds]
  268.  
  269. - Only works if USE_MAP_FILES has been defined!
  270. - Returns (true) if successful; else (false).
  271. - Used to load the stack of streamable objects and vehicles from a script file.
  272. - If error_clear is (true) then it will destroy all the objects if an error occurs while loading.
  273. - If use_vworld is (true) then only the given virtual world will be touched.
  274.  
  275.  
  276. -> BMap_To_PWN(bmap_fname[], pwn_fname[], bool:error_clear = true, bool:use_single_vworld = false, single_vworld = -1)
  277. - bmap_fname --> Binary map file name (_: [])
  278. - pwn_fname --> PAWN map file name (_: [])
  279. - error_clear --> Destroy objects if error (bool:) [Optional; (true) by default]
  280. - use_single_vworld --> Use "single_vworld" value (bool:) [Optional; (false) by default]
  281. - single_vworld --> Virtual world (_:) [Optional; (-1) by default; (-1) means all virtual worlds]
  282.  
  283. - Only works if USE_MAP_FILES has been defined!
  284. - Returns (true) if successful; else (false).
  285. - Converts a binary type of map file into a PAWN script map.
  286.  
  287.  
  288. -> PWN_To_BMap(pwn_fname[], bmap_fname[], bool:use_single_vworld = false, single_vworld = -1)
  289. - pwn_fname --> PAWN map file name (_: [])
  290. - bmap_fname --> Binary map file name (_: [])
  291. - error_clear --> Destroy objects if error (bool:) [Optional; (true) by default]
  292. - use_single_vworld --> Use "single_vworld" value (bool:) [Optional; (false) by default]
  293. - single_vworld --> Virtual world (_:) [Optional; (-1) by default; (-1) means all virtual worlds]
  294.  
  295. - Only works if USE_MAP_FILES has been defined!
  296. - Returns (true) if successful; else (false).
  297. - Converts a PAWN script map into a binary type of map file.
  298.  
  299.  
  300. -> CreateBVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, interior = 0, vworld = 0)
  301. - vehicletype --> Vehicle model ID (_:)
  302. - x --> Set the X position of the vehicle (Float:)
  303. - y --> Set the Y position of the vehicle (Float:)
  304. - z --> Set the Z position of the vehicle (Float:)
  305. - rotation --> Set the rotation of the vehicle (Float:)
  306. - color1 --> Set the primary vehicle color (_:)
  307. - color2 --> Set the secondary vehicle color (_:)
  308. - respawn_delay --> Set the respawn delay of the vehicle (_:)
  309. - interior --> Interior ID (_:) [Optional; (0) by default]
  310. - vworld --> Virtual world (_:) [Optional; (0) by default]
  311.  
  312. - Returns vehicle ID if successful; else (0).
  313. - Used to create a saveable vehicle.
  314.  
  315.  
  316. -> DestroyBVehicle(vehicleid)
  317. - vehicleid --> Vehicle ID from CreateBVehicle() (_:)
  318.  
  319. - Returns (true) if successful; else (false).
  320. - Used to remove a saveable vehicle.
  321.  
  322.  
  323. -> DestroyAllBVehicles(bool:use_vworld = false, vworld = 0)
  324. - use_vworld --> Use "vworld" value (bool:) [Optional; (false) by default]
  325. - vworld --> Virtual world (_:) [Optional; (0) by default]
  326.  
  327. - Returns nothing special.
  328. - Used to remove all saveable vehicles
  329. - If use_vworld is (true) then only the saveable vehicle in the given virtual world will be removed.
  330.  
  331.  
  332. -> GetBVehicleColors(vehicleid, &color1, &color2)
  333. - vehicleid --> Vehicle ID from CreateBVehicle() (_:)
  334. - color1 --> Primary color ID (_:) [Get value]
  335. - color2 --> Secondary color ID (_:) [Get value]
  336.  
  337. - Returns nothing special.
  338. - Used to get the both vehicle colors.
  339.  
  340.  
  341. -> GetBVehicleData(vehicleid, &color1, &color2, &respawn_delay, &interior)
  342. - vehicleid --> Vehicle ID from CreateBVehicle() (_:)
  343. - color1 --> Primary color ID (_:) [Get value]
  344. - color2 --> Secondary color ID (_:) [Get value]
  345. - respawn_delay --> Respawn delay (_:) [Get value]
  346. - interior --> Interior ID (_:) [Get value]
  347.  
  348. - Returns nothing special.
  349. - Used to get both vehicle colors, respawn delay and interior ID of the saveable vehicle.
  350.  
  351.  
  352. -> IsCameraInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z)
  353. - playerid --> Player ID (_:)
  354. - range --> Distance limit (Float:)
  355. - X --> X position (Float:)
  356. - Y --> Y position (Float:)
  357. - Z --> Z position (Float:)
  358.  
  359. - Returns (true) is successful; else (false).
  360. - Used to check if the point is in the given range of the player camera.
  361.  
  362. Macros
  363. - Macros are used like functions but differs from stocks
  364.  
  365. -> IsValidBObject(bobjectid)
  366. - bobjectid --> Object ID from CreateBObject() (_:)
  367.  
  368. - Returns (true) if successful; else (false).
  369.  
  370.  
  371. -> IsBObjectMoving(bobjectid)
  372. - bobjectid --> Object ID from CreateBObject() (_:)
  373.  
  374. - Returns (true) if successful; else (false).
  375.  
  376.  
  377. -> IsValidBVehicle(vehicleid)
  378. - vehicleid --> Vehicle ID from CreateBVehicle() (_:)
  379.  
  380. - Returns (true) if successful; else (false).
  381.  
  382.  
  383. -> GetBVehicleColor1(vehicleid)
  384. - vehicleid --> Vehicle ID from CreateBVehicle() (_:)
  385.  
  386. - Returns primary vehicle color ID; else (0).
  387.  
  388.  
  389. -> GetBVehicleColor2(vehicleid)
  390. - vehicleid --> Vehicle ID from CreateBVehicle() (_:)
  391.  
  392. - Returns secondary vehicle color ID; else (0).
  393.  
  394.  
  395. -> GetBVehicleResDelay(vehicleid)
  396. - vehicleid --> Vehicle ID from CreateBVehicle() (_:)
  397.  
  398. - Returns respawn delay; else (0).
  399.  
  400.  
  401. -> GetBVehicleInterior(vehicleid)
  402. - vehicleid --> Vehicle ID from CreateBVehicle() (_:)
  403.  
  404. - Returns interior ID; else (0).
Add Comment
Please, Sign In to add comment