Advertisement
Guest User

RandomSpawnInRandomCity

a guest
Mar 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.99 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. main(){}
  4.  
  5. enum e_pInfo {
  6.     bool:pCity,
  7.     bool:pFistSpawn,
  8.     pSkin
  9. };
  10. new pInfo[MAX_PLAYERS][e_pInfo];
  11.  
  12. static const Float:SpawnCoords[2][4][5] = {
  13.     {//LS
  14.         {821.2404, -1359.6903, -0.5078, 210.3868},
  15.         {842.2728, -1378.6709, -0.5015, 210.3868},
  16.         {852.8189, -1388.1155, -0.5015, 135.0018},
  17.         {821.2404, -1359.6903, -0.5078, 135.0018}
  18.     },
  19.     {//SF
  20.         {-1977.5963, 130.6275, 27.6940, 135.0018},
  21.         {-1966.0291, 159.9727, 27.6940, 135.0018},
  22.         {-1977.5817, 160.8559, 27.6940, 210.3868},
  23.         {-1970.4113, 161.7197, 27.6875, 210.3868}
  24.     }
  25. };
  26.  
  27. public OnPlayerConnect(playerid)
  28. {
  29.     pInfo[playerid][pCity] = !!random(2);
  30.     return 1;
  31. }
  32.  
  33. public OnPlayerDeath(playerid, killerid, reason)
  34. {
  35.     new rand = random(sizeof(SpawnCoords[]));
  36.     SetSpawnInfo(playerid, 0, pSkin, SpawnCoords[pInfo[playerid][pCity]][rand][0], SpawnCoords[pInfo[playerid][pCity]][rand][1], SpawnCoords[pInfo[playerid][pCity]][rand][2], SpawnCoords[pInfo[playerid][pCity]][rand][3], 0, 0, 0, 0, 0, 0);
  37.     return 1;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement