1
0

setplayerspawn.pwn 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. SetPlayerSpawn(playerid)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. if(GetPVarType(playerid, "WatchingTV")) return 1;
  6. if(PlayerInfo[playerid][pBackpack] > 0 && PlayerInfo[playerid][pBEquipped])
  7. {
  8. switch(PlayerInfo[playerid][pBackpack])
  9. {
  10. case 1:
  11. {
  12. if(PlayerHoldingObject[playerid][9] != 0 && IsPlayerAttachedObjectSlotUsed(playerid, 9))
  13. RemovePlayerAttachedObject(playerid, 9), PlayerHoldingObject[playerid][9] = 0;
  14. SetPlayerAttachedObject(playerid, 9, 371, 1, -0.002, -0.140999, -0.01, 8.69999, 88.8, -8.79993, 1.11, 0.963);
  15. //PlayerInfo[playerid][pBEquipped] = 1;
  16. }
  17. case 2: // Med
  18. {
  19. if(PlayerHoldingObject[playerid][9] != 0 && IsPlayerAttachedObjectSlotUsed(playerid, 9))
  20. RemovePlayerAttachedObject(playerid, 9), PlayerHoldingObject[playerid][9] = 0;
  21. SetPlayerAttachedObject(playerid, 9, 371, 1, -0.002, -0.140999, -0.01, 8.69999, 88.8, -8.79993, 1.11, 0.963);
  22. //PlayerInfo[playerid][pBEquipped] = 1;
  23. }
  24. case 3: // Large
  25. {
  26. if(PlayerHoldingObject[playerid][9] != 0 && IsPlayerAttachedObjectSlotUsed(playerid, 9))
  27. RemovePlayerAttachedObject(playerid, 9), PlayerHoldingObject[playerid][9] = 0;
  28. SetPlayerAttachedObject(playerid, 9, 3026, 1, -0.254999, -0.109, -0.022999, 10.6, -1.20002, 3.4, 1.265, 1.242, 1.062);
  29. //PlayerInfo[playerid][pBEquipped] = 1;
  30. }
  31. }
  32. }
  33. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  34. if(HungerPlayerInfo[playerid][hgInEvent] == 1)
  35. {
  36. if(hgActive > 0)
  37. {
  38. if(hgPlayerCount == 3)
  39. {
  40. new szmessage[128];
  41. format(szmessage, sizeof(szmessage), "** %s has came in third place in the Hunger Games Event.", GetPlayerNameEx(playerid));
  42. SendClientMessageToAll(COLOR_LIGHTBLUE, szmessage);
  43. SetHealth(playerid, HungerPlayerInfo[playerid][hgLastHealth]);
  44. SetArmour(playerid, HungerPlayerInfo[playerid][hgLastArmour]);
  45. SetPlayerVirtualWorld(playerid, HungerPlayerInfo[playerid][hgLastVW]);
  46. SetPlayerInterior(playerid, HungerPlayerInfo[playerid][hgLastInt]);
  47. SetPlayerPos(playerid, HungerPlayerInfo[playerid][hgLastPosition][0], HungerPlayerInfo[playerid][hgLastPosition][1], HungerPlayerInfo[playerid][hgLastPosition][2]);
  48. ResetPlayerWeapons(playerid);
  49. HungerPlayerInfo[playerid][hgInEvent] = 0;
  50. hgPlayerCount--;
  51. HideHungerGamesTextdraw(playerid);
  52. PlayerInfo[playerid][pRewardDrawChance] += 10;
  53. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "** You have been given 10 Draw Chances for the Fall Into Fun Event.");
  54. for(new w = 0; w < 12; w++)
  55. {
  56. PlayerInfo[playerid][pGuns][w] = HungerPlayerInfo[playerid][hgLastWeapon][w];
  57. if(PlayerInfo[playerid][pGuns][w] > 0 && PlayerInfo[playerid][pAGuns][w] == 0)
  58. {
  59. GivePlayerValidWeapon(playerid, PlayerInfo[playerid][pGuns][w]);
  60. }
  61. }
  62. }
  63. else if(hgPlayerCount == 2)
  64. {
  65. new szmessage[128];
  66. format(szmessage, sizeof(szmessage), "** %s has came in second place in the Hunger Games Event.", GetPlayerNameEx(playerid));
  67. SendClientMessageToAll(COLOR_LIGHTBLUE, szmessage);
  68. SetHealth(playerid, HungerPlayerInfo[playerid][hgLastHealth]);
  69. SetArmour(playerid, HungerPlayerInfo[playerid][hgLastArmour]);
  70. SetPlayerVirtualWorld(playerid, HungerPlayerInfo[playerid][hgLastVW]);
  71. SetPlayerInterior(playerid, HungerPlayerInfo[playerid][hgLastInt]);
  72. SetPlayerPos(playerid, HungerPlayerInfo[playerid][hgLastPosition][0], HungerPlayerInfo[playerid][hgLastPosition][1], HungerPlayerInfo[playerid][hgLastPosition][2]);
  73. ResetPlayerWeapons(playerid);
  74. HungerPlayerInfo[playerid][hgInEvent] = 0;
  75. hgPlayerCount--;
  76. HideHungerGamesTextdraw(playerid);
  77. PlayerInfo[playerid][pRewardDrawChance] += 25;
  78. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "** You have been given 25 Draw Chances for the Fall Into Fun Event.");
  79. for(new w = 0; w < 12; w++)
  80. {
  81. PlayerInfo[playerid][pGuns][w] = HungerPlayerInfo[playerid][hgLastWeapon][w];
  82. if(PlayerInfo[playerid][pGuns][w] > 0 && PlayerInfo[playerid][pAGuns][w] == 0)
  83. {
  84. GivePlayerValidWeapon(playerid, PlayerInfo[playerid][pGuns][w]);
  85. }
  86. }
  87. foreach(new i: Player)
  88. {
  89. if(HungerPlayerInfo[i][hgInEvent] == 1)
  90. {
  91. format(szmessage, sizeof(szmessage), "** %s has came in first place in the Hunger Games Event.", GetPlayerNameEx(i));
  92. SendClientMessageToAll(COLOR_LIGHTBLUE, szmessage);
  93. SetHealth(i, HungerPlayerInfo[i][hgLastHealth]);
  94. SetArmour(i, HungerPlayerInfo[i][hgLastArmour]);
  95. SetPlayerVirtualWorld(i, HungerPlayerInfo[i][hgLastVW]);
  96. SetPlayerInterior(i, HungerPlayerInfo[i][hgLastInt]);
  97. SetPlayerPos(i, HungerPlayerInfo[i][hgLastPosition][0], HungerPlayerInfo[i][hgLastPosition][1], HungerPlayerInfo[i][hgLastPosition][2]);
  98. ResetPlayerWeapons(i);
  99. HungerPlayerInfo[i][hgInEvent] = 0;
  100. hgPlayerCount--;
  101. HideHungerGamesTextdraw(i);
  102. PlayerInfo[i][pRewardDrawChance] += 50;
  103. SendClientMessageEx(i, COLOR_LIGHTBLUE, "** You have been given 50 Draw Chances for the Fall Into Fun Event.");
  104. hgActive = 0;
  105. for(new w = 0; w < 12; w++)
  106. {
  107. PlayerInfo[i][pGuns][w] = HungerPlayerInfo[i][hgLastWeapon][w];
  108. if(PlayerInfo[i][pGuns][w] > 0 && PlayerInfo[i][pAGuns][w] == 0)
  109. {
  110. GivePlayerValidWeapon(i, PlayerInfo[i][pGuns][w]);
  111. }
  112. }
  113. }
  114. }
  115. for(new i = 0; i < 600; i++)
  116. {
  117. if(IsValidDynamic3DTextLabel(HungerBackpackInfo[i][hgBackpack3DText]))
  118. {
  119. DestroyDynamic3DTextLabel(HungerBackpackInfo[i][hgBackpack3DText]);
  120. }
  121. if(IsValidDynamicPickup(HungerBackpackInfo[i][hgBackpackPickupId]))
  122. {
  123. DestroyDynamicPickup(HungerBackpackInfo[i][hgBackpackPickupId]);
  124. }
  125. HungerBackpackInfo[i][hgActiveEx] = 0;
  126. }
  127. }
  128. else if(hgPlayerCount > 3 || hgPlayerCount == 1)
  129. {
  130. SetHealth(playerid, HungerPlayerInfo[playerid][hgLastHealth]);
  131. SetArmour(playerid, HungerPlayerInfo[playerid][hgLastArmour]);
  132. SetPlayerVirtualWorld(playerid, HungerPlayerInfo[playerid][hgLastVW]);
  133. SetPlayerInterior(playerid, HungerPlayerInfo[playerid][hgLastInt]);
  134. SetPlayerPos(playerid, HungerPlayerInfo[playerid][hgLastPosition][0], HungerPlayerInfo[playerid][hgLastPosition][1], HungerPlayerInfo[playerid][hgLastPosition][2]);
  135. ResetPlayerWeapons(playerid);
  136. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have died and has been removed from the Hunger Games Event, better luck next time.");
  137. HungerPlayerInfo[playerid][hgInEvent] = 0;
  138. hgPlayerCount--;
  139. HideHungerGamesTextdraw(playerid);
  140. for(new w = 0; w < 12; w++)
  141. {
  142. PlayerInfo[playerid][pGuns][w] = HungerPlayerInfo[playerid][hgLastWeapon][w];
  143. if(PlayerInfo[playerid][pGuns][w] > 0 && PlayerInfo[playerid][pAGuns][w] == 0)
  144. {
  145. GivePlayerValidWeapon(playerid, PlayerInfo[playerid][pGuns][w]);
  146. }
  147. }
  148. }
  149. new string[128];
  150. format(string, sizeof(string), "Players in event: %d", hgPlayerCount);
  151. foreach(new i: Player)
  152. {
  153. PlayerTextDrawSetString(i, HungerPlayerInfo[i][hgPlayerText], string);
  154. }
  155. }
  156. return true;
  157. }
  158. if(GetPVarType(playerid, "IsInArena"))
  159. {
  160. SpawnPaintballArena(playerid, GetPVarInt(playerid, "IsInArena"));
  161. return 1;
  162. }
  163. if(GetPVarType(playerid, "SpecOff"))
  164. {
  165. SetPlayerInterior(playerid, GetPVarInt(playerid, "SpecInt"));
  166. PlayerInfo[playerid][pInt] = GetPVarInt(playerid, "SpecInt");
  167. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "SpecVW"));
  168. PlayerInfo[playerid][pVW] = GetPVarInt(playerid, "SpecVW");
  169. SetPlayerPos(playerid, GetPVarFloat(playerid, "SpecPosX"), GetPVarFloat(playerid, "SpecPosY"), GetPVarFloat(playerid, "SpecPosZ"));
  170. if(GetPVarInt(playerid, "SpecInt") > 0) {
  171. Player_StreamPrep(playerid, GetPVarFloat(playerid, "SpecPosX"), GetPVarFloat(playerid, "SpecPosY"), GetPVarFloat(playerid, "SpecPosZ"), FREEZE_TIME);
  172. }
  173. DeletePVar(playerid, "SpecOff");
  174. DeletePVar(playerid, "SpecInt");
  175. DeletePVar(playerid, "SpecVW");
  176. DeletePVar(playerid, "SpecPosX");
  177. DeletePVar(playerid, "SpecPosY");
  178. DeletePVar(playerid, "SpecPosZ");
  179. if(GetPVarType(playerid, "pGodMode"))
  180. {
  181. SetHealth(playerid, 0x7FB00000);
  182. SetArmour(playerid, 0x7FB00000);
  183. }
  184. return 1;
  185. }
  186. new rand;
  187. if(PlayerInfo[playerid][pBeingSentenced] > 0)
  188. {
  189. PhoneOnline[playerid] = 1;
  190. rand = random(sizeof(WarrantJail));
  191. SetPlayerPos(playerid, WarrantJail[rand][0], WarrantJail[rand][1], WarrantJail[rand][2]);
  192. if(rand != 0) courtjail[playerid] = 2;
  193. else courtjail[playerid] = 1;
  194. Player_StreamPrep(playerid, WarrantJail[rand][0], WarrantJail[rand][1], WarrantJail[rand][2], FREEZE_TIME);
  195. PlayerInfo[playerid][pInt] = 0;
  196. KillEMSQueue(playerid);
  197. SetPlayerColor(playerid, SHITTY_JUDICIALSHITHOTCH);
  198. return 1;
  199. }
  200. if(PlayerInfo[playerid][pJailTime] > 0)
  201. {
  202. if(strfind(PlayerInfo[playerid][pPrisonReason], "[IC]", true) != -1)
  203. {
  204. if(!GetPVarType(playerid, "Injured")) {
  205. for(new i = 0; i < 3; i++) {
  206. format(szMiscArray, sizeof(szMiscArray), "MOTD: %s", prisonerMOTD[i]);
  207. SendClientMessageEx(playerid, COLOR_ORANGE, szMiscArray);
  208. }
  209. PhoneOnline[playerid] = 1;
  210. SetPlayerInterior(playerid, 1);
  211. PlayerInfo[playerid][pInt] = 1;
  212. SetPlayerVirtualWorld(playerid, 0);
  213. PlayerInfo[playerid][pVW] = 0;
  214. SetPlayerColor(playerid, TEAM_ORANGE_COLOR);
  215. SetHealth(playerid, 100);
  216. KillEMSQueue(playerid);
  217. DeletePVar(playerid, "ArrestPoint");
  218. ResetPlayerWeaponsEx(playerid);
  219. rand = random(sizeof(DocPrison));
  220. if(PlayerInfo[playerid][pIsolated] > 0)
  221. {
  222. SetPlayerPos(playerid, DocIsolation[PlayerInfo[playerid][pIsolated] - 1][0], DocIsolation[PlayerInfo[playerid][pIsolated] - 1][1], DocIsolation[PlayerInfo[playerid][pIsolated] - 1][2]);
  223. Player_StreamPrep(playerid, DocIsolation[PlayerInfo[playerid][pIsolated] - 1][0], DocIsolation[PlayerInfo[playerid][pIsolated] - 1][1], DocIsolation[PlayerInfo[playerid][pIsolated] - 1][2], FREEZE_TIME);
  224. }
  225. else
  226. {
  227. SpawnPlayerInPrisonCell(playerid, PlayerInfo[playerid][pPrisonCell]);
  228. /*SetPlayerPos(playerid, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2]);
  229. Player_StreamPrep(playerid, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2], FREEZE_TIME);*/
  230. }
  231. return 1;
  232. }
  233. }
  234. else if(strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1)
  235. {
  236. SetHealth(playerid, 0x7FB00000);
  237. PhoneOnline[playerid] = 1;
  238. SetPlayerInterior(playerid, 1);
  239. PlayerInfo[playerid][pInt] = 1;
  240. rand = random(sizeof(OOCPrisonSpawns));
  241. SetPlayerPos(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  242. SetPlayerSkin(playerid, 50);
  243. SetPlayerColor(playerid, TEAM_APRISON_COLOR);
  244. new string[128];
  245. format(string, sizeof(string), "You are in prison, reason: %s", PlayerInfo[playerid][pPrisonReason]);
  246. SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
  247. ResetPlayerWeaponsEx(playerid);
  248. KillEMSQueue(playerid);
  249. Player_StreamPrep(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2], FREEZE_TIME);
  250. return 1;
  251. }
  252. }
  253. if(GetPVarInt(playerid, "Injured") == 1)
  254. {
  255. switch(aLastShotWeapon[playerid])
  256. {
  257. case WEAPON_BRASSKNUCKLE, WEAPON_GOLFCLUB, WEAPON_BAT, WEAPON_SHOVEL, WEAPON_POOLSTICK, WEAPON_DILDO, WEAPON_DILDO2, WEAPON_VIBRATOR,
  258. WEAPON_VIBRATOR2, WEAPON_FLOWER, WEAPON_CANE:
  259. {
  260. format(szMiscArray, sizeof(szMiscArray), "Player brutally beaten with a %s.", Weapon_ReturnName(aLastShotWeapon[playerid]));
  261. }
  262. case WEAPON_KATANA, WEAPON_KNIFE:
  263. {
  264. format(szMiscArray, sizeof(szMiscArray), "Player was brutally slashed with a %s.", Weapon_ReturnName(aLastShotWeapon[playerid]));
  265. }
  266. case WEAPON_GRENADE, WEAPON_ROCKETLAUNCHER, WEAPON_HEATSEEKER, 51:
  267. {
  268. format(szMiscArray, sizeof(szMiscArray), "Player suffered critical damage from an explosive blast.");
  269. }
  270. case WEAPON_FIREEXTINGUISHER, WEAPON_SPRAYCAN:
  271. {
  272. format(szMiscArray, sizeof(szMiscArray), "Player would appear suffocated and poisoned.");
  273. }
  274. case WEAPON_MOLTOV, WEAPON_FLAMETHROWER:
  275. {
  276. format(szMiscArray, sizeof(szMiscArray), "Player suffered from critical severe burn injuries.");
  277. }
  278. case WEAPON_COLT45, WEAPON_SILENCED, WEAPON_DEAGLE, WEAPON_SHOTGUN, WEAPON_SAWEDOFF, WEAPON_SHOTGSPA, WEAPON_UZI, WEAPON_MP5, WEAPON_AK47,
  279. WEAPON_M4, WEAPON_TEC9, WEAPON_RIFLE, WEAPON_SNIPER, WEAPON_MINIGUN:
  280. {
  281. format(szMiscArray, sizeof(szMiscArray), "Player was critically shot in the %s by a %s.", ReturnBoneName(aLastShotBone[playerid]), Weapon_ReturnName(aLastShotWeapon[playerid]));
  282. }
  283. case WEAPON_VEHICLE, WEAPON_COLLISION:
  284. {
  285. format(szMiscArray, sizeof(szMiscArray), "Player would appear to have multiple broken bones.");
  286. }
  287. case WEAPON_DROWN:
  288. {
  289. format(szMiscArray, sizeof(szMiscArray), "Player lost consciousness through drowning.");
  290. }
  291. case 0: format(szMiscArray, sizeof(szMiscArray), "Player would appear to be brutally beaten by someone's fists.");
  292. default: format(szMiscArray, sizeof(szMiscArray), "Player passed away from unknown causes.");
  293. }
  294. strcat(szMiscArray, "\n{FF0000}(Player is critically injured).", sizeof(szMiscArray));
  295. new Float: mX, Float: mY, Float: mZ;
  296. GetPlayerPos(playerid, mX, mY, mZ);
  297. SetPVarInt(playerid, "InjuredTL", _:CreateDynamic3DTextLabel(szMiscArray, COLOR_LIGHTBLUE, mX, mY, mZ+0.1, 5, .attachedplayer = playerid, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid), .streamdistance = 5));
  298. SendEMSQueue(playerid,1);
  299. if(GetPlayerInterior(playerid) == 0) defer DeathScreen(playerid);
  300. return 1;
  301. }
  302. if(GetPVarInt(playerid, "EventToken") == 1)
  303. {
  304. for(new i; i < sizeof(EventKernel[EventStaff]); i++)
  305. {
  306. if(EventKernel[EventStaff][i] == playerid)
  307. {
  308. /*SetPlayerWeapons(playerid);
  309. SetPlayerPos(playerid,EventFloats[playerid][1],EventFloats[playerid][2],EventFloats[playerid][3]);
  310. //PlayerInfo[playerid][pInterior] = PlayerInfo[playerid][pInt];
  311. SetPlayerVirtualWorld(playerid, EventLastVW[playerid]);
  312. SetPlayerFacingAngle(playerid, EventFloats[playerid][0]);
  313. SetPlayerInterior(playerid,EventLastInt[playerid]);
  314. SetHealth(playerid, EventFloats[playerid][4]);
  315. if(EventFloats[playerid][5] > 0) {
  316. SetArmour(playerid, EventFloats[playerid][5]);
  317. }
  318. for(new d = 0; d < 6; d++)
  319. {
  320. EventFloats[playerid][d] = 0.0;
  321. }
  322. EventLastInt[playerid] = 0;
  323. EventLastVW[playerid] = 0;
  324. EventKernel[EventStaff][i] = INVALID_PLAYER_ID;*/
  325. new Float:health, Float:armor;
  326. ResetPlayerWeapons( playerid );
  327. DeletePVar(playerid, "EventToken");
  328. SetPlayerWeapons(playerid);
  329. SetPlayerToTeamColor(playerid);
  330. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  331. SetPlayerPos(playerid,EventFloats[playerid][1],EventFloats[playerid][2],EventFloats[playerid][3]);
  332. SetPlayerVirtualWorld(playerid, EventLastVW[playerid]);
  333. SetPlayerFacingAngle(playerid, EventFloats[playerid][0]);
  334. SetPlayerInterior(playerid,EventLastInt[playerid]);
  335. Player_StreamPrep(playerid, EventFloats[playerid][1],EventFloats[playerid][2],EventFloats[playerid][3], FREEZE_TIME);
  336. if(EventKernel[EventType] == 4)
  337. {
  338. if(GetPVarType(playerid, "pEventZombie")) DeletePVar(playerid, "pEventZombie");
  339. SetPlayerToTeamColor(playerid);
  340. }
  341. for(new d = 0; d < 6; d++)
  342. {
  343. EventFloats[playerid][d] = 0.0;
  344. }
  345. EventLastVW[playerid] = 0;
  346. EventLastInt[playerid] = 0;
  347. RemovePlayerWeapon(playerid, 38);
  348. health = GetPVarFloat(playerid, "pPreGodHealth");
  349. SetHealth(playerid,health);
  350. armor = GetPVarFloat(playerid, "pPreGodArmor");
  351. SetArmour(playerid, armor);
  352. DeletePVar(playerid, "pPreGodHealth");
  353. DeletePVar(playerid, "pPreGodArmor");
  354. DeletePVar(playerid, "eventStaff");
  355. return 1;
  356. }
  357. }
  358. if(EventKernel[EventType] == 4)
  359. {
  360. SetPlayerPos(playerid, EventKernel[ EventPositionX ], EventKernel[ EventPositionY ], EventKernel[ EventPositionZ ] );
  361. SetPlayerInterior(playerid, EventKernel[ EventInterior ] );
  362. SetPlayerVirtualWorld(playerid, EventKernel[ EventWorld ] );
  363. SendClientMessageEx(playerid, COLOR_WHITE, "You are a zombie! Use /bite to infect others");
  364. SetHealth(playerid, 30);
  365. RemoveArmor(playerid);
  366. SetPlayerSkin(playerid, 134);
  367. SetPlayerColor(playerid, 0x0BC43600);
  368. SetPVarInt(playerid, "pEventZombie", 1);
  369. return 1;
  370. }
  371. else
  372. {
  373. DeletePVar(playerid, "EventToken");
  374. SetPlayerWeapons(playerid);
  375. SetPlayerPos(playerid,EventFloats[playerid][1],EventFloats[playerid][2],EventFloats[playerid][3]);
  376. //PlayerInfo[playerid][pInterior] = PlayerInfo[playerid][pInt];
  377. SetPlayerVirtualWorld(playerid, EventLastVW[playerid]);
  378. SetPlayerFacingAngle(playerid, EventFloats[playerid][0]);
  379. SetPlayerInterior(playerid,EventLastInt[playerid]);
  380. Player_StreamPrep(playerid, EventFloats[playerid][1],EventFloats[playerid][2],EventFloats[playerid][3], FREEZE_TIME);
  381. SetHealth(playerid, EventFloats[playerid][4]);
  382. if(EventFloats[playerid][5] > 0) {
  383. SetArmour(playerid, EventFloats[playerid][5]);
  384. }
  385. for(new i = 0; i < 6; i++)
  386. {
  387. EventFloats[playerid][i] = 0.0;
  388. }
  389. EventLastVW[playerid] = 0;
  390. EventLastInt[playerid] = 0;
  391. return 1;
  392. }
  393. }
  394. if(GetPVarInt(playerid, "MedicBill") == 1 && PlayerInfo[playerid][pJailTime] == 0)
  395. {
  396. #if defined zombiemode
  397. if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie"))
  398. {
  399. SpawnZombie(playerid);
  400. return 1;
  401. }
  402. #endif
  403. if(PlayerInfo[playerid][pWantedLevel] > 0 && (PlayerInfo[playerid][pInsurance] == HOSPITAL_LSVIP || PlayerInfo[playerid][pInsurance] == HOSPITAL_LVVIP || PlayerInfo[playerid][pInsurance] == HOSPITAL_SFVIP || PlayerInfo[playerid][pInsurance] == HOSPITAL_HOMECARE || PlayerInfo[playerid][pInsurance] == HOSPITAL_FAMED || PlayerInfo[playerid][pInsurance] == HOSPITAL_TRFAMED))
  404. {
  405. new wantedplace;
  406. switch(random(3))
  407. {
  408. case 0: {wantedplace = HOSPITAL_COUNTYGEN;}
  409. case 1: {wantedplace = HOSPITAL_SANFIERRO;}
  410. case 2: {wantedplace = HOSPITAL_ALLSAINTS;}
  411. }
  412. DeliverPlayerToHospital(playerid, wantedplace);
  413. return 1;
  414. }
  415. else
  416. {
  417. return DeliverPlayerToHospital(playerid, PlayerInfo[playerid][pInsurance]);
  418. }
  419. }
  420. if(!PlayerInfo[playerid][pHospital])
  421. {
  422. SetPlayerPos(playerid,PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
  423. SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
  424. SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPos_r]);
  425. SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
  426. if(PlayerInfo[playerid][pHealth] < 1) PlayerInfo[playerid][pHealth] = 100;
  427. SetHealth(playerid, PlayerInfo[playerid][pHealth]);
  428. if(PlayerInfo[playerid][pArmor] > 0) SetArmour(playerid, PlayerInfo[playerid][pArmor]); else SetArmour(playerid, 0.0);
  429. SetCameraBehindPlayer(playerid);
  430. if(PlayerInfo[playerid][pInt] > 0) Player_StreamPrep(playerid, PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z], FREEZE_TIME);
  431. //if(PlayerInfo[playerid][pInt] == 0 && PlayerInfo[playerid][pVW] == 0) LoginCamToPlayer(playerid);
  432. return 1;
  433. }
  434. new Float: x, Float: y, Float: z;
  435. GetPlayerPos(playerid, x, y, z);
  436. if(x == 0.0 && y == 0.0)
  437. {
  438. SetPlayerInterior(playerid,0);
  439. SetPlayerPos(playerid, 1715.1201,-1903.1711,13.5665);
  440. SetPlayerFacingAngle(playerid, 359.4621);
  441. SetCameraBehindPlayer(playerid);
  442. }
  443. SetPlayerToTeamColor(playerid);
  444. return 1;
  445. }
  446. return 1;
  447. }
  448. forward ForceSpawn(playerid);
  449. public ForceSpawn(playerid)
  450. {
  451. SpawnPlayer(playerid);
  452. return 1;
  453. }