Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.26 KB | None | 0 0
  1. #emit stack 0x7FFFFFFF // wtf (1) (stack over... overf*ck!?)
  2. #emit inc.s cellmax // wtf (2) (this one should probably make DeAMX allocate all available memory and lag forever)
  3. static const ___[][] = {"pro-pawn", ".ru"}; // pretty old anti-deamx trick
  4. #emit retn
  5. #emit load.s.pri ___ // wtf (3) (opcode outside of function?)
  6. #emit proc // wtf (4) (if DeAMX hasn't crashed already, it would think it is a new function)
  7. #emit proc // wtf (5) (a function inside of another function!?)
  8. #emit fill cellmax // wtf (6) (fill random memory block with 0xFFFFFFFF)
  9. #emit proc
  10. #emit stack 1 // wtf (7) (compiler usually allocates 4 bytes or 4*N for arrays of N elements)
  11. #emit stor.alt ___ // wtf (8) (...)
  12. #emit strb.i 2 // wtf (9)
  13. #emit switch 4
  14. #emit retn // wtf (10) (no "casetbl" opcodes before retn - invalid switch statement?)
  15. L1:
  16. #emit jump L1 // avoid compiler crash from "#emit switch"
  17. #emit zero cellmin // wtf (11) (nonexistent address)
  18. }
  19.  
  20. #include <a_samp>
  21. ///#include <dc_cmd>
  22. ///#include <streamer>
  23. ///#include <sscanf2>
  24. //#include <color>
  25. #include <a_http>
  26.  
  27. #define FILTERSCRIPT //Supposing that this is a FS.
  28.  
  29. static PlayerText:PTD_TrainSpeed[MAX_PLAYERS]={PlayerText:-1, ...};
  30. static PTD_Train_Timer[MAX_PLAYERS]={-1, ...};
  31. static PWaitDepo[MAX_PLAYERS]={-1, ...};
  32. static PWaitDepo_Count[MAX_PLAYERS]={0, ...};
  33. #define PointToPointEX_T(%0,%1,%2,%3,%4,%5) floatsqroot(floatpower(floatabs(floatsub(%3,%0)),2)+floatpower(floatabs(floatsub(%4,%1)),2)+floatpower(floatabs(floatsub(%5,%2)),2))
  34. #define DIALOG_DEPO_START 9444
  35. #define MAX_D_COORDS 500
  36.  
  37.  
  38.  
  39. static Text3D:TramText[MAX_PLAYERS]={Text3D:-1, ...};
  40.  
  41. enum _depo_coordination_data
  42. {
  43. Float:D_COORDS_POS[4],
  44. D_COORDS_NAME[32],
  45. Float:D_CHECK_POS[3],
  46.  
  47. }
  48. static _depo_coordination[9][_depo_coordination_data]={
  49. {{-2364.0280,515.1331,29.5515,359.6405},"Управление ФБР", {-2350.5547,508.5157,29.6005}}, // 0
  50. {{-2014.5296,152.9299,28.1875,267.8124},"ЖД Вокзал", {-2006.5013,138.8349,27.5391}}, // 1
  51. {{-1995.0206,486.2850,35.6640,270.2356},"Здание МВД", {-2003.9078,472.9756,35.0156}}, // 2
  52. {{-1855.1552,596.2886,35.6718,179.4586},"Радиоцентр", {-1868.7422,602.8367,35.0156}}, // 3
  53. {{-1620.8808,722.0050,15.0411,181.2602},"Управление\nполиции", {-1635.9958,729.0737,14.4609}}, // 4
  54. {{-1995.5501,888.2785,45.9453,266.1503},"Восточная\nплощадь", {-2001.5272,876.7241,45.2969}}, // 5
  55. {{-1527.4239,968.1269,7.6952,295.4263},"Банк", {-1531.8258,952.6825,7.0468}}, // 6
  56. {{-1632.9913,1259.2442,7.6782,312.4021},"Автосалон", {-1625.8931,1239.1239,7.0468}}, // 7
  57. {{-2275.8642,1068.9594,81.9505,449.3247},"Северная", {-2265.3455,1087.2888,79.8594}} // 8
  58. };
  59.  
  60. public OnFilterScriptInit()
  61. {
  62. //AddPlayerClass(0,-2275.5374,540.8391,35.1033,86.4772,0,0,0,0,0,0); // info
  63. /// AddPlayerClass(78,-2275.7336,526.8129,35.1159,88.9544,0,0,0,0,0,0); // dress
  64.  
  65. /* LimitGlobalChatRadius(13.0);
  66. SetNameTagDrawDistance(30.0);
  67. LimitPlayerMarkerRadius(70.0);
  68. ManualVehicleEngineAndLights();
  69. EnableStuntBonusForAll(0);
  70. DisableInteriorEnterExits();
  71. ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED);
  72. SetGravity(0.012); */
  73.  
  74. Create3DTextLabel("{862682}Водитель трамвая\n{38a772}Информация",-1,-2275.5374,540.8391,35.1033 + 0.8,10.0,0);
  75. CreatePickup(1239,1,-2275.5374,540.8391,35.1033, 0);
  76. Create3DTextLabel("{862682}Водитель трамвая\n{a3891e}Начало работы",-1,-2275.5374,526.8129,35.1159 + 0.8,10.0,0);
  77. CreatePickup(1275,1,-2275.5374,526.8129,35.1159, 0);
  78. new depo_table,format_string_depo[64];
  79. depo_table = CreateObject(19479, -2276.610107, 534.017639, 39.915630, 0.000000, 0.000000, 360.000000, 300.00);
  80. SetObjectMaterialText(depo_table, "Трамвайное\nдепо", 0, 120, "Ariel", 48, 1, 0xFF800000, 0x00000000, 1);
  81. for(new i=0;i<9;i++)
  82. {
  83. depo_table = CreateObject(8530, _depo_coordination[i][D_COORDS_POS][0], _depo_coordination[i][D_COORDS_POS][1], _depo_coordination[i][D_COORDS_POS][2] + 0.5, 0.000000, 0.000000, _depo_coordination[i][D_COORDS_POS][3], 300.00);
  84. format(format_string_depo, sizeof(format_string_depo), "Остановка\nтрамвая\n{ff9900}%s", _depo_coordination[i][D_COORDS_NAME]);
  85. SetObjectMaterialText(depo_table, format_string_depo,0, 130, "Ariel", 60, 1, 0xFFFFFFFF, 0xFF4B0082, 1);
  86. }
  87. return 1;
  88. }
  89.  
  90. stock timec(timestamp, compare = -1) {
  91. if (compare == -1) {
  92. compare = gettime();
  93. }
  94. new
  95. n,
  96. // on the following line, I have removed the need for the diff() function.
  97. // if you want to use the diff() function in pawn, replace the following with:
  98. // Float:d = diff(timestamp, compare),
  99. Float:d = (timestamp > compare) ? timestamp - compare : compare - timestamp,
  100. returnstr[32];
  101. if (d < 60) {
  102. format(returnstr, sizeof(returnstr), "< 1 minute");
  103. return returnstr;
  104. } else if (d < 3600) { // 3600 = 1 hour
  105. n = floatround(floatdiv(d, 60.0), floatround_floor);
  106. format(returnstr, sizeof(returnstr), "minute");
  107. } else if (d < 86400) { // 86400 = 1 day
  108. n = floatround(floatdiv(d, 3600.0), floatround_floor);
  109. format(returnstr, sizeof(returnstr), "hour");
  110. } else if (d < 2592000) { // 2592000 = 1 month
  111. n = floatround(floatdiv(d, 86400.0), floatround_floor);
  112. format(returnstr, sizeof(returnstr), "day");
  113. } else if (d < 31536000) { // 31536000 = 1 year
  114. n = floatround(floatdiv(d, 2592000.0), floatround_floor);
  115. format(returnstr, sizeof(returnstr), "month");
  116. } else {
  117. n = floatround(floatdiv(d, 31536000.0), floatround_floor);
  118. format(returnstr, sizeof(returnstr), "year");
  119. }
  120. if (n == 1) {
  121. format(returnstr, sizeof(returnstr), "1 %s", returnstr);
  122. } else {
  123. format(returnstr, sizeof(returnstr), "%d %ss", n, returnstr);
  124. }
  125. return returnstr;
  126. }
  127.  
  128. stock split(const strsrc[], strdest[][], delimiter)
  129. {
  130. new i, li;
  131. new aNum;
  132. new len;
  133. while(i <= strlen(strsrc)){
  134. if(strsrc[i]==delimiter || i==strlen(strsrc)){
  135. len = strmid(strdest[aNum], strsrc, li, i, 128);
  136. strdest[aNum][len] = 0;
  137. li = i+1;
  138. aNum++;
  139. }
  140. i++;
  141. }
  142. return 1;
  143. }
  144. /*CMD:create_ost_depo(playerid, params[])
  145. {
  146. new name_train_ost[32], Float:pos[4], tmpobjid_2;
  147. if(sscanf(params, "s[32]", name_train_ost)) return SendClientMessage(playerid,-1,"/create_ost_depo [name]");
  148. GetPlayerPos(playerid, pos[0],pos[1],pos[2]);
  149. GetPlayerFacingAngle(playerid, pos[3]);
  150. tmpobjid_2 = CreateDynamicObject(8530, pos[0],pos[1],pos[2] + 0.5, 0.000000, 0.000000, pos[3] + 90.0, -1, -1, -1, 300.00, 300.00);
  151. new format_string_depo[16 + 64];
  152. format(format_string_depo, sizeof(format_string_depo), "Остановка\nтрамвая\n{ff9900}%s", name_train_ost);
  153. SetDynamicObjectMaterialText(tmpobjid_2, 0, format_string_depo, 130, "Ariel", 60, 1, 0xFFFFFFFF, 0xFF4B0082, 1);
  154. new File:depo_coordination_write = fopen("depo_coordination_load_file.cfg", io_append);
  155. new depo_coordination_write_string[64];
  156. format(depo_coordination_write_string, sizeof(depo_coordination_write_string), "%.4f|%.4f|%.4f|%.4f|%s\n",pos[0],pos[1],pos[2] + 0.5, pos[3] + 90.0, name_train_ost);
  157. fwriteex(depo_coordination_write, depo_coordination_write_string);
  158. fclose(depo_coordination_write);
  159. _depo_coordination[TotalDepoCoord][D_COORDS_POS][0] = pos[0];
  160. _depo_coordination[TotalDepoCoord][D_COORDS_POS][1] = pos[1];
  161. _depo_coordination[TotalDepoCoord][D_COORDS_POS][2] = pos[2] + 0.5;
  162. _depo_coordination[TotalDepoCoord][D_COORDS_POS][3] = pos[3] + 90.0;
  163. strmid(_depo_coordination[TotalDepoCoord][D_COORDS_NAME], name_train_ost, 0, strlen(name_train_ost), 16);
  164. TotalDepoCoord++;
  165.  
  166. return 1;
  167. }
  168. */
  169. public OnPlayerStateChange(playerid, newstate, oldstate)
  170. {
  171. if ( oldstate == PLAYER_STATE_PASSENGER )
  172. {
  173. static i;
  174. i = GetPVarInt(playerid, "driverid");
  175. CallRemoteFunction("OnExitPassengerTram", "iii", i, playerid, GetPVarInt(i, "sum"));
  176. DeletePVar(playerid,"driverid");
  177. }
  178. if ( newstate == PLAYER_STATE_PASSENGER )
  179. {
  180. for(new i=0;i<MAX_PLAYERS;i++)
  181. {
  182. if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid) && GetPlayerState(i) == 2 && GetPlayerVehicleID(playerid) == GetPVarInt(i, "_depo"))
  183. {
  184. CallRemoteFunction("OnEnterPassengerTram", "iii", i, playerid, GetPVarInt(i, "sum"));
  185. SetPVarInt(playerid, "driverid", i);
  186. break;
  187. }
  188. }
  189. }
  190. if ( newstate == PLAYER_STATE_ONFOOT && GetPVarInt(playerid, "_depo") && oldstate != PLAYER_STATE_SPAWNED && oldstate != PLAYER_STATE_WASTED )
  191. {
  192. SetCameraBehindPlayer(playerid);
  193. SetPVarInt(playerid, "_depo_false_unix", 31 );
  194. SetPVarInt(playerid, "_depo_false_timer", SetTimerEx( "_depo_false_timer_", 990, 1, "i", playerid ) ) ;
  195. }
  196. else if ( newstate == PLAYER_STATE_DRIVER )
  197. {
  198. if ( GetPVarInt(playerid, "_depo_false_timer") )
  199. {
  200. KillTimer ( GetPVarInt(playerid, "_depo_false_timer") ) ;
  201. DeletePVar(playerid, "_depo_false_unix" ) ;
  202. DeletePVar(playerid, "_depo_false_timer" ) ;
  203. }
  204. }
  205.  
  206. return 1;
  207. }
  208. public OnPlayerDisconnect(playerid, reason)
  209. {
  210. if ( GetPVarInt(playerid, "_depo_false_timer") ) KillTimer ( GetPVarInt(playerid, "_depo_false_timer") ) ;
  211. if (GetPVarInt(playerid, "_depo"))
  212. {
  213. CallRemoteFunction("OnFinishTramJob", "i", playerid);
  214. DestroyVehicle(GetPVarInt(playerid, "_depo"));
  215. }
  216. if ( PTD_TrainSpeed[playerid] != PlayerText:-1 )
  217. {
  218. PlayerTextDrawDestroy(playerid, PTD_TrainSpeed[playerid] ) ;
  219. PTD_TrainSpeed[playerid] = PlayerText:-1;
  220. }
  221. if ( TramText[playerid] != Text3D:-1 )
  222. {
  223. Delete3DTextLabel(TramText[playerid]);
  224. TramText[playerid] = Text3D:-1;
  225. }
  226. if ( PTD_Train_Timer[playerid] != -1 )
  227. {
  228. KillTimer( PTD_Train_Timer[playerid] ) ;
  229. PTD_Train_Timer[playerid] = -1;
  230. }
  231. return 1;
  232. }
  233.  
  234. forward _depo_false_timer_(playerid);
  235. public _depo_false_timer_(playerid)
  236. {
  237. static str_depo_false_timer[10];
  238. SetPVarInt(playerid, "_depo_false_unix", GetPVarInt(playerid, "_depo_false_unix") - 1 );
  239.  
  240. if ( GetPVarInt(playerid, "_depo_false_unix") <= 0 )
  241. {
  242. CallRemoteFunction("OnFinishTramJob", "i", playerid);
  243. if(GetPVarInt(playerid, "_depo"))
  244. {
  245. DestroyVehicle(GetPVarInt(playerid, "_depo"));
  246. DeletePVar(playerid, "_depo");
  247. GameTextForPlayer(playerid, "~r~~h~End", 1000, 6);
  248. }
  249. if ( PTD_TrainSpeed[playerid] != PlayerText:-1 )
  250. {
  251. PlayerTextDrawDestroy(playerid, PTD_TrainSpeed[playerid] ) ;
  252. PTD_TrainSpeed[playerid] = PlayerText:-1;
  253. }
  254. if ( TramText[playerid] != Text3D:-1 )
  255. {
  256. Delete3DTextLabel(TramText[playerid]);
  257. TramText[playerid] = Text3D:-1;
  258. }
  259. if ( PTD_Train_Timer[playerid] != -1 )
  260. {
  261. KillTimer( PTD_Train_Timer[playerid] ) ;
  262. PTD_Train_Timer[playerid] = -1;
  263. }
  264. KillTimer ( GetPVarInt(playerid, "_depo_false_timer") ) ;
  265. DeletePVar(playerid, "_depo_false_unix" ) ;
  266. DeletePVar(playerid, "_depo_false_timer" ) ;
  267. }
  268. else
  269. {
  270. format(str_depo_false_timer,10, "~r~~h~%i",GetPVarInt(playerid,"_depo_false_unix"));
  271. GameTextForPlayer(playerid, str_depo_false_timer, 1000, 6);
  272. }
  273. return 1;
  274. }
  275.  
  276.  
  277.  
  278. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  279. {
  280. if ( newkeys & KEY_SECONDARY_ATTACK )
  281. {
  282. if(GetPVarInt(playerid, "_depo") && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT )
  283. {
  284. static Float:x, Float:y, Float:z;
  285. GetVehiclePos(GetPVarInt(playerid, "_depo"), x,y,z);
  286. if(IsPlayerInRangeOfPoint(playerid,3.0,x,y,z))PutPlayerInVehicle(playerid,GetPVarInt(playerid, "_depo"),0 ) ;
  287. }
  288. }
  289. return 1;
  290. }
  291.  
  292. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  293. {
  294. SetPVarInt(playerid,"info_depo_0", gettime() + 3);
  295. if ( response ) SetPVarInt(playerid,"info_depo_1", gettime() + 5);
  296. else SetPVarInt(playerid,"info_depo_1", gettime() + 3);
  297. switch(dialogid)
  298. {
  299. case DIALOG_DEPO_START:
  300. {
  301. if ( !response ) return 1;
  302. static sum, vehicleid;
  303. sum = strval(inputtext);
  304. if( !strlen(inputtext) || !sum ) return ShowPlayerDialog(playerid, DIALOG_DEPO_START, DIALOG_STYLE_INPUT, "{ffff00}Водитель трамвая", "{ffffff}Укажите стоимость проезда {2e9971}(от 0 до 100$){ffffff}:", "Начать", "Отмена");
  305. if ( sum < 1 || sum > 100 ) return ShowPlayerDialog(playerid, DIALOG_DEPO_START, DIALOG_STYLE_INPUT, "{ffff00}Водитель трамвая", "{ffffff}Укажите стоимость проезда {2e9971}(от 0 до 100$){ffffff}:", "Начать", "Отмена");
  306. vehicleid = CreateVehicle(449,-2264.6973,528.4822,35.5862,180.0,1,1,1);
  307. SetPVarInt(playerid, "_depo", vehicleid );
  308. PutPlayerInVehicle(playerid,vehicleid, 0);
  309. SetVehicleParamsEx(vehicleid, true, false, false, false, false, false, false);
  310. if ( PTD_TrainSpeed[playerid] == PlayerText:-1 )
  311. {
  312. PTD_TrainSpeed[playerid] = CreatePlayerTextDraw(playerid, 529.666442, 385.362945,"~g~~h~0 KM/H");
  313. PlayerTextDrawLetterSize(playerid, PTD_TrainSpeed[playerid], 0.364333, 2.242962);
  314. PlayerTextDrawTextSize(playerid, PTD_TrainSpeed[playerid], 606.999938, 229.807434);
  315. PlayerTextDrawUseBox(playerid, PTD_TrainSpeed[playerid], true);
  316. PlayerTextDrawBoxColor(playerid, PTD_TrainSpeed[playerid], 145);
  317. PlayerTextDrawBackgroundColor(playerid, PTD_TrainSpeed[playerid], 51);
  318. PlayerTextDrawFont(playerid, PTD_TrainSpeed[playerid], 2);
  319. }
  320. PlayerTextDrawShow(playerid, PTD_TrainSpeed[playerid]);
  321. PTD_Train_Timer[playerid] = SetTimerEx("UpdateTrainSpeed", 200, 1, "i", playerid);
  322. SetPlayerRaceCheckpoint(playerid,1,_depo_coordination[0][D_CHECK_POS][0],_depo_coordination[0][D_CHECK_POS][1],_depo_coordination[0][D_CHECK_POS][2],0.0,0.0,0.0,5.0);
  323. SetPVarInt(playerid, "tramprice", sum);
  324. static tram_text_string[73 + 32 + 10];
  325. format(tram_text_string, sizeof(tram_text_string), "\n{ffffff}Следующая остановка:\n{d79756}%s\n\n{ffffff}Проезд: {349a66}%d$", _depo_coordination[0][D_COORDS_NAME],sum);
  326. TramText [ playerid ] = Create3DTextLabel(tram_text_string, -1, 7.77, 7.77, 7.77, 100.0, 0, 1);
  327. Attach3DTextLabelToVehicle(TramText [ playerid ], vehicleid, 0.0, 0.0, 2.0);
  328. CallRemoteFunction("OnStartTramJob", "i", playerid);
  329. }
  330. }
  331. return 1;
  332. }
  333.  
  334.  
  335. forward UpdateTrainSpeed(playerid);
  336. public UpdateTrainSpeed(playerid)
  337. {
  338. if ( PTD_TrainSpeed[playerid] != PlayerText:-1 )
  339. {
  340. static vehicleid;
  341. vehicleid=GetPVarInt(playerid, "_depo");
  342. static Float:X, Float:Y, Float:Z, format_tram[16];
  343. static Float:x, Float:y, Float:z, Float:rz;
  344. GetVehicleVelocity(vehicleid,X,Y,Z);
  345. static Float:speed;
  346. speed = floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)), floatpower(Z, 2))) * 126.31;
  347. if ( speed > 60.0 )
  348. {
  349. /*if ( speed > 90.0 )
  350. {
  351. DestroyVehicle(GetPVarInt(playerid,"_depo"));
  352. GetPlayerPos(playerid, x, y, z);
  353. GetPlayerFacingAngle(playerid, rz);
  354. SetPVarInt(playerid, "_depo", CreateVehicle(449,x,y,z,rz,1,1,1) );
  355. PutPlayerInVehicle(playerid,GetPVarInt(playerid, "_depo"), 0);
  356. SetVehicleParamsEx(GetPVarInt(playerid, "_depo"), true, false, false, false, false, false, false);
  357. }*/
  358. format(format_tram, 16, "~r~~h~%d KM/H", floatround(speed));
  359. }
  360. else if ( speed > 50.0 && speed < 60.0 ) format(format_tram, 16, "~y~~h~%d KM/H", floatround(speed));
  361. else format(format_tram, 16, "~g~~h~%d KM/H", floatround(speed));
  362. PlayerTextDrawSetString(playerid, PTD_TrainSpeed[playerid], format_tram);
  363. static i;
  364. i = GetPVarInt(playerid, "_depo_select");
  365. GetPlayerPos(playerid, x, y, z);
  366. GetPlayerFacingAngle(playerid, rz);
  367. if ( PointToPointEX_T(x,y,z,_depo_coordination[i][D_CHECK_POS][0],_depo_coordination[i][D_CHECK_POS][1],_depo_coordination[i][D_CHECK_POS][2]) < 6.0 )
  368. {
  369. DestroyVehicle(GetPVarInt(playerid,"_depo"));
  370. SetPVarInt(playerid, "_depo", CreateVehicle(449,x,y,z,rz,1,1,1) );
  371. PutPlayerInVehicle(playerid,GetPVarInt(playerid, "_depo"), 0);
  372. //
  373. CallRemoteFunction("OnTramWaitPassengerStart", "i", playerid);
  374. static last_i;
  375. last_i = i;
  376. // SetCameraBehindPlayer(playerid);
  377. i++;
  378. if ( i >= 9 ) i = 0 ;
  379. SetPVarInt(playerid,"_depo_select", i);
  380. SetPlayerRaceCheckpoint(playerid,1,_depo_coordination[i][D_CHECK_POS][0],_depo_coordination[i][D_CHECK_POS][1],_depo_coordination[i][D_CHECK_POS][2],0.0,0.0,0.0,5.0);
  381. GameTextForPlayer(playerid, "~y~~h~wait passenger", 1000, 6);
  382. PWaitDepo[playerid] = SetTimerEx("WaitDepo", 1000, 1, "i", playerid);
  383. PWaitDepo_Count[playerid] = 15;
  384. static tram_text_string[100];
  385. if ( last_i != 8 )
  386. {
  387. format(tram_text_string, 100, "{d79756}%s\n{ffffff}Следующая остановка:\n{5c6da4}%s\n\n{ffffff}Проезд: {349a66}%d$", _depo_coordination[last_i][D_COORDS_NAME], _depo_coordination[i][D_COORDS_NAME],GetPVarInt(playerid, "tramprice"));
  388. Update3DTextLabelText(TramText [ playerid ],-1,tram_text_string);
  389. }
  390. else
  391. {
  392. format(tram_text_string, 100, "\n{ffffff}Следующая остановка:\n{d79756}%s\n\n{ffffff}Проезд: {349a66}%d$", _depo_coordination[i][D_COORDS_NAME],GetPVarInt(playerid, "tramprice"));
  393. Update3DTextLabelText(TramText [ playerid ],-1,tram_text_string);
  394. }
  395.  
  396. }
  397. static gpcm;
  398. gpcm = GetPlayerCameraMode(playerid);
  399. if ( (gpcm == 57 || gpcm == 56 || gpcm == 15 || gpcm == 14) && GetPVarInt(playerid, "gpcm_tick") <= GetTickCount())
  400. {
  401. SetPVarInt(playerid, "gpcm_tick", GetTickCount() + 2000);
  402. SetCameraBehindPlayer(playerid);
  403. }
  404. }
  405. return 1;
  406. }
  407. forward WaitDepo(playerid);
  408. public WaitDepo(playerid)
  409. {
  410. static format_depo[32];
  411. if ( PWaitDepo_Count[playerid] >= 1 )
  412. {
  413. CallRemoteFunction("OnTramWaitPassengerUpdate", "i", playerid);
  414. format(format_depo, 32, "~y~~h~wait passenger ~n~%d sec..", PWaitDepo_Count[playerid]);
  415. GameTextForPlayer(playerid, format_depo, 1000, 6);
  416. PWaitDepo_Count[playerid]--;
  417. }
  418. else
  419. {
  420. CallRemoteFunction("OnTramWaitPassengerFinish", "i", playerid);
  421. SetVehicleParamsEx(GetPVarInt(playerid, "_depo"), true, false, false, false, false, false, false);
  422. GameTextForPlayer(playerid, "~g~~h~Go!", 1000, 6);
  423. PWaitDepo_Count[playerid] = 0;
  424. KillTimer(PWaitDepo[playerid]);
  425. PWaitDepo[playerid] = -1;
  426. static tram_text_string[100];
  427. format(tram_text_string, 100, "\n{ffffff}Следующая остановка:\n{d79756}%s\n\n{ffffff}Проезд: {349a66}%d$", _depo_coordination[GetPVarInt(playerid,"_depo_select")][D_COORDS_NAME],GetPVarInt(playerid, "tramprice"));
  428. Update3DTextLabelText(TramText [ playerid ],-1,tram_text_string);
  429. }
  430. return 1;
  431. }
  432. public OnPlayerUpdate(playerid)
  433. {
  434. if(IsPlayerInRangeOfPoint(playerid,1.0,-2275.5374,540.8391,35.1033) && GetPVarInt(playerid, "info_depo_0") <= gettime())
  435. {
  436. static string_depo[800];
  437. string_depo[0] = EOS;
  438. strcat(string_depo,"{ffffff}В травайном депо Сан-Фиерро работают 10 единиц подвижного состава.\nПри наличии свободного вагона, Вы сможете выйти на маршрут.\n\n");
  439. strcat(string_depo,"Линия берет начало по левую сторону от депо. В зависимости от типа\nтрамвая, он может двигаться как передним, так и задним ходом. Если вам не\nудобно проходить маршрут задним ходо, попробуйте сменить вагон на\nдругой.\n\n");
  440. strcat(string_depo,"Чтобы завершить работу, нажмите клавишу {2c935f}Enter (или F){ffffff}. Этими же\nклавишами осуществляется посадка и высадка пассажиров. Обращаем ваше\nвнимание, что на линии действует {e76c20}ограничение скорости 60 км/ч{ffffff}. В случае её\nпревышения, вам будут выписываться штрафы. А если их накопиться слишком\nмного, трамвайное депо уволит Вас с работы. Будьте внимательны и \nсоблюдайте правила дорожного движения!\n");
  441. ShowPlayerDialog(playerid,0000,0,"{ebc92c}Водитель трамвая", string_depo, "Закрыть", "");
  442. SetPVarInt(playerid,"info_depo_0", gettime() + 5);
  443. }
  444. //else SetPVarInt(playerid,"info_depo_0", gettime() + 2);
  445.  
  446. if(IsPlayerInRangeOfPoint(playerid,1.0,-2275.5374,526.8129,35.1159) && GetPVarInt(playerid, "info_depo_1") <= gettime())
  447. {
  448. if( GetPVarInt(playerid,"_depo") == 0 ) ShowPlayerDialog(playerid, DIALOG_DEPO_START, DIALOG_STYLE_INPUT, "{ffff00}Водитель трамвая", "{ffffff}Укажите стоимость проезда {2e9971}(от 0 до 100$){ffffff}:", "Начать", "Отмена");
  449. SetPVarInt(playerid,"info_depo_1", gettime() + 10);
  450. }
  451. //else SetPVarInt(playerid,"info_depo_1", gettime() + 2);
  452. return 1;
  453. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement