Advertisement
EnzoMetlc

[FilterScript] Functions of the A_RNPC (v0.1).

Oct 23rd, 2013
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.38 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4. #include <a_rnpc>
  5.  
  6. new Npc[1];
  7. new Float: SavePos_RNPCAimAt[2];
  8. new Float: SavePos_RNPCShotAt[2];
  9. new Save_SetRNPCSkillLevel[2];
  10. new Float: SavePos_RNPCWalkTo[3];
  11. new Float: SavePos_RNPCRunTo[3];
  12. new Float:SavePos_RNPCSprinTo[3];
  13. new Float: SavePos_SetRNPCPos[3];
  14. new Float: SavePos_MoveRNPC[4];
  15.  
  16.  
  17.  
  18.  
  19. new VehicleID;
  20. new PlayerText:TextDrawPos;
  21.  
  22.  
  23. //new Recording[MAX_PLAYERS];
  24. //new AlreadyItRecorded[MAX_PLAYERS];
  25.  
  26.  
  27. #define RED 0xF10000FF
  28.  
  29. #define PRESSED(%0) \
  30. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  31.  
  32.  
  33. //========================================================
  34. #define NPC_GENERAL 0
  35. #define NPC_GENERAL_GetRNPCID 1
  36. #define NPC_GENERAL_GetRNPCState 2
  37. #define NPC_GENERAL_GetRNPCName 3
  38. #define NPC_GENERAL_GetRNPCVirtualWorld 4
  39.  
  40. //=============
  41. #define NPC_GENERAL_SetRNPCVirtualWorld 5
  42. #define NPC_GENERAL_SetRNPCVirtualWorld_WORLDID 6
  43.  
  44.  
  45.  
  46.  
  47.  
  48. //========================================================
  49. #define NPC_VEHICLE 7
  50. #define NPC_VEHICLE_PutRNPCInVehicle 8
  51. #define NPC_VEHICLE_RemoveRNPCFromVehicle 9
  52. #define NPC_VEHICLE_SetRNPCVehicleSiren 10
  53. #define NPC_VEHICLE_GetRNPCVehicleSiren 11
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. //========================================================
  62. #define NPC_IPeeped 12
  63. #define NPC_IPeeped_SetRNPCSkin 13
  64.  
  65. //=============
  66. #define NPC_IPeeped_SetRNPCPos 14
  67. #define SetRNPCPos_PosX 15
  68. #define SetRNPCPos_PosY 16
  69. #define SetRNPCPos_PosZ 17
  70.  
  71. #define NPC_IPeeped_GetRNPCPos 18
  72.  
  73. //=============
  74. #define NPC_IPeeped_MoveRNPC 19
  75. #define MoveRNPC_PosX 20
  76. #define MoveRNPC_PosY 21
  77. #define MoveRNPC_PosZ 22
  78. #define MoveRNPC_Speed 23
  79. #define MoveRNPC_Speed2 24
  80.  
  81. //=============
  82. #define NPC_IPeeped_SetRNPCFacingAngle 25
  83. #define NPC_IPeeped_SetRNPCHealth 26
  84. #define NPC_IPeeped_GetRNPCHealth 27
  85. #define NPC_IPeeped_SetRNPCArmour 28
  86. #define NPC_IPeeped_SetRNPCWeapon 29
  87. #define NPC_IPeeped_GetRNPCWeapon 30
  88.  
  89. //=============
  90. #define NPC_IPeeped_SetRNPCSkillLevel 31
  91. #define NPC_IPeeped_SetRNPCSkillLevel2 32
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99. //========================================================
  100. #define NPC_ACTIONS 33
  101. #define NPC_ACTIONS_RNPCWalkTo 34
  102. #define WalkTo_PosX 35
  103. #define WalkTo_PosY 36
  104. #define WalkTo_PosZ 37
  105.  
  106. //=============
  107. #define NPC_ACTIONS_RNPCRunTo 38
  108. #define RNPCRunTo_PosX 39
  109. #define RNPCRunTo_PosY 40
  110. #define RNPCRunTo_PosZ 41
  111.  
  112. //=============
  113. #define NPC_ACTIONS_RNPCSprintTo 42
  114. #define RNPCSprintTo_PosX 43
  115. #define RNPCSprintTo_PosY 44
  116. #define RNPCSprintTo_PosZ 45
  117.  
  118. //=============
  119. #define NPC_ACTIONS_RNPCAimAt 46
  120. #define RNPCAimAt_PosX 47
  121. #define RNPCAimAt_PosY 48
  122.  
  123. //=============
  124. #define NPC_ACTIONS_RNPCShotAt 49
  125. #define RNPCShotAt_PosX 50
  126. #define RNPCShotAt_PosY 51
  127.  
  128. //=============
  129. #define NPC_ACTIONS_RNPCStopUseWeapon 52
  130.  
  131. //=============
  132. #define NPC_ACTIONS_RNPCDriveTo 53
  133. #define RNPCDriveTo_PosX 54
  134. #define RNPCDriveTo_PosY 55
  135. #define RNPCDriveTo_PosZ 56
  136. #define RNPCDriveTo_Speed 57
  137.  
  138. //=============
  139. #define NPC_ACTIONS_RNPCFollowPlayer 58
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146. //========================================================
  147. /*
  148. #define NPC_REC 29
  149. #define NPC_REC_RNPC_StartPlayback 60
  150. #define NPC_REC_RNPC_StopPlayback 61
  151. #define NPC_REC_RNPC_StartBuildPlayback 62
  152. */
  153.  
  154.  
  155.  
  156. main()
  157. {
  158. Npc[0] = CreateRNPC("[NPC]EnzoMetlc");
  159. }
  160.  
  161. public OnGameModeInit()
  162. {
  163. SetGameModeText("Testing Npc's");
  164. SendRconCommand("hostname RNPC Functions - By EnzoMetlc.");
  165. for(new i = 0; i < 299; i++)
  166. {
  167. AddPlayerClass(i, 0.00, 0.00, 0.00, 0.00, 1, 2, 3, 4, 5, 2);
  168. }
  169. return 1;
  170. }
  171.  
  172.  
  173.  
  174. //========================================================== PUBLIC FOR PLAYERS. ==========================================================//
  175. public OnPlayerRequestClass(playerid, classid)
  176. {
  177. SetupPlayerForClassSelection(playerid);
  178. return 1;
  179. }
  180.  
  181. forward SetupPlayerForClassSelection(playerid);
  182. public SetupPlayerForClassSelection(playerid)
  183. {
  184. SetPlayerWeather(playerid, 4);
  185. SetPlayerCameraPos(playerid, -1714.123657, 751.862609, 24.742170);
  186. SetPlayerCameraLookAt(playerid, -1714.245727, 756.106506, 24.734375);
  187. SetPlayerFacingAngle(playerid, 180.135635);
  188. SetPlayerPos(playerid, -1714.245727, 756.106506, 24.734375);
  189. return 1;
  190. }
  191.  
  192.  
  193. public OnPlayerConnect(playerid)
  194. {
  195. //Recording[playerid] = 0;
  196. //AlreadyItRecorded[playerid] = 0;
  197.  
  198. TextDrawPos = CreatePlayerTextDraw(playerid,220.000000, 426.000000, " ");
  199. PlayerTextDrawBackgroundColor(playerid, TextDrawPos, 255);
  200. PlayerTextDrawFont(playerid, TextDrawPos, 2);
  201. PlayerTextDrawLetterSize(playerid, TextDrawPos, 0.230000, 1.700000);
  202. PlayerTextDrawColor(playerid, TextDrawPos, -16776961);
  203. PlayerTextDrawSetOutline(playerid, TextDrawPos, 0);
  204. PlayerTextDrawSetProportional(playerid, TextDrawPos, 1);
  205. PlayerTextDrawSetShadow(playerid, TextDrawPos, 1);
  206. PlayerTextDrawSetSelectable(playerid, TextDrawPos, 0);
  207. return 1;
  208. }
  209.  
  210. public OnPlayerSpawn(playerid)
  211. {
  212. PlayerTextDrawShow(playerid, TextDrawPos);
  213.  
  214. SendClientMessage(playerid, -1, "{00FF00}[INFO] Utilize (/Npc) to see the commands to control the Npc.");
  215. SendClientMessage(playerid, -1, "{00FF00}[INFO] He believes a Vehicle with the Command (/Car [VehicleID]).");
  216.  
  217. SetTimerEx("ToUpdatePos", 150, true, "d", playerid);
  218. SetRNPCPos(Npc[0], -1680.5272, 705.6332, 30.6016);
  219.  
  220. GivePlayerWeapon(playerid, 5, 1000);
  221. GivePlayerWeapon(playerid, 24, 1000);
  222. GivePlayerWeapon(playerid, 27, 1000);
  223. GivePlayerWeapon(playerid, 29, 1000);
  224. GivePlayerWeapon(playerid, 31, 1000);
  225. GivePlayerWeapon(playerid, 36, 1000);
  226. SetPlayerTime(playerid, 12, 5);
  227. SetPlayerPos(playerid, -1682.5272, 705.6332, 30.6016);
  228. return 1;
  229. }
  230.  
  231. forward ToUpdatePos(playerid);
  232. public ToUpdatePos(playerid)
  233. {
  234. new Float:Pos[3];
  235. new string[100];
  236. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  237. format(string, 100, "~w~Pos: ~r~%f~w~, ~r~%f~w~, ~r~%f~w~.", Pos[0], Pos[1], Pos[2]);
  238. PlayerTextDrawSetString(playerid, TextDrawPos, string);
  239. return 1;
  240. }
  241.  
  242.  
  243.  
  244. //========================================================== PUBLIC FOR THE NPC. ==========================================================//
  245.  
  246. public OnRNPCCreated(npcid)
  247. {
  248. print("A Npc has been created in the Server.");
  249. return 1;
  250. }
  251.  
  252. public OnRNPCDestroyed(npcid)
  253. {
  254. print("A NPC has been destroyed :( ");
  255. return 1;
  256. }
  257.  
  258. public OnRNPCSpawn(npcid)
  259. {
  260. print("A NPC spawned in the Server");
  261. return 1;
  262. }
  263.  
  264. public OnRNPCPlaybackFinished(npcid)
  265. {
  266. print("A NPC finished his recording.");
  267. return 1;
  268. }
  269.  
  270. public OnRNPCDeath(npcid)
  271. {
  272. print("A NPC has died in the Server.");
  273. return 1;
  274. }
  275.  
  276.  
  277.  
  278. //=======================================================================================================================================================================//
  279.  
  280. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  281. {
  282. switch(dialogid)
  283. {
  284. case NPC_GENERAL:
  285. {
  286. if(response)
  287. {
  288. switch(listitem)
  289. {
  290. case 0:
  291. {
  292. new string[144];
  293. format(string, sizeof(string), "*** Her ID of the NPC it is: {F11515}%d{FFFFFF}.", GetRNPCID(Npc[0]));
  294. SendClientMessage(playerid, -1, string);
  295. }
  296. case 1:
  297. {
  298. new string[144];
  299. format(string, sizeof(string), "*** The condition of the NPC is: {F11515}%i{FFFFFF}.", GetRNPCState(Npc[0]));
  300. SendClientMessage(playerid, -1, string);
  301. }
  302. case 2:
  303. {
  304. new string[144];
  305. format(string, sizeof(string), "*** The Nick of the NPC is: {F11515}%s{FFFFFF}.", GetRNPCName(Npc[0]));
  306. SendClientMessage(playerid, -1, string);
  307. }
  308. case 3:
  309. {
  310. new string[144];
  311. format(string, sizeof(string), "*** The Virtual World of the NPC is: {F11515}%i{FFFFFF}.", GetRNPCVirtualWorld(Npc[0]));
  312. SendClientMessage(playerid, -1, string);
  313. }
  314. case 4:
  315. {
  316. ShowPlayerDialog(playerid, NPC_GENERAL_SetRNPCVirtualWorld_WORLDID, DIALOG_STYLE_INPUT, "{00FFFF}To introduce NPC to Virtual World.", \
  317. "Write her ID of the World Virtua that it wants to put to the NPC.", "To continue", "To cancel");
  318. }
  319. }
  320. }
  321. }
  322.  
  323. case NPC_GENERAL_SetRNPCVirtualWorld_WORLDID:
  324. {
  325. if(!response) return Dialog_NPC_GENERAL(playerid);
  326. SetRNPCVirtualWorld(Npc[0], strval(inputtext));
  327. new string[144];
  328. format(string, sizeof(string), "*** You put to the NPC to the Virtual World number: %i", strval(inputtext));
  329. return SendClientMessage(playerid, -1, string);
  330. }
  331.  
  332.  
  333.  
  334.  
  335. //=======================================================================================================================================================================//
  336.  
  337. case NPC_VEHICLE:
  338. {
  339. if(response)
  340. {
  341. switch(listitem)
  342. {
  343. case 0:
  344. {
  345. if(IsPlayerInAnyVehicle(playerid))
  346. {
  347. VehicleID = GetPlayerVehicleID(playerid);
  348. PutRNPCInVehicle(Npc[0], VehicleID, 0);
  349. }
  350. else {
  351. SendClientMessage(playerid, RED, "[<!>] You must be in a Vehicle.");
  352. }
  353. }
  354. case 1:
  355. {
  356. if(IsPlayerInAnyVehicle(Npc[0]))
  357. {
  358. RemoveRNPCFromVehicle(Npc[0]);
  359. SendClientMessage(playerid, -1, "[INFO] You removed NPC of his Vehicle.");
  360. }
  361. else {
  362. SendClientMessage(playerid, RED, "[<!>] The NPC is not in a Vehicle.");
  363. }
  364. }
  365. case 2:
  366. {
  367. if(IsPlayerInAnyVehicle(Npc[0]))
  368. {
  369. ShowPlayerDialog(playerid, NPC_VEHICLE_SetRNPCVehicleSiren, DIALOG_STYLE_INPUT, \
  370. "{00FFFF}Select the RNPC to do the action.", "Place the condition of the Siren to put the NPC.", "To select", "To cancel");
  371. }
  372. else {
  373. SendClientMessage(playerid, RED, "[<!>] The NPC is not in a Vehicle.");
  374. }
  375. }
  376. case 3:
  377. {
  378. new string[144];
  379. format(string, sizeof(string), "*** Siren of the NPC: %i.", GetRNPCVehicleSiren(Npc[0]));
  380. SendClientMessage(playerid, -1, string);
  381. }
  382. }
  383. }
  384. }
  385.  
  386.  
  387.  
  388. case NPC_VEHICLE_SetRNPCVehicleSiren:
  389. {
  390. if(!response) return Dialog_NPC_VEHICLE(playerid);
  391. new string[144];
  392. SetRNPCVehicleSiren(Npc[0], strval(inputtext));
  393. format(string, sizeof(string), "*** You put the condition of the siren of the NPC in: %i.", strval(inputtext));
  394. return SendClientMessage(playerid, -1, string);
  395. }
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403. //=======================================================================================================================================================================//
  404.  
  405. case NPC_IPeeped:
  406. {
  407. if(response)
  408. {
  409. switch(listitem)
  410. {
  411. case 0:
  412. {
  413. ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCSkin, DIALOG_STYLE_INPUT, \
  414. "{00FFFF}SetRNPCSkin", "Introduce her ID of the Skin to put the NPC.", "To continue", "To cancel");
  415. }
  416. case 1:
  417. {
  418. ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCPos, DIALOG_STYLE_LIST, "{00FFFF}SetRNPCPos", "To bring to my position.\nTo write position X, Y, Z.", "To agree", "To cancel");
  419. }
  420. case 2:
  421. {
  422. new Float:Pos[3], string[144];
  423. GetRNPCPos(Npc[0], Pos[0], Pos[1], Pos[2]);
  424. format(string, sizeof(string), "*** The position of the NPC is: {F11515}X: %f{FFFFFF}, {F11515}Y: %f{FFFFFF}, {F11515}Z: %f{FFFFFF}.", Pos[0], Pos[1], Pos[2]);
  425. SendClientMessage(playerid, -1, string);
  426. }
  427. case 3:
  428. {
  429. ShowPlayerDialog(playerid, NPC_IPeeped_MoveRNPC, DIALOG_STYLE_LIST, \
  430. "{00FFFF}MoveRNPC.", "To bring to my position.\nTo write the parameters: X, Y, Z, Speed.", "To select", "To cancel");
  431. }
  432. case 4:
  433. {
  434. ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCFacingAngle, DIALOG_STYLE_INPUT, \
  435. "{00FFFF}SetRNPCFacingAngle.", "{FFFFFF}Write the angle that dese to putting the NPC.\nNorth: 0.| South: 180.| East: 270.| West: 90.", "To continue", "To cancel");
  436. }
  437. case 5:
  438. {
  439. ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCHealth, DIALOG_STYLE_INPUT, \
  440. "{00FFFF}SetRNPCHealth.", "{FFFFFF}Introduce the quantity of life that it wants to put to the NPC.", "To continue", "To cancel");
  441. }
  442. case 6:
  443. {
  444. new string[50];
  445. format(string, sizeof(string), "*** The life of the NPC is: %i", GetRNPCHealth(Npc[0]));
  446. SendClientMessage(playerid, -1, string);
  447. }
  448. case 7:
  449. {
  450. ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCArmour, DIALOG_STYLE_INPUT, \
  451. "{00FFFF}SetRNPCWeapon.", "{FFFFFF}Introduce the quantity of Armor that it wants him to give to the NPC.", "To continue", "To cancel");
  452. }
  453. case 8:
  454. {
  455. new string[50];
  456. format(string, sizeof(string), "*** The armor of the NPC is: %i", GetRNPCArmour(Npc[0]));
  457. SendClientMessage(playerid, -1, string);
  458. }
  459. case 9:
  460. {
  461. ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCWeapon, DIALOG_STYLE_INPUT, \
  462. "{00FFFF}SetRNPCWeapon.", "{FFFFFF}Introduce her ID of the weapon that it wants him to give to the NPC.", "To continue", "To cancel");
  463. }
  464. case 10:
  465. {
  466. new string[50];
  467. format(string, sizeof(string), "*** The weapon of the NPC is: %i", GetRNPCWeapon(Npc[0]));
  468. SendClientMessage(playerid, -1, string);
  469. }
  470. case 11:
  471. {
  472. ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCSkillLevel, DIALOG_STYLE_INPUT, \
  473. "{00FFFF}SetRNPCSkillLevel.", "Introduce her ID of the weapon that wants to give the skill to the NPC.", "To select", "To cancel");
  474. }
  475. }
  476. }
  477. }
  478.  
  479.  
  480.  
  481.  
  482. //====================================== SetRNPCSkin ======================================//
  483.  
  484. case NPC_IPeeped_SetRNPCSkin:
  485. {
  486. if(!response) return Dialog_NPC_IPeeped(playerid);
  487. new string[50];
  488. SetRNPCSkin(Npc[0], strval(inputtext));
  489. format(string, sizeof(string), "*** You put the NPC the Skin: %i.", strval(inputtext));
  490. return SendClientMessage(playerid, -1, string);
  491. }
  492.  
  493. case NPC_IPeeped_SetRNPCPos:
  494. {
  495. if(!response) return Dialog_NPC_IPeeped(playerid);
  496. switch(listitem)
  497. {
  498. case 0:
  499. {
  500. new Float:Pos[3];
  501. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  502. SetRNPCPos(Npc[0], Pos[0]-2.0, Pos[1], Pos[2]);
  503. SendClientMessage(playerid, -1, "*** NPC led to his Position.");
  504. }
  505. case 1:
  506. {
  507. ShowPlayerDialog(playerid, SetRNPCPos_PosX, DIALOG_STYLE_INPUT, "{FFFFFF}SetRNPCPos: {F11515}PosX{FFFFFF}.", \
  508. "He writes the position X to which it wants to take the NPC.", "To continue", "To cancel");
  509. }
  510. }
  511. }
  512.  
  513.  
  514.  
  515.  
  516. //====================================== SetRNPCPos ======================================//
  517.  
  518. case SetRNPCPos_PosX:
  519. {
  520. if(!response) return ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCPos, DIALOG_STYLE_LIST, "{00FFFF}SetRNPCPos", "To bring to my position.\nTo write position X, Y, Z.", "To agree", "To cancel");
  521. SavePos_SetRNPCPos[0] = floatstr(inputtext);
  522. ShowPlayerDialog(playerid, SetRNPCPos_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}SetRNPCPos: {F11515}PosY{FFFFFF}.", "He writes the position Y whom it wants to take to the NPC.", "To agree", "To cancel");
  523. }
  524.  
  525. case SetRNPCPos_PosY:
  526. {
  527. if(!response) return ShowPlayerDialog(playerid, SetRNPCPos_PosX, DIALOG_STYLE_INPUT, "{FFFFFF}SetRNPCPos: {F11515}PosX{FFFFFF}.", "He writes the position X to which it wants to take the NPC.", "To agree", "To cancel");
  528. SavePos_SetRNPCPos[1] = floatstr(inputtext);
  529. ShowPlayerDialog(playerid, SetRNPCPos_PosZ, DIALOG_STYLE_INPUT, "{FFFFFF}SetRNPCPos: {F11515}PosZ{FFFFFF}.", "He writes the position Z to which it wants to take the NPC.", "To agree", "To cancel");
  530. }
  531.  
  532. case SetRNPCPos_PosZ:
  533. {
  534. if(!response) return ShowPlayerDialog(playerid, SetRNPCPos_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}SetRNPCPos: {F11515}PosY{FFFFFF}.", "He writes the position Y whom it wants to take to the NPC.", "To agree", "To cancel");
  535. SavePos_SetRNPCPos[2] = floatstr(inputtext);
  536. SetRNPCPos(Npc[0], SavePos_SetRNPCPos[0], SavePos_SetRNPCPos[1], SavePos_SetRNPCPos[2]);
  537. }
  538.  
  539.  
  540.  
  541.  
  542.  
  543. //====================================== MoveRNPC ======================================//
  544.  
  545. case NPC_IPeeped_MoveRNPC:
  546. {
  547. if(!response) return Dialog_NPC_IPeeped(playerid);
  548. switch(listitem)
  549. {
  550. case 0:
  551. {
  552. ShowPlayerDialog(playerid, MoveRNPC_Speed2, DIALOG_STYLE_INPUT, "{FFFFFF}SetRNPCPos: {F11515}Speed{FFFFFF}.", \
  553. "{FFFFFF}He writes the speed to which wants to move the NPC {F11515}({FFFFFF}'0.006' it is the normal value{F11515}){FFFFFF}.", "To agree", "To cancel");
  554. }
  555. case 1:
  556. {
  557. ShowPlayerDialog(playerid, MoveRNPC_PosX, DIALOG_STYLE_INPUT, "{FFFFFF}MoveRNPC: {F11515}PosX{FFFFFF}.", \
  558. "He writes the position X to which wants to move the NPC.", "To agree", "To cancel");
  559. }
  560. }
  561. }
  562.  
  563.  
  564. case MoveRNPC_Speed2:
  565. {
  566. if(!response) return ShowPlayerDialog(playerid, NPC_IPeeped_MoveRNPC, DIALOG_STYLE_LIST, "{00FFFF}MoveRNPC.", "To bring to my position.\nTo write the parameters: X, Y, Z, Speed.", "To select", "To cancel");
  567. new string[90];
  568. new Float:Pos[3];
  569. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  570. MoveRNPC(Npc[0], Pos[0], Pos[1], Pos[2], floatstr(inputtext));
  571. format(string, sizeof(string), "*** NPC moved his Position with the speed: %0.3f.", floatstr(inputtext));
  572. SendClientMessage(playerid, -1, string);
  573. }
  574.  
  575.  
  576.  
  577.  
  578.  
  579. case MoveRNPC_PosX:
  580. {
  581. if(!response) return ShowPlayerDialog(playerid, NPC_IPeeped_MoveRNPC, DIALOG_STYLE_LIST, "{00FFFF}MoveRNPC", "To bring to my position.\nTo write parameters: X, Y, Z, Speed.", "To agree", "To cancel");
  582. SavePos_MoveRNPC[0] = floatstr(inputtext);
  583. ShowPlayerDialog(playerid, MoveRNPC_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}MoveRNPC: {F11515}PosY{FFFFFF}.", "He writes the position Y to which wants to move the NPC.", "To agree", "To cancel");
  584. }
  585.  
  586. case MoveRNPC_PosY:
  587. {
  588. if(!response) return ShowPlayerDialog(playerid, MoveRNPC_PosX, DIALOG_STYLE_INPUT, "{00FF00}MoveRNPC: {F11515}PosX{FFFFFF}.", "He writes the position X to which wants to move the NPC.", "To agree", "To cancel");
  589. SavePos_MoveRNPC[1] = floatstr(inputtext);
  590. ShowPlayerDialog(playerid, MoveRNPC_PosZ, DIALOG_STYLE_INPUT, "{FFFFFF}MoveRNPC: {F11515}PosZ{FFFFFF}.", "He writes the position Z to which wants to move the NPC.", "To agree", "To cancel");
  591. }
  592.  
  593. case MoveRNPC_PosZ:
  594. {
  595. if(!response) return ShowPlayerDialog(playerid, SetRNPCPos_PosY, DIALOG_STYLE_INPUT, "{00FF00}MoveRNPC: {F11515}PosY{FFFFFF}.", "He writes the position Y to which wants to move the NPC.", "To agree", "To cancel");
  596. SavePos_MoveRNPC[2] = floatstr(inputtext);
  597. ShowPlayerDialog(playerid, MoveRNPC_Speed, DIALOG_STYLE_INPUT, "{FFFFFF}MoveRNPC: {F11515}Speed{FFFFFF}.", "{FFFFFF}He writes the speed to which wants to move the NPC {F11515}({FFFFFF}'0.006' It is the normal value{F11515}){FFFFFF}.", "To agree", "To cancel");
  598. }
  599.  
  600. case MoveRNPC_Speed:
  601. {
  602. if(!response) return ShowPlayerDialog(playerid, SetRNPCPos_PosZ, DIALOG_STYLE_INPUT, "{FFFFFF}MoveRNPC: {F11515}PosZ{FFFFFF}.", "He writes the position Z to which wants to move the NPC.", "To agree", "To cancel");
  603. SavePos_MoveRNPC[3] = floatstr(inputtext);
  604. new string[150];
  605. MoveRNPC(Npc[0], SavePos_MoveRNPC[0], SavePos_MoveRNPC[1], SavePos_MoveRNPC[2], SavePos_MoveRNPC[3]);
  606. format(string, sizeof(string), "PosX: {F11515}%f{FFFFFF}, PosY: {F11515}%f{FFFFFF}, PosZ: {F11515}%f{FFFFFF}, Speed: {F11515}%0.3f{FFFFFF}.", SavePos_MoveRNPC[0], SavePos_MoveRNPC[1], SavePos_MoveRNPC[2], SavePos_MoveRNPC[3]);
  607. SendClientMessage(playerid, -1, string);
  608. }
  609.  
  610.  
  611.  
  612.  
  613.  
  614. //====================================== SetRNPCFacingAngle ======================================//
  615.  
  616. case NPC_IPeeped_SetRNPCFacingAngle:
  617. {
  618. if(!response) return Dialog_NPC_IPeeped(playerid);
  619. new string[20];
  620. SetRNPCFacingAngle(Npc[0], floatstr(inputtext));
  621. format(string, sizeof(string), "*** Put angle: º%0.0f.", floatstr(inputtext));
  622. SendClientMessage(playerid, -1, string);
  623. }
  624.  
  625.  
  626.  
  627. case NPC_IPeeped_SetRNPCHealth:
  628. {
  629. if(!response) return Dialog_NPC_IPeeped(playerid);
  630. new string[50];
  631. SetRNPCHealth(Npc[0], strval(inputtext));
  632. format(string, sizeof(string), "*** You him put 'º%i' of life to the NPC.", strval(inputtext));
  633. SendClientMessage(playerid, -1, string);
  634. }
  635.  
  636.  
  637. case NPC_IPeeped_SetRNPCArmour:
  638. {
  639. if(!response) return Dialog_NPC_IPeeped(playerid);
  640. new string[100];
  641. SetRNPCArmour(Npc[0], strval(inputtext));
  642. format(string, 100, "*** You put him 'º%i ' of armor to the NPC.", strval(inputtext));
  643. SendClientMessage(playerid, -1, string);
  644. }
  645.  
  646.  
  647. case NPC_IPeeped_SetRNPCWeapon:
  648. {
  649. if(!response) return Dialog_NPC_IPeeped(playerid);
  650. new string[100];
  651. SetRNPCWeapon(Npc[0], strval(inputtext));
  652. format(string, 100, "*** You put the weapon number '%i' to the NPC.", strval(inputtext));
  653. SendClientMessage(playerid, -1, string);
  654. }
  655.  
  656.  
  657.  
  658.  
  659.  
  660. //====================================== SetRNPCSkillLevel ======================================//
  661. case NPC_IPeeped_SetRNPCSkillLevel:
  662. {
  663. if(!response) return Dialog_NPC_IPeeped(playerid);
  664. Save_SetRNPCSkillLevel[0] = strval(inputtext);
  665. ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCSkillLevel2, DIALOG_STYLE_INPUT, "{FFFFFF}SetRNPCSkillLevel: {F11515}SkillLevel{FFFFFF}.", \
  666. "Introduce the quantity of skill that it wants him to give to the NPC.", "To continue", "To cancel");
  667. }
  668.  
  669. case NPC_IPeeped_SetRNPCSkillLevel2:
  670. {
  671. if(!response) return ShowPlayerDialog(playerid, NPC_IPeeped_SetRNPCSkillLevel, DIALOG_STYLE_INPUT, "{00FFFF}SetRNPCSkillLevel.", "Introduce her ID of the weapon that wants to give the skill to the NPC.", "To select", "To cancel");
  672. new string[90];
  673. Save_SetRNPCSkillLevel[1] = strval(inputtext);
  674. SetRNPCSkillLevel(Npc[0], Save_SetRNPCSkillLevel[0], Save_SetRNPCSkillLevel[1]);
  675. format(string, sizeof(string), "ID of Weapon: {F11515}%i{FFFFFF}. | Quantity of skill: {F11515}%i{FFFFFF}.", Save_SetRNPCSkillLevel[0], Save_SetRNPCSkillLevel[1]);
  676. SendClientMessage(playerid, -1, string);
  677. }
  678.  
  679.  
  680.  
  681.  
  682.  
  683. //=======================================================================================================================================================================//
  684.  
  685. case NPC_ACTIONS:
  686. {
  687. if(response)
  688. {
  689. switch(listitem)
  690. {
  691. case 0:
  692. {
  693. ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCWalkTo, DIALOG_STYLE_LIST, \
  694. "{00FFFF}RNPCWalkTo.", "To bring NPC to my position.\nTo write position X, Y, Z.", "To select", "To cancel");
  695. }
  696. case 1:
  697. {
  698. ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCRunTo, DIALOG_STYLE_LIST, \
  699. "{00FFFF}RNPCRunTo.", "To bring NPC to my position.\nTo write position X, Y, Z.", "To select", "To cancel");
  700. }
  701. case 2:
  702. {
  703. ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCSprintTo, DIALOG_STYLE_LIST, \
  704. "{00FFFF}RNPCSprintTo.", "To bring NPC to my position.\nTo write position X, Y, Z.", "To select", "To cancel");
  705. }
  706. case 3:
  707. {
  708. new Armas = GetPlayerWeapon(Npc[0]);
  709. if(Armas < 17)
  710. {
  711. SendClientMessage(playerid, RED, "[<!>] The NPC must have an firearm.");
  712. }
  713. else {
  714. ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCAimAt, DIALOG_STYLE_LIST, \
  715. "{00FFFF}RNPCAimAt.", "To do that the NPC points at me.\nTo make aim at the NPC to the position X, Y.", "To select", "To cancel");
  716. }
  717. }
  718. case 4:
  719. {
  720. ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCShotAt, DIALOG_STYLE_LIST, \
  721. "{00FFFF}RNPCShotAt.", "To do that the NPC shoots towards my position.\nTo write the posición X, Y.", "To select", "To cancel");
  722. }
  723. case 5:
  724. {
  725. RNPCStopUseWeapon(Npc[0]);
  726. SendClientMessage(playerid, -1, "*** The NPC stopped shooting.");
  727. }
  728. case 6:
  729. {
  730. ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCDriveTo, DIALOG_STYLE_LIST, \
  731. "{00FFFF}RNPCDriveTo.", "[NPC]SA.MP1 \n[NPC]SA.MP2 \n[NPC]SA.MP3 \n[NPC]SA.MP4 \n[NPC]SA.MP5", "To select", "To cancel");
  732. }
  733. case 7:
  734. {
  735. ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCFollowPlayer, DIALOG_STYLE_LIST, \
  736. "{00FFFF}RNPCFollowPlayer.", "RNPC_SPEED_SPRINT. \nRNPC_SPEED_RUN. \nRNPC_SPEED_WALK. \nRNPC_SPEED_FASTWALK.", "To select", "To cancel");
  737. }
  738. }
  739. }
  740. }
  741.  
  742.  
  743. case NPC_ACTIONS_RNPCWalkTo:
  744. {
  745. if(!response) return Dialog_NPC_ACTIONS(playerid);
  746. switch(listitem)
  747. {
  748. case 0:
  749. {
  750. new Float:Pos[3];
  751. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  752. RNPCWalkTo(Npc[0], Pos[0], Pos[1], Pos[2]);
  753. SendClientMessage(playerid, -1, "*** NPC travelled up to his position.");
  754. }
  755. case 1:
  756. {
  757. ShowPlayerDialog(playerid, WalkTo_PosX, DIALOG_STYLE_INPUT, \
  758. "{FFFFFF}RNPCWalkTo: {F11515}PosX{FFFFFF}.", "{FFFFFF}Write the position X.", "To select", "To cancel");
  759. }
  760. }
  761. }
  762.  
  763.  
  764. case WalkTo_PosX:
  765. {
  766. if(!response) return ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCWalkTo, DIALOG_STYLE_LIST, "{00FFFF}RNPCWalkTo.", "To bring NPC to my position.\nTo write position X, Y, Z.", "To select", "To cancel");
  767. SavePos_RNPCWalkTo[0] = floatstr(inputtext);
  768. ShowPlayerDialog(playerid, WalkTo_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCWalkTo: {F11515}PosY{FFFFFF}.", "{FFFFFF}He writes the position Y to which wants to move the NPC.", "To agree", "To cancel");
  769. }
  770.  
  771. case WalkTo_PosY:
  772. {
  773. if(!response) return ShowPlayerDialog(playerid, WalkTo_PosX, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCWalkTo: {F11515}PosX{FFFFFF}.", "{FFFFFF}Write the position X.", "To select", "To cancel");
  774. SavePos_RNPCWalkTo[1] = floatstr(inputtext);
  775. ShowPlayerDialog(playerid, WalkTo_PosZ, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCWalkTo: {F11515}PosZ{FFFFFF}.", "{FFFFFF}He writes the position Z to which wants to move the NPC.", "To agree", "To cancel");
  776. }
  777.  
  778. case WalkTo_PosZ:
  779. {
  780. if(!response) return ShowPlayerDialog(playerid, MoveRNPC_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCWalkTo: {F11515}PosY{FFFFFF}.", "{FFFFFF}He writes the position Y to which wants to move the NPC.", "To agree", "To cancel");
  781. new string[125];
  782. SavePos_RNPCWalkTo[2] = floatstr(inputtext);
  783. RNPCWalkTo(Npc[0], SavePos_RNPCWalkTo[0], SavePos_RNPCWalkTo[1], SavePos_RNPCWalkTo[2]);
  784. format(string, 125, "PosX: {F11515}%f{FFFFFF}, PosY: {F11515}%f{FFFFFF}, PosZ: {F11515}%f{FFFFFF}.", SavePos_RNPCWalkTo[0], SavePos_RNPCWalkTo[1], SavePos_RNPCWalkTo[2]);
  785. SendClientMessage(playerid, -1, string);
  786. }
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793. case NPC_ACTIONS_RNPCRunTo:
  794. {
  795. if(!response) return Dialog_NPC_ACTIONS(playerid);
  796. switch(listitem)
  797. {
  798. case 0:
  799. {
  800. new Float:Pos[3];
  801. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  802. RNPCRunTo(Npc[0], Pos[0], Pos[1], Pos[2]);
  803. SendClientMessage(playerid, -1, "*** NPC trotting up to his position.");
  804. }
  805. case 1:
  806. {
  807. ShowPlayerDialog(playerid, RNPCRunTo_PosX, DIALOG_STYLE_INPUT, \
  808. "{FFFFFF}RNPCRunTo: {F11515}PosX{FFFFFF}.", "{FFFFFF}Write the position X to make to travel the NPC.", "To select", "To cancel");
  809. }
  810. }
  811. }
  812.  
  813.  
  814. case RNPCRunTo_PosX:
  815. {
  816. if(!response) return ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCRunTo, DIALOG_STYLE_LIST, "{00FFFF}RNPCRunTo.", "To bring NPC to my position.\nTo write position X, Y, Z.", "To select", "To cancel");
  817. SavePos_RNPCRunTo[0] = floatstr(inputtext);
  818. ShowPlayerDialog(playerid, RNPCRunTo_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCRunTo: {F11515}PosY{FFFFFF}.", "{FFFFFF}He writes the position Y to make to trot to the NPC.", "To agree", "To cancel");
  819. }
  820.  
  821. case RNPCRunTo_PosY:
  822. {
  823. if(!response) return ShowPlayerDialog(playerid, RNPCRunTo_PosX, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCRunTo: {F11515}PosX{FFFFFF}.", "{FFFFFF}Write the position X to make to trot to the NPC.", "To select", "To cancel");
  824. SavePos_RNPCRunTo[1] = floatstr(inputtext);
  825. ShowPlayerDialog(playerid, RNPCRunTo_PosZ, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCRunTo: {F11515}PosZ{FFFFFF}.", "{FFFFFF}He writes the position Z to make to trot to the NPC.", "To agree", "To cancel");
  826. }
  827.  
  828. case RNPCRunTo_PosZ:
  829. {
  830. if(!response) return ShowPlayerDialog(playerid, RNPCRunTo_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCRunTo: {F11515}PosY{FFFFFF}.", "{FFFFFF}He writes the position Y to make to trot to the NPC.", "To agree", "To cancel");
  831. new string[125];
  832. SavePos_RNPCRunTo[2] = floatstr(inputtext);
  833. RNPCRunTo(Npc[0], SavePos_RNPCRunTo[0], SavePos_RNPCRunTo[1], SavePos_RNPCRunTo[2]);
  834. format(string, 125, "PosX: {F11515}%f{FFFFFF}, PosY: {F11515}%f{FFFFFF}, PosZ: {F11515}%f{FFFFFF}.", SavePos_RNPCRunTo[0], SavePos_RNPCRunTo[1], SavePos_RNPCRunTo[2]);
  835. SendClientMessage(playerid, -1, string);
  836. }
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844. case NPC_ACTIONS_RNPCSprintTo:
  845. {
  846. if(!response) return Dialog_NPC_ACTIONS(playerid);
  847. switch(listitem)
  848. {
  849. case 0:
  850. {
  851. new Float:Pos[3];
  852. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  853. RNPCSprintTo(Npc[0], Pos[0], Pos[1], Pos[2]);
  854. SendClientMessage(playerid, -1, "*** NPC running up to his position.");
  855. }
  856. case 1:
  857. {
  858. ShowPlayerDialog(playerid, RNPCSprintTo_PosX, DIALOG_STYLE_INPUT, \
  859. "{FFFFFF}RNPCRunTo: {F11515}PosX{FFFFFF}.", "{FFFFFF}Write the position X to make to run to the NPC.", "To select", "To cancel");
  860. }
  861. }
  862. }
  863.  
  864.  
  865. case RNPCSprintTo_PosX:
  866. {
  867. if(!response) return ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCSprintTo, DIALOG_STYLE_LIST, "{00FFFF}RNPCSprintTo.", "To bring NPC to my position.\nTo write position X, Y, Z.", "To select", "To cancel");
  868. SavePos_RNPCSprinTo[0] = floatstr(inputtext);
  869. ShowPlayerDialog(playerid, RNPCSprintTo_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCRunTo: {F11515}PosY{FFFFFF}.", "{FFFFFF}He writes the position Y to make to run to the NPC.", "To agree", "To cancel");
  870. }
  871.  
  872. case RNPCSprintTo_PosY:
  873. {
  874. if(!response) return ShowPlayerDialog(playerid, RNPCRunTo_PosX, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCRunTo: {F11515}PosX{FFFFFF}.", "{FFFFFF}Write the position X to make to run to the NPC.", "To select", "To cancel");
  875. SavePos_RNPCSprinTo[1] = floatstr(inputtext);
  876. ShowPlayerDialog(playerid, RNPCSprintTo_PosZ, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCRunTo: {F11515}PosZ{FFFFFF}.", "{FFFFFF}He writes the position Z to make to run to the NPC.", "To agree", "To cancel");
  877. }
  878.  
  879. case RNPCSprintTo_PosZ:
  880. {
  881. if(!response) return ShowPlayerDialog(playerid, RNPCRunTo_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCRunTo: {F11515}PosY{FFFFFF}.", "{FFFFFF}He writes the position Y to make to run to the NPC.", "To agree", "To cancel");
  882. new string[125];
  883. SavePos_RNPCSprinTo[2] = floatstr(inputtext);
  884. RNPCSprintTo(Npc[0], SavePos_RNPCSprinTo[0], SavePos_RNPCSprinTo[1], SavePos_RNPCSprinTo[2]);
  885. format(string, 125, "PosX: {F11515}%f{FFFFFF}, PosY: {F11515}%f{FFFFFF}, PosZ: {F11515}%f{FFFFFF}.", SavePos_RNPCSprinTo[0], SavePos_RNPCSprinTo[1], SavePos_RNPCSprinTo[2]);
  886. SendClientMessage(playerid, -1, string);
  887. }
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896. case NPC_ACTIONS_RNPCAimAt:
  897. {
  898. if(!response) return Dialog_NPC_ACTIONS(playerid);
  899. switch(listitem)
  900. {
  901. case 0:
  902. {
  903. new Float:Pos[3];
  904. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  905. RNPCAimAt(Npc[0], Pos[0], Pos[1]);
  906. SendClientMessage(playerid, -1, "*** The NPC is aiming at it.");
  907. }
  908. case 1:
  909. {
  910. ShowPlayerDialog(playerid, RNPCAimAt_PosX, DIALOG_STYLE_INPUT, \
  911. "{FFFFFF}RNPCAimAt: {F11515}PosX{FFFFFF}.", "{FFFFFF}Write the position X to make to point at the NPC.", "To select", "To cancel");
  912. }
  913. }
  914. }
  915.  
  916.  
  917. case RNPCAimAt_PosX:
  918. {
  919. if(!response) return ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCShotAt, DIALOG_STYLE_LIST, "{00FFFF}RNPCShotAt.", "To do that the NPC shoots towards my position.\nTo write the posición X, Y.", "To select", "To cancel");
  920. SavePos_RNPCAimAt[0] = floatstr(inputtext);
  921. ShowPlayerDialog(playerid, RNPCAimAt_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCAimAt: {F11515}PosY{FFFFFF}.", "{FFFFFF}He writes the position Y to do diparar the NPC.", "To agree", "To cancel");
  922. }
  923.  
  924. case RNPCAimAt_PosY:
  925. {
  926. if(!response) return ShowPlayerDialog(playerid, RNPCAimAt_PosX, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCAimAt: {F11515}PosX{FFFFFF}.", "{FFFFFF}Write the position X to make to point at the NPC.", "To select", "To cancel");
  927. SavePos_RNPCAimAt[1] = floatstr(inputtext);
  928. new string[125];
  929. RNPCAimAt(Npc[0], SavePos_RNPCAimAt[0], SavePos_RNPCAimAt[1]);
  930. format(string, 60, "X: {F11515}%f{FFFFFF}. Z: {F11515}%f{FFFFFF}.", SavePos_RNPCAimAt[0], SavePos_RNPCAimAt[1]);
  931. SendClientMessage(playerid, -1, string);
  932. }
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940. case NPC_ACTIONS_RNPCShotAt:
  941. {
  942. if(!response) return Dialog_NPC_ACTIONS(playerid);
  943. switch(listitem)
  944. {
  945. case 0:
  946. {
  947. new Float:Pos[3];
  948. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  949. RNPCShotAt(Npc[0], Pos[0], Pos[1]);
  950. SendClientMessage(playerid, -1, "*** The NPC is shooting him.");
  951. }
  952. case 1:
  953. {
  954. ShowPlayerDialog(playerid, RNPCAimAt_PosX, DIALOG_STYLE_INPUT, \
  955. "{FFFFFF}RNPCAimAt: {F11515}PosX{FFFFFF}.", "{FFFFFF}To write the position X to make to shoot the NPC.", "To select", "To cancel");
  956. }
  957. }
  958. }
  959.  
  960.  
  961. case RNPCShotAt_PosX:
  962. {
  963. if(!response) return ShowPlayerDialog(playerid, NPC_ACTIONS_RNPCAimAt, DIALOG_STYLE_LIST, "{00FFFF}RNPCAimAt.", "To do that the NPC points at me.\nTo make aim at the NPC to the position X, Y.", "To select", "To cancel");
  964. SavePos_RNPCShotAt[0] = floatstr(inputtext);
  965. ShowPlayerDialog(playerid, RNPCAimAt_PosY, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCAimAt: {F11515}PosY{FFFFFF}.", "{FFFFFF}He writes the position Y to make to point at the NPC.", "To agree", "To cancel");
  966. }
  967.  
  968. case RNPCShotAt_PosY:
  969. {
  970. if(!response) return ShowPlayerDialog(playerid, RNPCRunTo_PosX, DIALOG_STYLE_INPUT, "{FFFFFF}RNPCAimAt: {F11515}PosX{FFFFFF}.", "{FFFFFF}Write the position X to make to point at the NPC.", "To select", "To cancel");
  971. SavePos_RNPCShotAt[1] = floatstr(inputtext);
  972. new string[125];
  973. RNPCShotAt(Npc[0], SavePos_RNPCShotAt[0], SavePos_RNPCShotAt[1]);
  974. format(string, 125, "X: {F11515}%f{FFFFFF}. Z: {F11515}%f{FFFFFF}.", SavePos_RNPCShotAt[0], SavePos_RNPCShotAt[1]);
  975. SendClientMessage(playerid, -1, string);
  976. }
  977.  
  978.  
  979. case NPC_ACTIONS_RNPCFollowPlayer:
  980. {
  981. if(!response) return Dialog_NPC_ACTIONS(playerid);
  982. switch(listitem)
  983. {
  984. case 0:
  985. {
  986. RNPCFollowPlayer(Npc[0], playerid, RNPC_SPEED_SPRINT);
  987. }
  988. case 1:
  989. {
  990. RNPCFollowPlayer(Npc[0], playerid, RNPC_SPEED_RUN);
  991. }
  992. case 2:
  993. {
  994. RNPCFollowPlayer(Npc[0], playerid, RNPC_SPEED_WALK);
  995. }
  996. case 3:
  997. {
  998. RNPCFollowPlayer(Npc[0], playerid, RNPC_SPEED_FASTWALK);
  999. }
  1000. }
  1001. }
  1002. //=======================================================================================================================================================================//
  1003. /*
  1004. case NPC_REC:
  1005. {
  1006. if(response)
  1007. {
  1008. switch(listitem)
  1009. {
  1010. case 0:
  1011. {
  1012. if(Recording[playerid] == 0)
  1013. {
  1014. AlreadyItRecorded[playerid] = 0;
  1015. ShowPlayerDialog(playerid, NPC_REC_RNPC_StartPlayback, DIALOG_STYLE_INPUT, \
  1016. "{00FFFF}RNPC_StartPlayback.", "Introduzca el Nombre que desea darle a la grabación.", "To select", "To cancel");
  1017. }
  1018. else
  1019. {
  1020. SendClientMessage(playerid, RED, "[<!>] Termine la grabación del NPC antes de comenzar otra.");
  1021. }
  1022. }
  1023. case 1:
  1024. {
  1025. if(Recording[playerid] == 1)
  1026. {
  1027. RNPC_StopPlayback(Npc[0]);
  1028. SendClientMessage(playerid, -1, "[NOTA] Grabación del NPC terminada.");
  1029. AlreadyItRecorded[playerid] = 1;
  1030. }
  1031. else
  1032. {
  1033. SendClientMessage(playerid, RED, "[<!>] Usted no estaba Recording.");
  1034. }
  1035. }
  1036. case 2:
  1037. {
  1038. if(AlreadyItRecorded[playerid] == 1)
  1039. {
  1040. RNPC_StartBuildPlayback(Npc[0], 0, 0);
  1041. }
  1042. else {
  1043. SendClientMessage(playerid, RED, "[<!>] Usted no grabó nada.");
  1044. }
  1045. }
  1046. }
  1047. }
  1048. }
  1049.  
  1050.  
  1051. case NPC_REC_RNPC_StartPlayback:
  1052. {
  1053. if(!response) return Dialog_NPC_REC(playerid);
  1054. new string[125];
  1055. RNPC_StartPlayback(Npc[0], inputtext);
  1056. Recording[playerid] = 1;
  1057. format(string, sizeof(string), "*** El Nombre de la grabación será: {F11515}%s{FFFFFF}.", inputtext);
  1058. SendClientMessage(playerid, -1, string);
  1059. }
  1060. */
  1061. }
  1062. return 1;
  1063. }
  1064.  
  1065.  
  1066.  
  1067.  
  1068. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  1069. {
  1070. if(!success)
  1071. {
  1072. SendClientMessage(playerid, 0xF10000FF, "[<!>] Non-existent command. Utilize (/Npc)..");
  1073. }
  1074. return 1;
  1075. }
  1076.  
  1077.  
  1078. CMD:npcgeneral(playerid, params[])
  1079. {
  1080. Dialog_NPC_GENERAL(playerid);
  1081. return 1;
  1082. }
  1083.  
  1084.  
  1085. CMD:npcvehicle(playerid, params[])
  1086. {
  1087. Dialog_NPC_VEHICLE(playerid);
  1088. return 1;
  1089. }
  1090.  
  1091.  
  1092. CMD:npcipeeded(playerid, params[])
  1093. {
  1094. Dialog_NPC_IPeeped(playerid);
  1095. return 1;
  1096. }
  1097.  
  1098.  
  1099.  
  1100. CMD:npcactions(playerid, params[])
  1101. {
  1102. Dialog_NPC_ACTIONS(playerid);
  1103. return 1;
  1104. }
  1105.  
  1106.  
  1107. /*
  1108. CMD:npcrec(playerid, params[])
  1109. {
  1110. Dialog_NPC_REC(playerid);
  1111. return 1;
  1112. }
  1113. */
  1114.  
  1115.  
  1116.  
  1117. CMD:npc(playerid, params[])
  1118. {
  1119. ShowPlayerDialog(playerid, 120, DIALOG_STYLE_MSGBOX, "{00FFFF}Commands RNPC'S.", "{FFFFFF}(/NpcGeneral).\n(/NpcVehicle).\n(/NpcIPeeped).\n(/NpcActions).\n(/NpcRec) {F11515}({FFFFFF}Removed option{F11515}){FFFFFF}.", "Thank you", "");
  1120. return 1;
  1121. }
  1122.  
  1123.  
  1124.  
  1125. CMD:car(playerid, params[])
  1126. {
  1127. new Carro;
  1128. if(sscanf(params, "i", Carro))
  1129. {
  1130. SendClientMessage(playerid, RED, "[INFO] (/Car [VehicleID]).");
  1131. } else {
  1132. new Float:Pos[3], Float:Angle;
  1133. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1134. GetPlayerFacingAngle(playerid, Angle);
  1135. CreateVehicle(Carro, Pos[0], Pos[1]+2.0, Pos[2], Angle, random(128), random(128), 10*60*1000);
  1136. }
  1137. return 1;
  1138. }
  1139.  
  1140.  
  1141.  
  1142. //=============================================================================== STOCK'S ===============================================================================//
  1143. stock Dialog_NPC_GENERAL(playerid)
  1144. {
  1145. ShowPlayerDialog(playerid, NPC_GENERAL, DIALOG_STYLE_LIST, "{00FFFF}Functions of the RNPC.", \
  1146. "{00FF00}GetRNPCID. \n\
  1147. {FFFFFF}GetRNPCState. \n\
  1148. {00FF00}GetRNPCName. \n\
  1149. {FFFFFF}GetRNPCVirtualWorld. \n\
  1150. {00FF00}SetRNPCVirtualWorld.", \
  1151. "To select", "To cancel");
  1152. return 1;
  1153. }
  1154.  
  1155. stock Dialog_NPC_VEHICLE(playerid)
  1156. {
  1157. ShowPlayerDialog(playerid, NPC_VEHICLE, DIALOG_STYLE_LIST, "{00FFFF}Functions of the RNPC.", \
  1158. "{FFFFFF}PutRNPCInVehicle. \n\
  1159. {00FF00}RemoveRNPCFromVehicle. \n\
  1160. {FFFFFF}SetRNPCVehicleSiren. \n\
  1161. {00FF00}GetRNPCVehicleSiren.", \
  1162. "To select", "To cancel");
  1163. return 1;
  1164. }
  1165.  
  1166.  
  1167.  
  1168. stock Dialog_NPC_IPeeped(playerid)
  1169. {
  1170. new string[280];
  1171. strcat(string, "{FFFFFF}SetRNPCSkin. \n");
  1172. strcat(string, "{00FF00}SetRNPCPos.\n");
  1173. strcat(string, "{FFFFFF}GetRNPCPos. \n");
  1174. strcat(string, "{00FF00}MoveRNPC. \n");
  1175. strcat(string, "{FFFFFF}SetRNPCFacingAngle. \n");
  1176. strcat(string, "{00FF00}SetRNPCHealth. \n");
  1177. strcat(string, "{FFFFFF}GetRNPCHealth. \n");
  1178. strcat(string, "{00FF00}SetRNPCArmour. \n");
  1179. strcat(string, "{FFFFFF}GetRNPCArmour. \n");
  1180. strcat(string, "{00FF00}SetRNPCWeapon. \n");
  1181. strcat(string, "{FFFFFF}GetRNPCWeapon. \n");
  1182. strcat(string, "{00FF00}SetRNPCSkillLevel. \n");
  1183. ShowPlayerDialog(playerid, NPC_IPeeped, DIALOG_STYLE_LIST, "{00FFFF}Functions of the RNPC.", string, "To select", "To cancel");
  1184. return 1;
  1185. }
  1186.  
  1187. stock Dialog_NPC_ACTIONS(playerid)
  1188. {
  1189. new string[250];
  1190. strcat(string, "{FFFFFF}RNPCWalkTo. \n");
  1191. strcat(string, "{00FF00}RNPCRunTo. \n");
  1192. strcat(string, "{FFFFFF}RNPCSprintTo. \n");
  1193. strcat(string, "{00FF00}RNPCAimAt. \n");
  1194. strcat(string, "{FFFFFF}RNPCShotAt. \n");
  1195. strcat(string, "{00FF00}RNPCStopUseWeapon. \n");
  1196. strcat(string, "{FFFFFF}RNPCDriveTo. \n");
  1197. strcat(string, "{00FF00}RNPCFollowPlayer. \n");
  1198. ShowPlayerDialog(playerid, NPC_ACTIONS, DIALOG_STYLE_LIST, "{00FFFF}Functions of the RNPC.", string, "To agree", "To cancel");
  1199. return 1;
  1200. }
  1201.  
  1202. /*
  1203. stock Dialog_NPC_REC(playerid)
  1204. {
  1205. new string[70];
  1206. strcat(string, "{FFFFFF}RNPC_StartPlayback. \n");
  1207. strcat(string, "{00FF00}RNPC_StopPlayback. \n");
  1208. strcat(string, "{FFFFFF}RNPC_StartBuildPlayback.");
  1209. ShowPlayerDialog(playerid, NPC_REC, DIALOG_STYLE_LIST, "{00FFFF}Functions of the RNPC.", string, "To select", "To cancel");
  1210. return 1;
  1211. }
  1212. */
  1213. //=======================================================================================================================================================================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement