Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.65 KB | None | 0 0
  1. ptask NhipDapServer[1000](playerid)
  2. {
  3. if(IsDangNhap(playerid) && !IsPlayerNPC(playerid))
  4. {
  5. //Geek 2//
  6. if(GetPVarInt(playerid, "ArmsTimer") > 0)
  7. SetPVarInt(playerid, "ArmsTimer", GetPVarInt(playerid, "ArmsTimer")-1);
  8.  
  9. if(GetPVarInt(playerid, "GiveWeaponTimer") > 0)
  10. SetPVarInt(playerid, "GiveWeaponTimer", GetPVarInt(playerid, "GiveWeaponTimer")-1);
  11.  
  12. if(GetPVarInt(playerid, "CanSaTimer") > 0)
  13. SetPVarInt(playerid, "CanSaTimer", GetPVarInt(playerid, "CanSaTimer")-1);
  14.  
  15. if(GetPVarInt(playerid, "MaTuyTimer") > 0)
  16. SetPVarInt(playerid, "MaTuyTimer", GetPVarInt(playerid, "MaTuyTimer")-1);
  17.  
  18. if(GetPVarInt(playerid, "ThuocLacTimer") > 0) {
  19. SetPVarInt(playerid, "ThuocLacTimer", GetPVarInt(playerid, "ThuocLacTimer")-1);
  20. if(GetPVarInt(playerid, "ThuocLacTimer") == 0) SetPlayerDrunkLevel(playerid, 0);
  21. }
  22.  
  23. if(GetPVarInt(playerid, "MocTuiTimer") > 0)
  24. SetPVarInt(playerid, "MocTuiTimer", GetPVarInt(playerid, "MocTuiTimer")-1);
  25.  
  26. if(GetPVarInt(playerid, "TromXeTimer") > 0)
  27. {
  28. SetPVarInt(playerid, "TromXeTimer", GetPVarInt(playerid, "TromXeTimer")-1);
  29. GetAnimationName(GetPlayerAnimationIndex(playerid),AnimLib,32,AnimName,32);
  30. if(strcmp(AnimName, "COPBROWSE_LOOP", true) != 0 || IsPlayerMoving(playerid))
  31. {
  32. SetPVarInt(playerid, "TromXeTimer", -1);
  33. RemovePlayerAttachedObject(playerid, 9);
  34. SendMessage(playerid, COLOR_YELLOW, " Pha khoa xe that bai !");
  35. }
  36. else if(GetPVarInt(playerid, "TromXeTimer") == 0) {
  37. MoKhoaXe(GetPVarInt(playerid,"TromXeID"));
  38. ClearAnimations(playerid);
  39. RemovePlayerAttachedObject(playerid, 9);
  40. SendMessage(playerid, COLOR_YELLOW, " Pha khoa xe thanh cong!");
  41. }
  42. }
  43. if(GetPVarInt(playerid,"MayNgheLenVeh") >= 0)
  44. GetVehiclePos(GetPVarInt(playerid,"MayNgheLenVeh"),MayNgheLenPos[playerid][0],MayNgheLenPos[playerid][1],MayNgheLenPos[playerid][2]);
  45. if(GetPVarInt(playerid, "MayNgheLenTimer") > 0) {
  46. SetPVarInt(playerid, "MayNgheLenTimer", GetPVarInt(playerid, "MayNgheLenTimer")-1);
  47. if(GetPVarInt(playerid, "MayNgheLenTimer") == 0)
  48. {
  49. MayNgheLenPos[playerid][0] = 0x7F800000;
  50. MayNgheLenPos[playerid][1] = 0x7F800000;
  51. MayNgheLenPos[playerid][2] = 0x7F800000;
  52. SendMessage(playerid, COLOR_YELLOW, "May nghe len het pin va khong the su dung duoc nua");
  53. }
  54. }
  55.  
  56. if(IsPlayerConnected(playerid)) {
  57. if(MayTheoDoiOn[playerid] == 1) {
  58. new vehid = GetPVarInt(playerid, "MayTheoDoiVeh");
  59. if(IsVehicleConnected(vehid)) {
  60. new Float:vehx, Float:vehy, Float:vehz;
  61. GetVehiclePos(vehid, vehx, vehy, vehz);
  62. SetPlayerCheckpoint(playerid,vehx, vehy,vehz, 5.0);
  63. }
  64. }
  65. }
  66. //Geek 2//
  67.  
  68. if(IsPlayerInRangeOfPoint(playerid, 3, AFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2])) {AFK[playerid]++;} else {AFK[playerid] = 0;}
  69. GetPlayerPos(playerid, AFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);
  70.  
  71. if(TimeCommand[playerid]>0) TimeCommand[playerid]--;
  72. if(GoiHoTro[playerid] == 1) GetPlayerPos(playerid, HoTroPos[playerid][0], HoTroPos[playerid][1], HoTroPos[playerid][2]);
  73. if(NhanHoTro[playerid] != -1)
  74. {
  75. new pid = NhanHoTro[playerid];
  76. SetPlayerCheckpoint(playerid, HoTroPos[pid][0], HoTroPos[pid][1], HoTroPos[pid][2], 4);
  77. }
  78. if(TimeWarn[playerid] >0) TimeWarn[playerid]--;
  79. if(TimeYCTG[playerid] >0) TimeYCTG[playerid]--;
  80. if(IsAtZoneNhac(playerid) && PhatAudio[playerid] == 0 && RURL[0] != EOS)
  81. {
  82. new i = GetZoneNhac(playerid);
  83. if(IsPlayerInAnyVehicle(playerid))
  84. {
  85. new vid = GetPlayerVehicleID(playerid);
  86. if(RMoTat[vid] == 0)
  87. {
  88. PlayAudioStreamForPlayer(playerid, RURL, ZonePos[ZoneNhac[i]][0], ZonePos[ZoneNhac[i]][1], ZonePos[ZoneNhac[i]][2], ZoneRange[ZoneNhac[i]], 1);
  89. PhatAudio[playerid] = 1;
  90. }
  91. }
  92. else
  93. {
  94. PlayAudioStreamForPlayer(playerid, RURL, ZonePos[ZoneNhac[i]][0], ZonePos[ZoneNhac[i]][1], ZonePos[ZoneNhac[i]][2], ZoneRange[ZoneNhac[i]], 1);
  95. PhatAudio[playerid] = 1;
  96. }
  97. }
  98. else if(!IsAtZoneNhac(playerid) && PhatAudio[playerid] == 1 && RURL[0] != EOS)
  99. {
  100. if(IsPlayerInAnyVehicle(playerid))
  101. {
  102. new vid = GetPlayerVehicleID(playerid);
  103. if(RMoTat[vid] == 0)
  104. {
  105. StopAudioStreamForPlayer(playerid);
  106. PhatAudio[playerid] = 0;
  107. }
  108. }
  109. else
  110. {
  111. StopAudioStreamForPlayer(playerid);
  112. PhatAudio[playerid] = 0;
  113. }
  114. }
  115. if(tgtaiche[playerid] >0) tgtaiche[playerid]--;
  116. if(KhachTaxi[playerid] != -1 && GoiTaxi[KhachTaxi[playerid]] == 1)
  117. {
  118. new Float:Pos[3];
  119. GetPlayerPos(KhachTaxi[playerid], Pos[0], Pos[1], Pos[2]);
  120. SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 4);
  121. if(IsPlayerNearPlayer(playerid, KhachTaxi[playerid], 5))
  122. {
  123. GoiTaxi[KhachTaxi[playerid]] = 0;
  124. DisablePlayerCheckpoint(playerid);
  125. }
  126. }
  127. if(NguoiGoiCapCuu[playerid] != -1 && GoiCapCuu[NguoiGoiCapCuu[playerid]] != 0)
  128. {
  129. new Float:Pos[3];
  130. GetPlayerPos(NguoiGoiCapCuu[playerid], Pos[0], Pos[1], Pos[2]);
  131. SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 4);
  132. if(IsPlayerNearPlayer(playerid, NguoiGoiCapCuu[playerid], 5))
  133. {
  134. GoiCapCuu[NguoiGoiCapCuu[playerid]] = 0;
  135. NguoiGoiCapCuu[playerid] = -1;
  136. DisablePlayerCheckpoint(playerid);
  137. }
  138. }
  139. if(TimeGoiTaxi[playerid] > 0)
  140. {
  141. if(--TimeGoiTaxi[playerid] <= 0) GoiTaxi[playerid] = 0;
  142. }
  143. if(TimeGoiSuaXe[playerid] > 0)
  144. {
  145. if(--TimeGoiSuaXe[playerid] <=0) GoiSuaXe[playerid] = 0;
  146. }
  147. if(BiThuong[playerid] == 1 && CamMau[playerid] == 0)
  148. {
  149. new Float:mau;
  150. GetPlayerHealth(playerid, mau);
  151. SetPlayerHealth(playerid, mau-1);
  152. if(!IsPlayerInRangeOfPoint(playerid, 3, BTPos[playerid][0], BTPos[playerid][1], BTPos[playerid][2])) NamVien(playerid);
  153. GetAnimationName(GetPlayerAnimationIndex(playerid),AnimLib,32,AnimName,32);
  154. if(strcmp(AnimName, "KILL_Knife_Ped_Die", true) != 0) ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
  155. }
  156. if(NewbieTime[playerid] > 0) NewbieTime[playerid]--;
  157. /*
  158. if(PInfo[playerid][TheLuc] > 0) PInfo[playerid][TheLuc] -= 0.06;
  159. else if(PInfo[playerid][TheLuc] <= 0 && BiThuong[playerid] == 0)
  160. {
  161. new Float:mau;
  162. GetPlayerHealth(playerid, mau);
  163. if(mau>0) SetPlayerHealth(playerid, mau-0.3);
  164. }
  165. */
  166. if(DangApGiai[playerid] == 1)
  167. {
  168. new Float:Pos[3];
  169. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  170. if(!IsPlayerInRangeOfPoint(NguoiApGiai[playerid], 4, Pos[0], Pos[1], Pos[2])) SetPlayerPos(NguoiApGiai[playerid], Pos[0]+0.5, Pos[1]+0.5, Pos[2]);
  171. }
  172. if(TimeTrungDan[playerid] >0) TimeTrungDan[playerid]--;
  173. if(TrungDanCS[playerid] >=3)
  174. {
  175. if(IsPlayerInAnyVehicle(playerid))
  176. {
  177. new Float:Pos[3], Float:speed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
  178. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  179. SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]+0.1);
  180. if(speed <= 10) ApplyAnimation(playerid, "PED", "BIKE_fall_off", 4.1, 0, 1, 1, 0, 1500, 1);
  181. else ApplyAnimation(playerid, "PED", "BIKE_fallR", 4.1, 0, 1, 1, 0, 1500, 1);
  182. for(new i=0; i<MAX_PLAYERS; i++)
  183. {
  184. if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)))
  185. {
  186. if(speed <= 10) ApplyAnimation(i, "PED", "BIKE_fall_off", 4.1, 0, 1, 1, 0, 1500, 1);
  187. else ApplyAnimation(i, "PED", "BIKE_fallR", 4.1, 0, 1, 1, 0, 1500, 1);
  188. }
  189. }
  190. TrungDanCS[playerid] = 0;
  191. }
  192. else
  193. {
  194. TogglePlayerControllable(playerid, 0);
  195. ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 1, 1, 1, 0, 1);
  196. SetTimerEx("QueGio", 12000, 0, "i", playerid);
  197. TrungDanCS[playerid] = 0;
  198. BiQueGio[playerid] = 1;
  199. }
  200. }
  201. if((PInfo[playerid][Tu] == 1 || PInfo[playerid][Tu] == 2) && PInfo[playerid][TGTu] > 0 && --PInfo[playerid][TGTu] <= 0)
  202. {
  203. SetPlayerPos(playerid, 1543.1277,-1675.6676,13.5558);
  204. SetPlayerInterior(playerid, 0);
  205. SetPlayerVirtualWorld(playerid, 0);
  206. SetPlayerFacingAngle(playerid, 90.0);
  207. SetCameraBehindPlayer(playerid);
  208. PInfo[playerid][Tu] = 0;
  209. PInfo[playerid][TGTu] = 0;
  210. GameTextForPlayer(playerid, "Het thoi gian ngoi tu", 5000, 4);
  211. }
  212. if(TGSoCuu[playerid]>0) TGSoCuu[playerid]--;
  213. if(TGCheTaoCN[playerid] >0)
  214. {
  215. if(--TGCheTaoCN[playerid] <= 0)
  216. {
  217. SetCheckpoint(playerid, 1368.0283,35.2858,1007.8994, 1.5);
  218. TGCheTaoCN[playerid] = -2;
  219. GameTextForPlayer(playerid, "~y~Da che tao xong", 1000, 6);
  220. }
  221. new str[50];
  222. format(str,sizeof(str), "~r~Thoi gian cho con lai:~n~~y~%d giay", TGCheTaoCN[playerid]);
  223. GameTextForPlayer(playerid, str, 1000, 6);
  224. }
  225. if(TimeThi[playerid] > 0)
  226. {
  227. if(--TimeThi[playerid] == 0) ClearThiBangLai(playerid, GetPlayerVehicleID(playerid));
  228. new str[128];
  229. format(str, sizeof(str), "~b~Thoi gian con lai:~n~~y~%d", TimeThi[playerid]);
  230. GameTextForPlayer(playerid, str, 1000, 6);
  231. }
  232. if(MTTaxiClock[playerid] == 1)
  233. {
  234. TaxiTime[playerid]++;
  235. UpdateTaxiClockTime(playerid);
  236. }
  237. //////////////////////ANTIHACK/////////////////////////
  238. if(GetPlayerMoney(playerid) != PInfo[playerid][Tien])
  239. {
  240. ResetPlayerMoney(playerid);
  241. GivePlayerMoney(playerid, PInfo[playerid][Tien]);
  242. }
  243. if(AntiCheckpoint[playerid] == 1) AntiCPTime[playerid]++;
  244. CheckHackWeapon(playerid);
  245.  
  246. if(TimeAnim[playerid] >0 && --TimeAnim[playerid] <= 0)
  247. {
  248. CountAnim[playerid] = 0;
  249. TheAnim[playerid] = 1;
  250. TimeAnim[playerid] = 0;
  251. new cmd_str[36];
  252. cmd_str = "cmd_";
  253. new TenAnim[128];
  254. GetPVarString(playerid, "TenAnim", TenAnim, sizeof(TenAnim));
  255. strcat(cmd_str, TenAnim);
  256. CallLocalFunction(cmd_str,"ds",playerid,"\1");
  257. TheAnim[playerid] = -1;
  258. HidePlayerProgressBar(playerid, thanhhoatdong);
  259. ClearAnimations(playerid);
  260. }
  261. }
  262. return 1;
  263. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement