Advertisement
Guest User

Untitled

a guest
Aug 12th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.32 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4.  
  5. #define COLOR_GREY 0xAFAFAFAA
  6. #define COLOR_RED 0xFF0019FF
  7. #define COLOR_BLUE 0x00FFFAFF
  8. #define COLOR_GREEN 0xB9FF00FF
  9. #define COLOR_YELLOW 0xEBFF00FF
  10. #define COLOR_WHITE 0xFFFFFFAA
  11.  
  12. #if defined FILTERSCRIPT
  13.  
  14.  
  15. new Text:Bootvorbereitung;
  16. new Text:Bootbox;
  17.  
  18. new Text:Ladebalken;
  19. new Text:Ladeprozess[13];
  20.  
  21. forward Updater();
  22.  
  23. new Float:GuardPosis[][3] = {
  24. {-1613.7601,180.6174,-0.3910},
  25. {-1577.4668,193.7632,-0.3038},
  26. {-1534.9955,201.3559,-0.4279},
  27. {-1492.0182,210.6865,-0.4136},
  28. {-1461.6610,210.0977,-0.3842},
  29. {-1429.0758,199.8184,-0.4252},
  30. {-1376.1412,219.1274,-0.2256},
  31. {-1327.7606,262.5111,-0.2964},
  32. {-1271.2504,321.2814,-0.2797},
  33. {-1209.8439,384.3937,-0.3779},
  34. {-1162.0667,433.1101,-0.4589},
  35. {-1143.2809,482.1872,-0.2631},
  36. {-1157.0725,572.1703,-0.2441},
  37. {-1173.7074,659.5290,-0.3608},
  38. {-1208.4756,763.0780,-0.4036},
  39. {-1237.0261,847.3550,-0.4294},
  40. {-1260.8405,921.7414,-0.5126},
  41. {-1256.5515,973.7932,-0.2186},
  42. {-1262.9100,1033.9830,-0.3214},
  43. {-1304.1360,1102.2773,-0.4627},
  44. {-1368.3881,1211.2271,-0.3263},
  45. {-1424.3107,1304.4130,-0.2337},
  46. {-1510.6543,1417.7675,-0.2835},
  47. {-1591.3822,1492.1770,-0.1552},
  48. {-1672.7981,1569.1357,-0.3205},
  49. {-1739.5494,1606.3124,-0.3848},
  50. {-1781.2429,1601.8557,-0.4253},
  51. {-1823.3256,1603.0128,-0.1302},
  52. {-1873.6674,1572.8894,-0.4034},
  53. {-1865.6697,1451.8278,-0.3630}
  54. };
  55.  
  56. public OnFilterScriptInit()
  57. {
  58. print("\n--------------------------------------");
  59. print(" Guardjob by Baba Haft");
  60. print("--------------------------------------\n");
  61. SetTimer("Updater",1000,true);
  62.  
  63. Bootvorbereitung = TextDrawCreate(150.000000, 201.000000, "Dein Kontrollboot wird gerade vorbereitet...");
  64. TextDrawBackgroundColor(Bootvorbereitung, 255);
  65. TextDrawFont(Bootvorbereitung, 1);
  66. TextDrawLetterSize(Bootvorbereitung, 0.470000, 2.800000);
  67. TextDrawColor(Bootvorbereitung, -1);
  68. TextDrawSetOutline(Bootvorbereitung, 0);
  69. TextDrawSetProportional(Bootvorbereitung, 1);
  70. TextDrawSetShadow(Bootvorbereitung, 1);
  71. TextDrawUseBox(Bootvorbereitung, 1);
  72. TextDrawBoxColor(Bootvorbereitung, 255);
  73. TextDrawTextSize(Bootvorbereitung, 640.000000, 0.000000);
  74.  
  75. Bootbox = TextDrawCreate(0.000000, -10.000000, "GUTEN TAG");
  76. TextDrawBackgroundColor(Bootbox, 255);
  77. TextDrawFont(Bootbox, 1);
  78. TextDrawLetterSize(Bootbox, 0.470000, 50.799999);
  79. TextDrawColor(Bootbox, 0);
  80. TextDrawSetOutline(Bootbox, 0);
  81. TextDrawSetProportional(Bootbox, 1);
  82. TextDrawSetShadow(Bootbox, 1);
  83. TextDrawUseBox(Bootbox, 1);
  84. TextDrawBoxColor(Bootbox, 255);
  85. TextDrawTextSize(Bootbox, 640.000000, 50.000000);
  86.  
  87. Ladebalken = TextDrawCreate(575.000000, 412.000000, "Guardbonus");
  88. TextDrawBackgroundColor(Ladebalken, 255);
  89. TextDrawFont(Ladebalken, 2);
  90. TextDrawLetterSize(Ladebalken, 0.240000, 1.800000);
  91. TextDrawColor(Ladebalken, 16777215);
  92. TextDrawSetOutline(Ladebalken, 0);
  93. TextDrawSetProportional(Ladebalken, 1);
  94. TextDrawSetShadow(Ladebalken, 1);
  95.  
  96. Ladeprozess[0] = TextDrawCreate(576.000000, 420.000000, "i");
  97. TextDrawBackgroundColor(Ladeprozess[0], 16777215);
  98. TextDrawFont(Ladeprozess[0], 2);
  99. TextDrawLetterSize(Ladeprozess[0], 0.300000, 3.200000);
  100. TextDrawColor(Ladeprozess[0], 255);
  101. TextDrawSetOutline(Ladeprozess[0], 1);
  102. TextDrawSetProportional(Ladeprozess[0], 1);
  103.  
  104. Ladeprozess[1] = TextDrawCreate(581.000000, 420.000000, "i");
  105. TextDrawBackgroundColor(Ladeprozess[1], 16777215);
  106. TextDrawFont(Ladeprozess[1], 2);
  107. TextDrawLetterSize(Ladeprozess[1], 0.300000, 3.200000);
  108. TextDrawColor(Ladeprozess[1], 255);
  109. TextDrawSetOutline(Ladeprozess[1], 1);
  110. TextDrawSetProportional(Ladeprozess[1], 1);
  111.  
  112. Ladeprozess[2] = TextDrawCreate(586.000000, 420.000000, "i");
  113. TextDrawBackgroundColor(Ladeprozess[2], 16777215);
  114. TextDrawFont(Ladeprozess[2], 2);
  115. TextDrawLetterSize(Ladeprozess[2], 0.300000, 3.200000);
  116. TextDrawColor(Ladeprozess[2], 255);
  117. TextDrawSetOutline(Ladeprozess[2], 1);
  118. TextDrawSetProportional(Ladeprozess[2], 1);
  119.  
  120. Ladeprozess[3] = TextDrawCreate(591.000000, 420.000000, "i");
  121. TextDrawBackgroundColor(Ladeprozess[3], 16777215);
  122. TextDrawFont(Ladeprozess[3], 2);
  123. TextDrawLetterSize(Ladeprozess[3], 0.300000, 3.200000);
  124. TextDrawColor(Ladeprozess[3], 255);
  125. TextDrawSetOutline(Ladeprozess[3], 1);
  126. TextDrawSetProportional(Ladeprozess[3], 1);
  127.  
  128. Ladeprozess[4] = TextDrawCreate(596.000000, 420.000000, "i");
  129. TextDrawBackgroundColor(Ladeprozess[4], 16777215);
  130. TextDrawFont(Ladeprozess[4], 2);
  131. TextDrawLetterSize(Ladeprozess[4], 0.300000, 3.200000);
  132. TextDrawColor(Ladeprozess[4], 255);
  133. TextDrawSetOutline(Ladeprozess[4], 1);
  134. TextDrawSetProportional(Ladeprozess[4], 1);
  135.  
  136. Ladeprozess[5] = TextDrawCreate(601.000000, 420.000000, "i");
  137. TextDrawBackgroundColor(Ladeprozess[5], 16777215);
  138. TextDrawFont(Ladeprozess[5], 2);
  139. TextDrawLetterSize(Ladeprozess[5], 0.300000, 3.200000);
  140. TextDrawColor(Ladeprozess[5], 255);
  141. TextDrawSetOutline(Ladeprozess[5], 1);
  142. TextDrawSetProportional(Ladeprozess[5], 1);
  143.  
  144. Ladeprozess[6] = TextDrawCreate(606.000000, 420.000000, "i");
  145. TextDrawBackgroundColor(Ladeprozess[6], 16777215);
  146. TextDrawFont(Ladeprozess[6], 2);
  147. TextDrawLetterSize(Ladeprozess[6], 0.300000, 3.200000);
  148. TextDrawColor(Ladeprozess[6], 255);
  149. TextDrawSetOutline(Ladeprozess[6], 1);
  150. TextDrawSetProportional(Ladeprozess[6], 1);
  151.  
  152. Ladeprozess[7] = TextDrawCreate(611.000000, 420.000000, "i");
  153. TextDrawBackgroundColor(Ladeprozess[7], 16777215);
  154. TextDrawFont(Ladeprozess[7], 2);
  155. TextDrawLetterSize(Ladeprozess[7], 0.300000, 3.200000);
  156. TextDrawColor(Ladeprozess[7], 255);
  157. TextDrawSetOutline(Ladeprozess[7], 1);
  158. TextDrawSetProportional(Ladeprozess[7], 1);
  159.  
  160. Ladeprozess[8] = TextDrawCreate(616.000000, 420.000000, "i");
  161. TextDrawBackgroundColor(Ladeprozess[8], 16777215);
  162. TextDrawFont(Ladeprozess[8], 2);
  163. TextDrawLetterSize(Ladeprozess[8], 0.300000, 3.200000);
  164. TextDrawColor(Ladeprozess[8], 255);
  165. TextDrawSetOutline(Ladeprozess[8], 1);
  166. TextDrawSetProportional(Ladeprozess[8], 1);
  167.  
  168. Ladeprozess[9] = TextDrawCreate(621.000000, 420.000000, "i");
  169. TextDrawBackgroundColor(Ladeprozess[9], 16777215);
  170. TextDrawFont(Ladeprozess[9], 2);
  171. TextDrawLetterSize(Ladeprozess[9], 0.300000, 3.200000);
  172. TextDrawColor(Ladeprozess[9], 255);
  173. TextDrawSetOutline(Ladeprozess[9], 1);
  174. TextDrawSetProportional(Ladeprozess[9], 1);
  175.  
  176. Ladeprozess[10] = TextDrawCreate(626.000000, 420.000000, "i");
  177. TextDrawBackgroundColor(Ladeprozess[10], 16777215);
  178. TextDrawFont(Ladeprozess[10], 2);
  179. TextDrawLetterSize(Ladeprozess[10], 0.300000, 3.200000);
  180. TextDrawColor(Ladeprozess[10], 255);
  181. TextDrawSetOutline(Ladeprozess[10], 1);
  182. TextDrawSetProportional(Ladeprozess[10], 1);
  183.  
  184. Ladeprozess[11] = TextDrawCreate(631.000000, 420.000000, "i");
  185. TextDrawBackgroundColor(Ladeprozess[11], 16777215);
  186. TextDrawFont(Ladeprozess[11], 2);
  187. TextDrawLetterSize(Ladeprozess[11], 0.300000, 3.200000);
  188. TextDrawColor(Ladeprozess[11], 255);
  189. TextDrawSetOutline(Ladeprozess[11], 1);
  190. TextDrawSetProportional(Ladeprozess[11], 1);
  191.  
  192. Ladeprozess[12] = TextDrawCreate(636.000000, 420.000000, "i");
  193. TextDrawBackgroundColor(Ladeprozess[12], 16777215);
  194. TextDrawFont(Ladeprozess[12], 2);
  195. TextDrawLetterSize(Ladeprozess[12], 0.300000, 3.200000);
  196. TextDrawColor(Ladeprozess[12], 255);
  197. TextDrawSetOutline(Ladeprozess[12], 1);
  198. TextDrawSetProportional(Ladeprozess[12], 1);
  199. return 1;
  200. }
  201. public OnFilterScriptExit()
  202. {
  203. return 1;
  204. }
  205. public OnPlayerConnect(playerid)
  206. {
  207. SetPVarInt(playerid,"GuardingCP",-1);
  208. SetPVarInt(playerid,"Oldskin",-1);
  209. SetPVarInt(playerid,"Kontrollboot",-1);
  210. SetPVarInt(playerid,"CarNow",-1);
  211. SetPVarInt(playerid,"LadenProzess",-1);
  212. return 1;
  213. }
  214. public OnPlayerDeath(playerid, killerid, reason)
  215. {
  216. return 1;
  217. }
  218.  
  219. public OnVehicleDeath(vehicleid, killerid)
  220. {
  221. return 1;
  222. }
  223.  
  224. public OnPlayerCommandText(playerid, cmdtext[])
  225. {
  226. if(strcmp(cmdtext,"/guardbeach",true)==0)
  227. {
  228. if(IsPlayerInRangeOfPoint(playerid,1.0,-1624.0958,154.7776,3.5547))
  229. {
  230. if(GetPVarInt(playerid,"StartedGuarding")==1)return SendClientMessage(playerid, COLOR_GREY," Du bist schon dabei das Meer zu kontrollieren. ");
  231. SetPVarInt(playerid,"StartedGuarding",1);
  232. SetPVarInt(playerid,"KontrollbootVorbereitung",5);
  233. SendClientMessage(playerid, COLOR_RED," Dir wird ein Kontrollboot vorbereitet. Dies wird circa 5 Sekunden dauern. ");
  234. TextDrawShowForPlayer(playerid, Bootvorbereitung);
  235. TextDrawShowForPlayer(playerid, Bootbox);
  236. SetPlayerVirtualWorld(playerid, 2);
  237. SetPVarInt(playerid,"Oldskin",GetPlayerSkin(playerid));
  238. SetPlayerSkin(playerid, 261);
  239. }
  240. else SendClientMessage(playerid, COLOR_GREY," Du befindest dich nicht an der Guard-Position. Benutze /guardposition um die Position auf der Karte zu markieren. ");
  241. return 1;
  242. }
  243. if(strcmp(cmdtext,"/guardposition",true)==0)
  244. {
  245. SendClientMessage(playerid, COLOR_WHITE, " Ziel gesetzt. Fahre dorthin und gebe /guardbeach ein um die Meerkontrolle zu starten. ");
  246. SetPlayerCheckpoint(playerid, -1624.0958,154.7776,3.5547, 1.0);
  247. SetPlayerPos(playerid,-1624.0958,154.7776,3.5547);
  248. return 1;
  249. }
  250. return 0;
  251. }
  252. public Updater()
  253. {
  254. for(new i; i < GetMaxPlayers(); i++)
  255. {
  256. if(GetPVarInt(i,"StartedGuarding")==1)
  257. {
  258. SetPVarInt(i,"GuardTime",GetPVarInt(i,"GuardTime")+1);
  259. if(GetPVarInt(i,"GuardTime")==14)
  260. {
  261. TextDrawShowForPlayer(i, Ladeprozess[GetPVarInt(i,"LadenProzess")]);
  262. SetPVarInt(i,"LadenProzess",GetPVarInt(i,"LadenProzess")+1);
  263. SetPVarInt(i,"GuardTime",0);
  264. }
  265. }
  266. if(GetPVarInt(i,"KontrollbootVorbereitung") > 0)
  267. {
  268. if(GetPVarInt(i,"KontrollbootVorbereitung") >= 0)
  269. {
  270. SetPVarInt(i,"KontrollbootVorbereitung",GetPVarInt(i,"KontrollbootVorbereitung")-1);
  271. }
  272. if(GetPVarInt(i,"KontrollbootVorbereitung")==0)
  273. {
  274. SetPVarInt(i,"KontrollbootVorbereitung",0);
  275. SetPVarInt(i,"GuardingCP",0);
  276. SendClientMessage(i, COLOR_WHITE," Job-Information: Du hast deine Arbeitskleidung angezogen. Nach der Meerkontrolle erhälst Du deine alten Kleider zurück. ");
  277. SendClientMessage(i, COLOR_WHITE, "");
  278. SendClientMessage(i, COLOR_GREEN," Bitte fahre nun die aufleuchtenden Checkpoints ab um das Meer zu kontrollieren. Bei unsicheren Orten wirst Du sie automatisch ");
  279. SendClientMessage(i, COLOR_GREEN," kontrollieren. Wenn Du die Kontrolle, bevor der Ladebalken dort das Maximum erreicht, abschließst, erhälst Du einen kleinen Bonus dazu. ");
  280. SendClientMessage(i, COLOR_WHITE,"");
  281. SendClientMessage(i, COLOR_RED," Viel Glück nun. ");
  282. SetPVarInt(i,"Kontrollboot",CreateVehicle(472,-1632.7236,161.6849,-0.3614,316.1652, 0, 0, -1));
  283. PutPlayerInVehicle(i, GetPVarInt(i,"Kontrollboot"),PLAYER_STATE_DRIVER);
  284. TextDrawHideForPlayer(i, Bootvorbereitung);
  285. TextDrawHideForPlayer(i, Bootbox);
  286. GameTextForPlayer(i, "~g~ Fahre die Checkpoints ab ~n~ um das Meer zu kontrollieren",3000,3);
  287. SetPlayerVirtualWorld(i, 0);
  288. new cp = GetPVarInt(i,"GuardingCP");
  289. SetPlayerCheckpoint(i, GuardPosis[cp][0],GuardPosis[cp][1],GuardPosis[cp][2],10.0);
  290. TextDrawShowForPlayer(i, Ladebalken);
  291. SetPVarInt(i,"LadenProzess",0);
  292. }
  293.  
  294. }
  295. if(GetPVarInt(i,"Nachschauen") > 0)
  296. {
  297. if(GetPVarInt(i,"Nachschauen") >= 0)
  298. {
  299. SetPVarInt(i,"Nachschauen",GetPVarInt(i,"Nachschauen")-1);
  300. SetVehicleSpeed(GetPlayerVehicleID(i),0);
  301. }
  302. if(GetPVarInt(i,"Nachschauen")==0)
  303. {
  304. SetPVarInt(i,"Nachschauen",0);
  305. SetCameraBehindPlayer(i);
  306. TogglePlayerControllable(i, 1);
  307. new arbeit = random(4);
  308. if(arbeit == 3)
  309. {
  310. GameTextForPlayer(i,"~g~Dort waren einige Komplikationen ~n~Du hast alles geregelt.", 3000, 3);
  311. new belohnung = random(150);
  312. new string[28];
  313. format(string, sizeof(string)," Kleine Belohnung: $%d ", belohnung);
  314. SendClientMessage(i, COLOR_GREEN, string);
  315. GivePlayerMoney(i, belohnung);
  316. }
  317. else
  318. {
  319. GameTextForPlayer(i,"~g~Dort war alles sicher",3000,3);
  320. }
  321. }
  322. }
  323. }
  324. return 1;
  325. }
  326. public OnPlayerStateChange(playerid, newstate, oldstate)
  327. {
  328. if(newstate == PLAYER_STATE_DRIVER) { SetPVarInt(playerid,"CarNow",GetPlayerVehicleID(playerid)); }
  329. if(oldstate == PLAYER_STATE_DRIVER)
  330. {
  331. if(GetPVarInt(playerid,"CarNow") == GetPVarInt(playerid,"Kontrollboot"))
  332. {
  333. DestroyVehicle(GetPVarInt(playerid,"Kontrollboot"));
  334. GameTextForPlayer(playerid,"~r~Meerkontrolle gescheitert",3000,3);
  335. SetPVarInt(playerid, "Kontrollboot",-1);
  336. SetPlayerSkin(playerid, GetPVarInt(playerid,"Oldskin"));
  337. SetPVarInt(playerid,"GuardingCP",-1);
  338. SetPVarInt(playerid,"StartedGuarding",0);
  339. DisablePlayerCheckpoint(playerid);
  340. SetPVarInt(playerid,"LadenProzess",-1);
  341. TextDrawHideForPlayer(playerid, Ladebalken);
  342. TextDrawHideForPlayer(playerid, Ladeprozess[0]);
  343. TextDrawHideForPlayer(playerid, Ladeprozess[1]);
  344. TextDrawHideForPlayer(playerid, Ladeprozess[2]);
  345. TextDrawHideForPlayer(playerid, Ladeprozess[3]);
  346. TextDrawHideForPlayer(playerid, Ladeprozess[4]);
  347. TextDrawHideForPlayer(playerid, Ladeprozess[5]);
  348. TextDrawHideForPlayer(playerid, Ladeprozess[6]);
  349. TextDrawHideForPlayer(playerid, Ladeprozess[7]);
  350. TextDrawHideForPlayer(playerid, Ladeprozess[8]);
  351. TextDrawHideForPlayer(playerid, Ladeprozess[9]);
  352. TextDrawHideForPlayer(playerid, Ladeprozess[10]);
  353. TextDrawHideForPlayer(playerid, Ladeprozess[11]);
  354. TextDrawHideForPlayer(playerid, Ladeprozess[12]);
  355. }
  356. }
  357. return 1;
  358. }
  359.  
  360. public OnPlayerEnterCheckpoint(playerid)
  361. {
  362. new cp = GetPVarInt(playerid,"GuardingCP");
  363. if(IsPlayerInRangeOfPoint(playerid, 10.0, GuardPosis[cp][0], GuardPosis[cp][1], GuardPosis[cp][2]))
  364. {
  365. if(GetPVarInt(playerid,"GuardingCP")==29)
  366. {
  367. DisablePlayerCheckpoint(playerid);
  368. new string[50];
  369. DestroyVehicle(GetPVarInt(playerid,"Kontrollboot"));
  370. new belohnung = random(1500);
  371. GivePlayerMoney(playerid, belohnung);
  372.  
  373. format(string, sizeof(string),"~w~Belohnung: ~g~$%d",belohnung);
  374. GameTextForPlayer(playerid, string, 5000, 1);
  375. SendClientMessage(playerid, COLOR_GREEN," Der Staat bedankt sich für dein freiwilliges Engagement. „Er hat gute Arbeit geleistet!“, so der Präsident. ");
  376.  
  377. SetPVarInt(playerid, "Kontrollboot",-1);
  378. SetPlayerSkin(playerid, GetPVarInt(playerid,"Oldskin"));
  379. SetPVarInt(playerid,"GuardingCP",-1);
  380. SetPVarInt(playerid,"StartedGuarding",0);
  381. SetPlayerPos(playerid,-1879.7826,1441.7073,7.1809);
  382. SetPlayerFacingAngle(playerid,226.1267);
  383. SetCameraBehindPlayer(playerid);
  384.  
  385. if(GetPVarInt(playerid,"LadenProzess") < 12)
  386. {
  387. SendClientMessage(playerid, COLOR_GREY," Da Du die Meerkontrolle bevor der Ladebalken voll geworden ist abgeschlossen hast, erhälst Du einen Bonus von $1500. ");
  388. GivePlayerMoney(playerid, 1500);
  389. }
  390. SetPVarInt(playerid,"LadenProzess",-1);
  391. TextDrawHideForPlayer(playerid, Ladebalken);
  392. TextDrawHideForPlayer(playerid, Ladeprozess[0]);
  393. TextDrawHideForPlayer(playerid, Ladeprozess[1]);
  394. TextDrawHideForPlayer(playerid, Ladeprozess[2]);
  395. TextDrawHideForPlayer(playerid, Ladeprozess[3]);
  396. TextDrawHideForPlayer(playerid, Ladeprozess[4]);
  397. TextDrawHideForPlayer(playerid, Ladeprozess[5]);
  398. TextDrawHideForPlayer(playerid, Ladeprozess[6]);
  399. TextDrawHideForPlayer(playerid, Ladeprozess[7]);
  400. TextDrawHideForPlayer(playerid, Ladeprozess[8]);
  401. TextDrawHideForPlayer(playerid, Ladeprozess[9]);
  402. TextDrawHideForPlayer(playerid, Ladeprozess[10]);
  403. TextDrawHideForPlayer(playerid, Ladeprozess[11]);
  404. TextDrawHideForPlayer(playerid, Ladeprozess[12]);
  405. }
  406. else
  407. {
  408. new arbeit = random(3);
  409. if(arbeit == 0)
  410. {
  411. DisablePlayerCheckpoint(playerid);
  412. SetPVarInt(playerid,"GuardingCP",GetPVarInt(playerid,"GuardingCP")+1);
  413. SetPlayerCheckpoint(playerid, GuardPosis[GetPVarInt(playerid,"GuardingCP")][0], GuardPosis[GetPVarInt(playerid,"GuardingCP")][1], GuardPosis[GetPVarInt(playerid,"GuardingCP")][2], 10.0);
  414. GameTextForPlayer(playerid, "~r~Hier wirkt es etwas unsicher ~n~Du wirst kurz nachschauen",8500,3);
  415. SetPVarInt(playerid,"Nachschauen",8);
  416. new Float:x, Float:y, Float:z;
  417. GetPlayerPos(playerid, x, y, z);
  418. SetPlayerCameraPos(playerid, x, y, z+20);
  419. SetPlayerCameraLookAt(playerid, x, y, z);
  420. TogglePlayerControllable(playerid, 0);
  421. SetVehicleSpeed(GetPlayerVehicleID(playerid),0);
  422. }
  423. else
  424. {
  425. DisablePlayerCheckpoint(playerid);
  426. SetPVarInt(playerid,"GuardingCP",GetPVarInt(playerid,"GuardingCP")+1);
  427. SetPlayerCheckpoint(playerid, GuardPosis[GetPVarInt(playerid,"GuardingCP")][0], GuardPosis[GetPVarInt(playerid,"GuardingCP")][1], GuardPosis[GetPVarInt(playerid,"GuardingCP")][2], 10.0);
  428. }
  429. }
  430. }
  431. return 1;
  432. }
  433. stock SetVehicleSpeed(vehicleid,mph)
  434. {
  435. new Float:Vx,Float:Vy,Float:Vz,Float:DV,Float:multiple;
  436. GetVehicleVelocity(vehicleid,Vx,Vy,Vz);
  437. DV = floatsqroot(Vx*Vx + Vy*Vy + Vz*Vz);
  438. if(DV > 0)
  439. {
  440. multiple = (mph / (DV * 100));
  441. return SetVehicleVelocity(vehicleid,Vx*multiple,Vy*multiple,Vz*multiple);
  442. }
  443. return 0;
  444. }
  445. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement