Advertisement
Guest User

Untitled

a guest
Mar 16th, 2011
1,355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.76 KB | None | 0 0
  1. /*
  2. --------------------------------------------------------------------------------
  3.  
  4. - iAnims Animation Creation Kit 1.1
  5. - Author: Iggy
  6. - Special Thanks To Aelfred. Owner Of BionixGaming.
  7. - And Thanks To Everyone In The BionixGaming Community.
  8.  
  9. 1.1 - Dialogs and /browse anim command added
  10.  
  11. --------------------------------------------------------------------------------
  12.  
  13. Credits: ( alphabetical order )
  14.  
  15. Slice - BUD ( blazing user database ) / also used the animation enum for reference.
  16. Y_Less - sscanf2
  17. ZeeX - zcmd
  18.  
  19.  
  20. Also Obviously - The SA-MP Development Team.
  21. Last but not least - Anyone who uses this script :)
  22.  
  23. --------------------------------------------------------------------------------
  24.  
  25.  
  26.  
  27. WARNING!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!WARNING
  28.  
  29. It is highly advised you DO NOT load this filterscript while your server is running.
  30. Unless the LOAD_ON_START define is commented, the server WILL hang for 2 - 6 seconds,
  31. maybe even more those numbers were just the average on my tests.
  32. 2 - 3 Seconds if the animation database exists, and 5 - 6 seconds if the script
  33. creates the database.
  34.  
  35. WARNING!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!
  36. */
  37.  
  38.  
  39. #include <a_samp>
  40. #include <zcmd>
  41. #include <sscanf2>
  42. #include <BUD>
  43.  
  44. // CONFIG //////////////////////////////////////////////////////////////////////
  45.  
  46. #define LOAD_ON_START// comment this to stop the script from reading and loading
  47. // animation parameters in "OnFilerScriptInit.
  48. // loading will hang the server for 2 - 6 seconds on my tests.
  49. // approx 2 seconds if the database exists and approx 5 seconds if it doesn't.
  50.  
  51. //#define ADD_RCON_PROTECTION //uncomment to enable rcon check on commands ( this is a must if your going to use on a public server )
  52.  
  53. ////////////////////////////////////////////////////////////////////////////////
  54. #undef INVALID_TEXT_DRAW
  55. #define INVALID_TEXT_DRAW (Text:0xFFFF)
  56.  
  57. #define iAnim_zcmd (0)
  58. #define iAnim_ycmd (1)
  59.  
  60. #define MAX_COMMAND_NAME (MAX_PLAYER_NAME)
  61.  
  62. #define MAX_ANIMS (1812)
  63.  
  64. #define SINGLE_SAVE_FILEPATH ("iSavedAnimation.txt")
  65. #define MULTI_SAVE_FILEPATH ("iSavedAnimations.txt")
  66. #define SAVED_ZCMD_ANIMS ("iSavedZcmdAnimations.txt")
  67. #define SAVED_YCMD_ANIMS ("iSavedYcmdAnimations.txt")
  68.  
  69. #define IANIM_DEFAULT_TIME (5000)
  70. #define IANIM_DEFAULT_SPEED (2.0)
  71. #define IANIM_DEFAULT_LOOP (0)
  72. #define IANIM_DEFAULT_LOCKX (1)
  73. #define IANIM_DEFAULT_LOCKY (1)
  74. #define IANIM_DEFAULT_FREEZE (0)
  75. #define IANIM_DEFAULT_FORCESYNC (1)
  76.  
  77. #define IANIM_HELP_COLOR (0xFFFF33AA)
  78. #define IANIM_ORANGE (0xFF8F00AA)
  79.  
  80. #define IANIM_ANIMINDEX_DIALOG (1984)
  81. #define IANIM_ANIMPARAM_DIALOG (1985)
  82. #define IANIM_ANIMVALUE_DIALOG (1986)
  83.  
  84. #define SPEED_PARAM (1)
  85. #define LOOP_PARAM (2)
  86. #define LOCKX_PARAM (3)
  87. #define LOCKY_PARAM (4)
  88. #define FREEZE_PARAM (5)
  89. #define TIME_PARAM (6)
  90. #define FORCESYNC_PARAM (7)
  91.  
  92. enum IANIM_DATA
  93. {
  94. Float:iAnim_Speed,
  95. iAnim_Loop,
  96. iAnim_Lockx,
  97. iAnim_Locky,
  98. iAnim_Freeze,
  99. iAnim_Time,
  100. iAnim_ForceSync
  101. }
  102.  
  103. new iAnim_AnimData[ MAX_ANIMS ][ IANIM_DATA ];
  104.  
  105. new bool:iAnim_PlayerUsingAnim[ MAX_PLAYERS char ];
  106.  
  107. new
  108. Text:AnimScrollText = INVALID_TEXT_DRAW,
  109. Text:AnimlibDisplay[ MAX_PLAYERS ] = {INVALID_TEXT_DRAW, ...};
  110.  
  111. public OnFilterScriptInit()
  112. {
  113. BUD::Setting(opt.Database, "iAnims.db" );
  114. BUD::Setting(opt.Asynchronous, true );
  115. BUD::Setting(opt.KeepAliveTime, 3000 );
  116. BUD::Initialize();
  117. BUD::VerifyColumn("speed", BUD::TYPE_FLOAT, IANIM_DEFAULT_SPEED);
  118. BUD::VerifyColumn("loop", BUD::TYPE_NUMBER, IANIM_DEFAULT_LOOP);
  119. BUD::VerifyColumn("lockx", BUD::TYPE_NUMBER, IANIM_DEFAULT_LOCKX);
  120. BUD::VerifyColumn("locky", BUD::TYPE_NUMBER, IANIM_DEFAULT_LOCKY);
  121. BUD::VerifyColumn("freeze", BUD::TYPE_NUMBER, IANIM_DEFAULT_FREEZE);
  122. BUD::VerifyColumn("time", BUD::TYPE_NUMBER, IANIM_DEFAULT_TIME);
  123. BUD::VerifyColumn("forcesync", BUD::TYPE_NUMBER, IANIM_DEFAULT_FORCESYNC);
  124.  
  125. #if defined LOAD_ON_START
  126. new
  127. dbstr[64];
  128.  
  129. for(new i = 1; i < MAX_ANIMS; i++)
  130. {
  131. format(dbstr, sizeof( dbstr ), "Animation%d", i);
  132. if( !BUD::IsNameRegistered( dbstr ) )
  133. {
  134. BUD::RegisterName(dbstr, dbstr);
  135. iAnim_AnimData[ i ][ iAnim_Speed ] = IANIM_DEFAULT_SPEED;
  136. iAnim_AnimData[ i ][ iAnim_Loop ] = IANIM_DEFAULT_LOOP;
  137. iAnim_AnimData[ i ][ iAnim_Lockx ] = IANIM_DEFAULT_LOCKX;
  138. iAnim_AnimData[ i ][ iAnim_Locky ] = IANIM_DEFAULT_LOCKY;
  139. iAnim_AnimData[ i ][ iAnim_Freeze ] = IANIM_DEFAULT_FREEZE;
  140. iAnim_AnimData[ i ][ iAnim_Time ] = IANIM_DEFAULT_TIME;
  141. iAnim_AnimData[ i ][ iAnim_ForceSync ] = IANIM_DEFAULT_FORCESYNC;
  142. }
  143. else
  144. {
  145. BUD::MultiGet( i , "fiiiiii",
  146. "speed", iAnim_AnimData[ i ][ iAnim_Speed ],
  147. "loop", iAnim_AnimData[ i ][ iAnim_Loop ],
  148. "lockx", iAnim_AnimData[ i ][ iAnim_Lockx ],
  149. "locky", iAnim_AnimData[ i ][ iAnim_Locky ],
  150. "freeze", iAnim_AnimData[ i ][ iAnim_Freeze ],
  151. "time", iAnim_AnimData[ i ][ iAnim_Time ],
  152. "forcesync",iAnim_AnimData[ i ][ iAnim_ForceSync ]
  153. );
  154. }
  155. }
  156. #endif
  157. return 1;
  158. }
  159.  
  160. public OnPlayerDisconnect(playerid, reason)
  161. {
  162. iAnim_PlayerUsingAnim{ playerid } = false;
  163. return 1;
  164. }
  165.  
  166. public OnPlayerSpawn(playerid)
  167. {
  168. PreloadAnimLib( playerid, "BOMBER");
  169. PreloadAnimLib( playerid, "RAPPING");
  170. PreloadAnimLib( playerid, "SHOP");
  171. PreloadAnimLib( playerid, "BEACH");
  172. PreloadAnimLib( playerid, "SMOKING");
  173. PreloadAnimLib( playerid, "FOOD");
  174. PreloadAnimLib( playerid, "ON_LOOKERS");
  175. PreloadAnimLib( playerid, "DEALER");
  176. PreloadAnimLib( playerid, "CRACK");
  177. PreloadAnimLib( playerid, "CARRY");
  178. PreloadAnimLib( playerid, "COP_AMBIENT");
  179. PreloadAnimLib( playerid, "PARK");
  180. PreloadAnimLib( playerid, "INT_HOUSE");
  181. PreloadAnimLib( playerid, "FOOD" );
  182. return 1;
  183. }
  184.  
  185. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  186. {
  187. if(GetPVarInt(playerid, "browsinganims") == 1)
  188. {
  189. if(newkeys & KEY_ANALOG_LEFT)
  190. {
  191. new
  192. animlib[32], animname[32];
  193. if(GetPVarInt(playerid, "currentanim") == 1)
  194. {
  195. SetPVarInt(playerid, "currentanim", 1811);
  196. GetAnimationName(GetPVarInt(playerid, "currentanim"), animlib, 32, animname, 32);
  197. ApplyAnimation(playerid , animlib , animname ,
  198. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Speed],
  199. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Loop],
  200. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Lockx],
  201. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Locky],
  202. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Freeze],
  203. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Time],
  204. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_ForceSync]
  205. );
  206. UpdateBrowseTextDraw(playerid);
  207. }
  208. else
  209. {
  210. SetPVarInt(playerid, "currentanim", GetPVarInt(playerid, "currentanim") - 1);
  211. GetAnimationName(GetPVarInt(playerid, "currentanim"), animlib, 32, animname, 32);
  212. ApplyAnimation(playerid , animlib , animname ,
  213. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Speed],
  214. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Loop],
  215. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Lockx],
  216. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Locky],
  217. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Freeze],
  218. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Time],
  219. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_ForceSync]
  220. );
  221. UpdateBrowseTextDraw(playerid);
  222. }
  223. }
  224. else if(newkeys & KEY_ANALOG_RIGHT)
  225. {
  226. new
  227. animlib[32], animname[32];
  228. if(GetPVarInt(playerid, "currentanim") == 1811)
  229. {
  230. SetPVarInt(playerid, "currentanim", 1);
  231. GetAnimationName(GetPVarInt(playerid, "currentanim"), animlib, 32, animname, 32);
  232. ApplyAnimation(playerid , animlib , animname ,
  233. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Speed],
  234. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Loop],
  235. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Lockx],
  236. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Locky],
  237. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Freeze],
  238. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Time],
  239. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_ForceSync]
  240. );
  241. UpdateBrowseTextDraw(playerid);
  242. }
  243. else
  244. {
  245. SetPVarInt(playerid, "currentanim", GetPVarInt(playerid, "currentanim") + 1);
  246. GetAnimationName(GetPVarInt(playerid, "currentanim"), animlib, 32, animname, 32);
  247. ApplyAnimation(playerid , animlib , animname ,
  248. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Speed],
  249. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Loop],
  250. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Lockx],
  251. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Locky],
  252. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Freeze],
  253. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_Time],
  254. iAnim_AnimData[GetPVarInt(playerid, "currentanim")][iAnim_ForceSync]
  255. );
  256. UpdateBrowseTextDraw(playerid);
  257. }
  258. }
  259. return 1;
  260. }
  261. if(iAnim_PlayerUsingAnim{ playerid } == true)
  262. {
  263. ClearAnimations(playerid, 1);
  264. ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
  265. iAnim_PlayerUsingAnim{ playerid } = false;
  266. }
  267. return 1;
  268. }
  269.  
  270. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  271. {
  272. switch(dialogid)
  273. {
  274. case IANIM_ANIMINDEX_DIALOG:
  275. {
  276. if(response)
  277. {
  278. new
  279. iAnimIndex = strval(inputtext);
  280. if(iAnimIndex < 1 || iAnimIndex >= MAX_ANIMS)return SendClientMessage(playerid, 0xFF8433AA, "INVALID ANIMATION INDEX");
  281. else
  282. {
  283. ShowPlayerDialog(playerid, IANIM_ANIMPARAM_DIALOG , DIALOG_STYLE_LIST , "{00FF00}Please Select A Parameter To Edit", "{FFCCFF}Speed \n{CCCCFF}Loop \n{99CCFF}Lockx \n{66CCFF}Locky \n\
  284. {33CCFF}Freeze \n{00CCFF}Time \n{33CCCC}ForceSync", "Accept", "Back");
  285. SetPVarInt(playerid, "editinganim", iAnimIndex);
  286. //show textdraw
  287. return 1;
  288.  
  289. }
  290. }
  291. }
  292. case IANIM_ANIMPARAM_DIALOG:
  293. {
  294. if(response)
  295. {
  296. switch(listitem)
  297. {
  298. case 0: {//speed
  299. SetPVarInt(playerid, "editingparam", SPEED_PARAM);
  300. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for Speed","{FF6666}Floating point number", "Enter", "Back");
  301. return 1;
  302. }
  303. case 1://loop
  304. {
  305. SetPVarInt(playerid, "editingparam", LOOP_PARAM);
  306. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for Loop ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  307. return 1;
  308. }
  309. case 2://lockx
  310. {
  311. SetPVarInt(playerid, "editingparam", LOCKX_PARAM);
  312. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for Lockx ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  313. return 1;
  314. }
  315. case 3://locky
  316. {
  317. SetPVarInt(playerid, "editingparam", LOCKY_PARAM);
  318. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for Locky ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  319. return 1;
  320. }
  321. case 4://freeze
  322. {
  323. SetPVarInt(playerid, "editingparam", FREEZE_PARAM);
  324. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for freeze ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  325. return 1;
  326. }
  327. case 5://time
  328. {
  329. SetPVarInt(playerid, "editingparam", TIME_PARAM);
  330. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for time ","{00FF00}Time in milliseconds. '0' for infinite loop ", "Enter", "Back");
  331. return 1;
  332. }
  333. case 6://forcesync
  334. {
  335. SetPVarInt(playerid, "editingparam", FORCESYNC_PARAM);
  336. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for forcesync ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  337. return 1;
  338. }
  339. }
  340. }
  341. else
  342. {
  343. //show animindex dialog
  344. }
  345. }
  346. case IANIM_ANIMVALUE_DIALOG:
  347. {
  348. if(response)
  349. {
  350. switch(GetPVarInt(playerid, "editingparam"))
  351. {
  352. case SPEED_PARAM:
  353. {
  354. new
  355. Float:fdelta;
  356.  
  357. if( sscanf( inputtext, "f", fdelta ) )
  358. {
  359. SendClientMessage(playerid, 0xFF8433AA, "| iAnim |: ERROR: You must enter a number.");
  360. return 1;
  361. }
  362. else
  363. {
  364. iAnim_AnimData[ GetPVarInt(playerid, "editinganim") ][ iAnim_Speed ] = fdelta;
  365. SendClientMessage( playerid, IANIM_ORANGE, "| iAnim |: Animation changed." );
  366. BUD::SetFloatEntry( GetPVarInt(playerid, "editinganim"), "speed", fdelta );
  367. return 1;
  368. }
  369. }
  370. case LOOP_PARAM:
  371. {
  372. new
  373. value = strval( inputtext );
  374.  
  375. if(value < 0 || value > 1)
  376. {
  377. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for Loop ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  378. SendClientMessage(playerid, 0xFF6666AA, "| iAnim Error |: Invalid value. Expected values for that parameter are 0 and 1");
  379. return 1;
  380. }
  381. else
  382. {
  383. iAnim_AnimData[ GetPVarInt(playerid, "editinganim") ][ iAnim_Loop ] = value;
  384. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  385. BUD::SetIntEntry( GetPVarInt(playerid, "editinganim") , "loop", value );
  386. return 1;
  387. }
  388. }
  389. case LOCKX_PARAM:
  390. {
  391. new
  392. value = strval( inputtext );
  393.  
  394. if(value < 0 || value > 1)
  395. {
  396. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for Lockx ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  397. SendClientMessage(playerid, 0xFF6666AA, "| iAnim Error |: Invalid value. Expected values for that parameter are 0 and 1");
  398. return 1;
  399. }
  400. else
  401. {
  402. iAnim_AnimData[ GetPVarInt(playerid, "editinganim") ][ iAnim_Lockx ] = value;
  403. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  404. BUD::SetIntEntry( GetPVarInt(playerid, "editinganim"), "lockx", value );
  405. return 1;
  406. }
  407. }
  408. case LOCKY_PARAM:
  409. {
  410. new
  411. value = strval( inputtext );
  412.  
  413. if(value < 0 || value > 1)
  414. {
  415. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for Locky ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  416. SendClientMessage(playerid, 0xFF6666AA, "| iAnim Error |: Invalid value. Expected values for that parameter are 0 and 1");
  417. return 1;
  418. }
  419. else
  420. {
  421. iAnim_AnimData[ GetPVarInt(playerid, "editinganim") ][ iAnim_Locky ] = value;
  422. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  423. BUD::SetIntEntry( GetPVarInt(playerid, "editinganim"), "locky", value );
  424. return 1;
  425. }
  426. }
  427. case FREEZE_PARAM:
  428. {
  429. new
  430. value = strval( inputtext );
  431.  
  432. if(value < 0 || value > 1)
  433. {
  434. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for freeze ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  435. SendClientMessage(playerid, 0xFF6666AA, "| iAnim Error |: Invalid value. Expected values for that parameter are 0 and 1");
  436. return 1;
  437. }
  438. else
  439. {
  440. iAnim_AnimData[ GetPVarInt(playerid, "editinganim") ][ iAnim_Freeze ] = value;
  441. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  442. BUD::SetIntEntry( GetPVarInt(playerid, "editinganim"), "freeze", value );
  443. return 1;
  444. }
  445. }
  446. case TIME_PARAM:
  447. {
  448. new
  449. value = strval( inputtext );
  450.  
  451. if(value < 0 || value > 30000)
  452. {
  453. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for time ","{00FF00}Time in milliseconds. '0' for infinite loop", "Enter", "Back");
  454. SendClientMessage(playerid, 0xFF6666AA, "| iAnim Error |: Invalid value. Expected values for that parameter are 0 to 30000");
  455. return 1;
  456. }
  457. else
  458. {
  459. iAnim_AnimData[ GetPVarInt(playerid, "editinganim") ][ iAnim_Time ] = value;
  460. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  461. BUD::SetIntEntry( GetPVarInt(playerid, "editinganim"), "time", value );
  462. return 1;
  463. }
  464. }
  465. case FORCESYNC_PARAM:
  466. {
  467. new
  468. value = strval( inputtext );
  469.  
  470. if(value < 0 || value > 1)
  471. {
  472. ShowPlayerDialog(playerid, IANIM_ANIMVALUE_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter A Value for forcesync ","{00FF00}Expected values: {FF6666}0 - 1 ", "Enter", "Back");
  473. SendClientMessage(playerid, 0xFF6666AA, "| iAnim Error |: Invalid value. Expected values for that parameter are 0 and 1");
  474. return 1;
  475. }
  476. else
  477. {
  478. iAnim_AnimData[ GetPVarInt(playerid, "editinganim") ][ iAnim_ForceSync ] = value;
  479. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  480. BUD::SetIntEntry( GetPVarInt(playerid, "editinganim"), "forcesync", value );
  481. return 1;
  482. }
  483. }
  484. }
  485. }
  486. else
  487. {
  488. //show animparam dialog
  489. }
  490. }
  491. }
  492. return 1;
  493. }
  494.  
  495. COMMAND:animconfig(playerid, params[])
  496. {
  497. ShowPlayerDialog(playerid, IANIM_ANIMINDEX_DIALOG, DIALOG_STYLE_INPUT, "{00FF00}Please Enter An Animation Index", " ", "Accept" , "Close");
  498. return 1;
  499. }
  500.  
  501. COMMAND:animhelp(playerid, params[])
  502. {
  503. #if defined ADD_RCON_PROTECTION
  504. if(!IsPlayerAdmin(playerid))
  505. return 1;
  506. #endif
  507.  
  508. SendClientMessage( playerid, 0xFFFFFFAA, "========================= {FFA366}iAnim Commands {FFFFFF}=========================");
  509. SendClientMessage( playerid, 0xFFFF33AA, "/ianim [animation index]. - Browse through anims (1 - 1811)");
  510. SendClientMessage( playerid, 0xFFFF33AA, "/editanim [animation index][animation parameter][value]");
  511. SendClientMessage( playerid, 0xFFFF33AA, "/animspeed [animationindex][value]. - ( for higher precision speed )");
  512. SendClientMessage( playerid, 0xFFFF33AA, "/saveanim [animationindex][comment]. - leave comment for identification.");
  513. SendClientMessage( playerid, 0xFFFF33AA, "/saveallanims. - Will save all animations to iSavedAnimations.txt");
  514. SendClientMessage( playerid, 0xFFFF33AA, "/saveanimcommand [animationindex][command processor][commandname]");
  515. SendClientMessage( playerid, 0xFF6666AA, "NOTE: Valid command processors are zcmd and ycmd.");
  516. SendClientMessage( playerid, 0xFF6666AA, "Alternate names: /saa ( /saveallanims ). /sac ( /saveanimcommand )");
  517. SendClientMessage( playerid, 0xFFFFFFAA, "==================================================================");
  518. return 1;
  519. }
  520.  
  521. COMMAND:ianim(playerid, params[])
  522. {
  523. #if defined ADD_RCON_PROTECTION
  524. if(!IsPlayerAdmin(playerid))
  525. return 1;
  526. #endif
  527. new
  528. animlib[32], animname[32],
  529. iAnimIndex = strval(params);
  530. if(iAnimIndex < 1 || iAnimIndex >= MAX_ANIMS)return SendClientMessage(playerid, 0xFF8433AA, "INVALID ANIMATION INDEX");
  531. else
  532. {
  533. GetAnimationName(iAnimIndex, animlib, 32, animname, 32);
  534. ApplyAnimation(playerid , animlib , animname ,
  535. iAnim_AnimData[iAnimIndex][iAnim_Speed],
  536. iAnim_AnimData[iAnimIndex][iAnim_Loop],
  537. iAnim_AnimData[iAnimIndex][iAnim_Lockx],
  538. iAnim_AnimData[iAnimIndex][iAnim_Locky],
  539. iAnim_AnimData[iAnimIndex][iAnim_Freeze],
  540. iAnim_AnimData[iAnimIndex][iAnim_Time],
  541. iAnim_AnimData[iAnimIndex][iAnim_ForceSync]
  542. );
  543. iAnim_PlayerUsingAnim{ playerid } = true;
  544. }
  545. return 1;
  546. }
  547.  
  548. COMMAND:editanim(playerid, params[])
  549. {
  550. #if defined ADD_RCON_PROTECTION
  551. if(!IsPlayerAdmin(playerid))
  552. return 1;
  553. #endif
  554. new
  555. iAnimIndex, animparam[15], newvalue;
  556.  
  557. if(sscanf(params, "ds[15]d", iAnimIndex, animparam, newvalue)) {
  558. SendClientMessage(playerid, IANIM_ORANGE, "|iAnims|: Usage /editanim [animindex][animparam][newvalue]");
  559. SendClientMessage(playerid, IANIM_ORANGE, "|iAnims|: Example usage /editanim 100 loop 1");
  560. }
  561. else if(iAnimIndex < 1 || iAnimIndex >= MAX_ANIMS)return SendClientMessage(playerid, 0xFF8433AA, "INVALID ANIMATION INDEX");
  562. else {
  563.  
  564. if(!strcmp(animparam, "speed", true, 3) || !strcmp(animparam, "fdelta", true)) {
  565. iAnim_AnimData[ iAnimIndex ][ iAnim_Speed ] = newvalue;
  566. SendClientMessage( playerid, IANIM_ORANGE, "| iAnim |: Animation changed." );
  567. BUD::SetIntEntry( iAnimIndex, "speed", newvalue );
  568. return 1;
  569. }
  570. else if(!strcmp(animparam, "loop", true, 3)) {
  571. if(newvalue < 0 || newvalue > 1)return SendClientMessage(playerid, 0xFF8433AA, "| iAnim |: ERROR: Expected values are 0 - 1 (off/on)");
  572. iAnim_AnimData[ iAnimIndex ][ iAnim_Loop ] = newvalue;
  573. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  574. BUD::SetIntEntry( iAnimIndex, "loop", newvalue );
  575. return 1;
  576. }
  577. else if(!strcmp(animparam, "lockx", true)) {
  578. if(newvalue < 0 || newvalue > 1)return SendClientMessage(playerid, 0xFF8433AA, "| iAnim |: ERROR: Expected values are 0 - 1 (off/on)");
  579. iAnim_AnimData[ iAnimIndex ][ iAnim_Lockx ] = newvalue;
  580. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  581. BUD::SetIntEntry( iAnimIndex, "lockx", newvalue );
  582. return 1;
  583. }
  584. else if(!strcmp(animparam, "locky", true)) {
  585. if(newvalue < 0 || newvalue > 1)return SendClientMessage(playerid, 0xFF8433AA, "| iAnim |: ERROR: Expected values are 0 - 1 (off/on)");
  586. iAnim_AnimData[ iAnimIndex ][ iAnim_Locky ] = newvalue;
  587. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  588. BUD::SetIntEntry( iAnimIndex, "locky", newvalue );
  589. return 1;
  590. }
  591. else if(!strcmp(animparam, "freeze", true, 3)) {
  592. if(newvalue < 0 || newvalue > 1)return SendClientMessage(playerid, 0xFF8433AA, "| iAnim |: ERROR: Expected values are 0 - 1 (off/on)");
  593. iAnim_AnimData[ iAnimIndex ][ iAnim_Freeze ] = newvalue;
  594. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  595. BUD::SetIntEntry( iAnimIndex, "freeze", newvalue );
  596. return 1;
  597. }
  598. else if(!strcmp(animparam, "time", true, 2)) {
  599. if(newvalue < 0 || newvalue > 60000)return SendClientMessage(playerid, 0xFF8433AA, "| iAnim |: ERROR: Expected values are 0 - 60000 ( use '0' for a continuous loop )");
  600. iAnim_AnimData[ iAnimIndex ][ iAnim_Time ] = newvalue;
  601. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  602. BUD::SetIntEntry( iAnimIndex, "time", newvalue );
  603. return 1;
  604. }
  605. else if(!strcmp(animparam, "forcesync", true, 2)) {
  606. if(newvalue < 0 || newvalue > 1)return SendClientMessage(playerid, 0xFF8433AA, "| iAnim |: ERROR: Expected values are 0 - 1 (off/on)");
  607. iAnim_AnimData[ iAnimIndex ][ iAnim_ForceSync ] = newvalue;
  608. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Animation changed.");
  609. BUD::SetIntEntry( iAnimIndex, "forcesync", newvalue );
  610. return 1;
  611. }
  612. else
  613. SendClientMessage(playerid, 0xFF8433AA, "| iAnim |: ERROR: Invalid parameter name.");
  614. }
  615. return 1;
  616. }
  617.  
  618. COMMAND:animspeed(playerid, params[])
  619. {
  620. #if defined ADD_RCON_PROTECTION
  621. if(!IsPlayerAdmin(playerid))
  622. return 1;
  623. #endif
  624. new
  625. iAnimIndex,
  626. Float:fdelta;
  627. if(sscanf(params, "df", iAnimIndex, fdelta)) {
  628. SendClientMessage( playerid, 0xFF3333AA, "ERROR: Usage /animspeed [Float: speed]." );
  629. SendClientMessage( playerid, 0xFF3333AA, "Good speeds are 0.1 - 10.0" );
  630. return 1;
  631. }
  632. else {
  633. iAnim_AnimData[ iAnimIndex ][ iAnim_Speed ] = fdelta;
  634. BUD::SetFloatEntry( iAnimIndex, "speed", fdelta );
  635. SendClientMessage( playerid, IANIM_ORANGE, "| iAnim |: Animation changed." );
  636. }
  637. return 1;
  638. }
  639.  
  640. COMMAND:saveallanims(playerid, params[])
  641. {
  642. #if defined ADD_RCON_PROTECTION
  643. if(!IsPlayerAdmin(playerid))
  644. return 1;
  645. #endif
  646. iSaveAllAnimsToFile();
  647. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: All animations saved to iSavedAnimations.txt");
  648. return 1;
  649. }
  650. COMMAND:saa(playerid, params[]) {
  651. return cmd_saveallanims(playerid, params);
  652. }
  653.  
  654. COMMAND:saveanim(playerid, params[])
  655. {
  656. #if defined ADD_RCON_PROTECTION
  657. if(!IsPlayerAdmin(playerid))
  658. return 1;
  659. #endif
  660. new
  661. iAnimIndex,
  662. comment[64];
  663.  
  664. if(sscanf(params, "dS(iAnims)[64]", iAnimIndex, comment))
  665. SendClientMessage(playerid, 0xFF5C67AA, "ERROR: Usage /saveanim [AnimIndex][comment]");
  666. else {
  667. iSaveAnimToFile(iAnimIndex, comment);
  668. SendClientMessage(playerid, IANIM_ORANGE, "| iAnims |: Animation saved to iSavedAnimation.txt");
  669. }
  670. return 1;
  671. }
  672.  
  673. COMMAND:saveanimcommand(playerid, params[])
  674. {
  675. #if defined ADD_RCON_PROTECTION
  676. if(!IsPlayerAdmin(playerid))
  677. return 1;
  678. #endif
  679. new
  680. iAnimIndex,
  681. iCommandProcessor[5],
  682. zCommandName[MAX_COMMAND_NAME];
  683. if(sscanf(params, "ds[5]s[26]", iAnimIndex, iCommandProcessor, zCommandName))
  684. SendClientMessage(playerid, 0xFF3333AA, "ERROR: Usage /saveanimcommand [animindex][zcmd/ycmd][commandname]");
  685. else {
  686. if(iAnimIndex >= MAX_ANIMS || iAnimIndex < 1)return SendClientMessage(playerid, 0xFF3333AA, "ERROR: Invalid animation index. (1 - 1811)");
  687. if(!strcmp(iCommandProcessor, "zcmd", true)) {
  688. SaveAnimAsCommand( iAnimIndex, iAnim_zcmd , zCommandName);
  689. SendClientMessage(playerid, IANIM_ORANGE, "| iAnims |: zcmd command saved to iSavedZcmdAnimations.txt.");
  690. return 1;
  691. }
  692. else if(!strcmp(iCommandProcessor, "ycmd", true)) {
  693. SaveAnimAsCommand( iAnimIndex, iAnim_ycmd , zCommandName);
  694. SendClientMessage(playerid, IANIM_ORANGE, "| iAnims |: ycmd command saved to iSavedYcmdAnimations.txt.");
  695. return 1;
  696. }
  697. else
  698. SendClientMessage(playerid, 0xFF3333AA, "ERROR: Invalid command processor. Options: ycmd/zcmd.");
  699. }
  700. return 1;
  701. }
  702. COMMAND:sac(playerid, params[]) {
  703. return cmd_saveanimcommand(playerid, params);
  704. }
  705.  
  706. COMMAND:browseanims(playerid, params[])
  707. {
  708. #if defined ADD_RCON_PROTECTION
  709. if(!IsPlayerAdmin(playerid))
  710. return 1;
  711. #endif
  712.  
  713. if(GetPVarInt(playerid, "browsinganims") == 1) {
  714. DeletePVar(playerid, "browsinganims");
  715. SetCameraBehindPlayer(playerid);
  716. TogglePlayerControllable(playerid, true);
  717. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Finished browsing animations");
  718. DeletePVar(playerid, "currentanim");
  719. HidePlayerBrowseTextDraws(playerid);
  720. return 1;
  721. }
  722. else
  723. {
  724.  
  725. new
  726. Float:pX, Float:pY, Float:pZ,
  727. Float:cX, Float:cY, Float:cZ;
  728.  
  729. GetPlayerPos(playerid, pX, pY, pZ);
  730. GetXYZInFrontOfPlayer(playerid, 8.0, cX, cY, cZ);
  731. SetPlayerCameraPos(playerid, cX, cY, cZ + 0.5);
  732. SetPlayerCameraLookAt(playerid, pX, pY, pZ);
  733. TogglePlayerControllable(playerid, false);
  734. SendClientMessage(playerid, IANIM_ORANGE, "| iAnim |: Use /browseanims or /ba. To set the camera back to nornal.");
  735. SetPVarInt(playerid, "currentanim", 1);
  736. SetPVarInt(playerid, "browsinganims", 1);
  737. ShowPlayerBrowseTextDraws(playerid);
  738. ApplyAnimation( playerid, "AIRPORT" , "THRW_BARL_THRW" , 4.0 , 0 , 1 , 1 , 0 , 5000 , 1);
  739. }
  740. return 1;
  741. }
  742. COMMAND:ba(playerid, params[]) {
  743. return cmd_browseanims(playerid, params);
  744. }
  745.  
  746. iSaveAnimToFile(iAnimIndex, zComment[])
  747. {
  748. new
  749. finput[100],
  750. animlib[32], animname[32],
  751. File:AnimFile = fopen( SINGLE_SAVE_FILEPATH , io_append);
  752.  
  753. format(finput, sizeof(finput), "ApplyAnimation( playerid, \"%s\" , \"%s\" , %.1f , %d , %d , %d , %d , %d , %d);//%s\r\n" ,
  754. animlib , animname ,
  755. iAnim_AnimData[ iAnimIndex ][ iAnim_Speed ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Loop ] ,
  756. iAnim_AnimData[ iAnimIndex ][ iAnim_Lockx ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Locky ] ,
  757. iAnim_AnimData[ iAnimIndex ][ iAnim_Freeze ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Time ] ,
  758. iAnim_AnimData[ iAnimIndex ][ iAnim_ForceSync ], zComment
  759. );
  760. fwrite( AnimFile, finput );
  761. fclose( AnimFile );
  762. }
  763.  
  764. iSaveAllAnimsToFile()
  765. {
  766. if(fexist( MULTI_SAVE_FILEPATH ))
  767. fremove( MULTI_SAVE_FILEPATH );
  768. new
  769. count,
  770. finput[500],
  771. animlib[32], animname[32],
  772. File:AnimFile = fopen( MULTI_SAVE_FILEPATH , io_append );
  773. /* new
  774. result;
  775. ticks = GetTickCount();*/
  776. for( new iAnimIndex = 1; iAnimIndex < MAX_ANIMS; iAnimIndex++ )
  777. {
  778. count++;
  779. GetAnimationName( iAnimIndex, animlib, 32, animname, 32 );
  780. if( count == 5 )
  781. {
  782. format(finput, sizeof(finput), "%sApplyAnimation( playerid, \"%s\" , \"%s\" , %.1f , %d , %d , %d , %d , %d , %d);\r\n" ,
  783. finput, animlib , animname ,
  784. iAnim_AnimData[ iAnimIndex ][ iAnim_Speed ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Loop ] ,
  785. iAnim_AnimData[ iAnimIndex ][ iAnim_Lockx ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Locky ] ,
  786. iAnim_AnimData[ iAnimIndex ][ iAnim_Freeze ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Time ] ,
  787. iAnim_AnimData[ iAnimIndex ][ iAnim_ForceSync ]
  788. );
  789. fwrite( AnimFile, finput );
  790. strdel( finput, 0, sizeof( finput ) );
  791. count = 0;
  792. }
  793. else
  794. {
  795. format(finput, sizeof(finput), "%sApplyAnimation( playerid, \"%s\" , \"%s\" , %.1f , %d , %d , %d , %d , %d , %d);\r\n" ,
  796. finput, animlib , animname ,
  797. iAnim_AnimData[ iAnimIndex ][ iAnim_Speed ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Loop ] ,
  798. iAnim_AnimData[ iAnimIndex ][ iAnim_Lockx ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Locky ] ,
  799. iAnim_AnimData[ iAnimIndex ][ iAnim_Freeze ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Time ] ,
  800. iAnim_AnimData[ iAnimIndex ][ iAnim_ForceSync ]
  801. );
  802. }
  803. }
  804. fwrite( AnimFile, finput );
  805. fclose( AnimFile );
  806. /* result = GetTickCount() - ticks;
  807. printf("It Took %d milliseconds to save 1811 animations!", result); */
  808. }
  809.  
  810. PreloadAnimLib( playerid, animlib[] )//credit to kyeman
  811. {
  812. ApplyAnimation( playerid, animlib , "null" ,0.0,0,0,0,0,0 );
  813. }
  814.  
  815. SaveAnimAsCommand( iAnimIndex, iCommandProcessor , zCommandName[] )
  816. {
  817. switch( iCommandProcessor )
  818. {
  819. case iAnim_zcmd:
  820. {
  821. new
  822. finput[200],
  823. animlib[32], animname[32],
  824. File:AnimFile = fopen( SAVED_ZCMD_ANIMS , io_append );
  825. GetAnimationName( iAnimIndex, animlib, 32, animname, 32 );
  826.  
  827. format( finput, sizeof( finput ),"ApplyAnimation( playerid, \"%s\" , \"%s\" , %.1f , %d , %d , %d , %d , %d , %d);" ,
  828. animlib , animname ,
  829. iAnim_AnimData[ iAnimIndex ][ iAnim_Speed ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Loop ] ,
  830. iAnim_AnimData[ iAnimIndex ][ iAnim_Lockx ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Locky ] ,
  831. iAnim_AnimData[ iAnimIndex ][ iAnim_Freeze ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Time ] ,
  832. iAnim_AnimData[ iAnimIndex ][ iAnim_ForceSync ]
  833. );
  834.  
  835. format( finput, sizeof( finput ), "COMMAND:%s(playerid, params[])\r\n{\r\n %s\r\n return 1;\r\n}\r\n\r\n", zCommandName , finput);
  836. fwrite( AnimFile, finput );
  837. fclose( AnimFile );
  838. }
  839. case iAnim_ycmd:
  840. {
  841. new
  842. finput[250],
  843. animlib[32], animname[32],
  844. File:AnimFile = fopen( SAVED_YCMD_ANIMS , io_append );
  845. GetAnimationName( iAnimIndex, animlib, 32, animname, 32 );
  846.  
  847. format( finput, sizeof( finput ),"ApplyAnimation( playerid, \"%s\" , \"%s\" , %.1f , %d , %d , %d , %d , %d , %d);" ,
  848. animlib , animname ,
  849. iAnim_AnimData[ iAnimIndex ][ iAnim_Speed ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Loop ] ,
  850. iAnim_AnimData[ iAnimIndex ][ iAnim_Lockx ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Locky ] ,
  851. iAnim_AnimData[ iAnimIndex ][ iAnim_Freeze ] , iAnim_AnimData[ iAnimIndex ][ iAnim_Time ] ,
  852. iAnim_AnimData[ iAnimIndex ][ iAnim_ForceSync ]
  853. );
  854.  
  855. format( finput, sizeof( finput ), "YCMD:%s(playerid, params[], help)\r\n{\r\n if(help)\r\n {\r\n //helptext here\r\n }\r\n \
  856. else\r\n {\r\n %s\r\n }\r\n return 1;\r\n}\r\n\r\n", zCommandName , finput);
  857. fwrite( AnimFile, finput );
  858. fclose( AnimFile );
  859. }
  860. }
  861. }
  862.  
  863. GetXYZInFrontOfPlayer(playerid, Float:range = 1.0, &Float:x, &Float:y, &Float:z)
  864. {
  865. new
  866. Float:fPX, Float:fPY, Float:fPZ,
  867. Float:fVX, Float:fVY, Float:fVZ;
  868.  
  869. GetPlayerCameraPos(playerid, fPX, fPY, fPZ);
  870. GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ);
  871.  
  872. x = fPX + floatmul(fVX, range);
  873. y = fPY + floatmul(fVY, range);
  874. z = fPZ + floatmul(fVZ, range);
  875. }
  876.  
  877. ShowPlayerBrowseTextDraws(playerid)
  878. {
  879. AnimScrollText = TextDrawCreate(86.000000 + 10.0, 303.000000, "~g~Press ~r~NUM4 ~g~and ~r~NUM6~n~~g~To Browse Through~n~Animations");
  880. TextDrawAlignment(AnimScrollText, 2);
  881. TextDrawFont(AnimScrollText, 1);
  882. TextDrawLetterSize(AnimScrollText, 0.500000, 1.000000);
  883. TextDrawColor(AnimScrollText, -1);
  884. TextDrawSetOutline(AnimScrollText, 0);
  885. TextDrawSetProportional(AnimScrollText, 1);
  886. TextDrawSetShadow(AnimScrollText, 1);
  887. TextDrawShowForPlayer(playerid, AnimScrollText);
  888.  
  889. new
  890. textstr[100],
  891. animlib[32], animname[32];
  892. GetAnimationName( GetPVarInt(playerid, "editinganim"), animlib, 32, animname, 32);
  893. format(textstr, sizeof( textstr ), "~g~AnimLib: ~r~%s~n~~g~AnimName: ~r~%s~n~INDEX: %d", animlib, animname, GetPVarInt(playerid, "currentanim"));
  894. AnimlibDisplay[ playerid ] = TextDrawCreate(10.000000, 259.000000, textstr);
  895. TextDrawBackgroundColor(AnimlibDisplay[ playerid ], 255);
  896. TextDrawFont(AnimlibDisplay[ playerid ], 2);
  897. TextDrawLetterSize(AnimlibDisplay[ playerid ], 0.230000, 1.100000);
  898. TextDrawColor(AnimlibDisplay[ playerid ], -1);
  899. TextDrawSetOutline(AnimlibDisplay[ playerid ], 0);
  900. TextDrawSetProportional(AnimlibDisplay[ playerid ], 1);
  901. TextDrawSetShadow(AnimlibDisplay[ playerid ], 1);
  902. TextDrawShowForPlayer(playerid, AnimlibDisplay[ playerid ] );
  903. }
  904.  
  905. HidePlayerBrowseTextDraws(playerid)
  906. {
  907. TextDrawHideForPlayer(playerid, AnimScrollText);
  908. TextDrawHideForPlayer(playerid, AnimlibDisplay[ playerid ]);
  909. AnimlibDisplay[ playerid ] = INVALID_TEXT_DRAW;
  910. }
  911.  
  912. UpdateBrowseTextDraw(playerid)
  913. {
  914. new
  915. textstr[100],
  916. animlib[32], animname[32];
  917. GetAnimationName( GetPVarInt(playerid, "currentanim"), animlib, 32, animname, 32);
  918. format(textstr, sizeof( textstr ), "~g~AnimLib: ~r~%s~n~~g~AnimName: ~r~%s ~n~~g~INDEX: ~r~%d", animlib, animname, GetPVarInt(playerid, "currentanim"));
  919. TextDrawSetString(AnimlibDisplay[ playerid ], textstr);
  920. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement