#1

when I die in DM zone it don't teleports me back to the area.
Here is the code:
Код:
	if(CurrentMenu == Deathmatch)
	{
		switch(row)
		{
			case 0:
			{
        new RandomSpawn = random(38);
        if (RandomSpawn == 0)
        {
        	SetPlayerPos(playerid, 273.3611, 2640.7261, 36.3470);
        }
        if (RandomSpawn == 1)
        {
        	SetPlayerPos(playerid, 232.0263,1932.8938,33.8984);
        }
        if (RandomSpawn == 2)
        {
        	SetPlayerPos(playerid, 236.0530,1894.9713,17.6406);
        }
        if (RandomSpawn == 3)
        {
        	SetPlayerPos(playerid, 245.3615,1862.2224,21.1126);
        }
        if (RandomSpawn == 4)
        {
        	SetPlayerPos(playerid, 200.3326,1858.2537,20.6406);
        }
        if (RandomSpawn == 5)
        {
        	SetPlayerPos(playerid, 211.9483,1810.0366,21.8672);
        }
        if (RandomSpawn == 6)
        {
        	SetPlayerPos(playerid, 166.9815,1840.6497,17.6406);
        }
        if (RandomSpawn == 7)
        {
        	SetPlayerPos(playerid, 128.4109,1878.6036,17.8359);
        }
        if (RandomSpawn == 8)
        {
        	SetPlayerPos(playerid, 129.3370,1925.1088,19.1752);
        }
        if (RandomSpawn == 9)
        {
        	SetPlayerPos(playerid, 223.8441,1857.1753,13.0944);
        }
        if (RandomSpawn == 10)
        {
        	SetPlayerPos(playerid, 202.9876,1872.8014,13.1406);
        }
        if (RandomSpawn == 11)
        {
        	SetPlayerPos(playerid, 242.3129,1864.5219,11.4609);
        }
        if (RandomSpawn == 12)
        {
        	SetPlayerPos(playerid, 248.0665,1859.1890,14.0840);
        }
        if (RandomSpawn == 13)
        {
        	SetPlayerPos(playerid, 254.8513,1878.9127,11.4609);
        }
        if (RandomSpawn == 14)
        {
        	SetPlayerPos(playerid, 259.7298,1851.4579,8.7578);
        }
        if (RandomSpawn == 15)
        {
        	SetPlayerPos(playerid, 240.1163,1861.3767,8.7578);
        }
        if (RandomSpawn == 16)
        {
        	SetPlayerPos(playerid, 245.4902,1830.1782,7.5547);
        }
        if (RandomSpawn == 17)
        {
        	SetPlayerPos(playerid, 239.0824,1808.1866,6.1719);
        }
        if (RandomSpawn == 18)
        {
        	SetPlayerPos(playerid, 252.6927,1797.8153,7.4141);
        }
        if (RandomSpawn == 19)
        {
        	SetPlayerPos(playerid, 236.9305,1831.4562,7.4141);
        }
        if (RandomSpawn == 20)
        {
        	SetPlayerPos(playerid, 215.9379,1822.6302,6.4141);
        }
        if (RandomSpawn == 21)
        {
        	SetPlayerPos(playerid, 236.6660,1802.6661,7.4141);
        }
        if (RandomSpawn == 22)
        {
        	SetPlayerPos(playerid, 267.4977,1841.6442,6.8520);
        }
        if (RandomSpawn == 23)
        {
        	SetPlayerPos(playerid, 241.8859,1821.9656,4.7109);
        }
        if (RandomSpawn == 24)
        {
        	SetPlayerPos(playerid, 255.5562,1816.1385,4.7109);
        }
        if (RandomSpawn == 25)
        {
        	SetPlayerPos(playerid, 260.3824,1815.8860,1.0078);
        }
        if (RandomSpawn == 26)
        {
        	SetPlayerPos(playerid, 292.5137,1815.5718,1.0078);
        }
        if (RandomSpawn == 27)
        {
        	SetPlayerPos(playerid, 281.3143,1816.4624,4.7266);
        }
        if (RandomSpawn == 28)
        {
        	SetPlayerPos(playerid, 287.5507,1823.8722,7.7340);
        }
        if (RandomSpawn == 29)
        {
        	SetPlayerPos(playerid, 278.1741,1839.1014,7.8281);
        }
        if (RandomSpawn == 30)
        {
        	SetPlayerPos(playerid, 312.9463,1839.4019,7.8281);
        }
        if (RandomSpawn == 31)
        {
        	SetPlayerPos(playerid, 298.5213,1847.3112,7.7266);
        }
        if (RandomSpawn == 32)
        {
        	SetPlayerPos(playerid, 295.1481,1869.6093,8.7578);
        }
        if (RandomSpawn == 33)
        {
        	SetPlayerPos(playerid, 272.6928,1872.0930,8.7578);
        }
        if (RandomSpawn == 34)
        {
        	SetPlayerPos(playerid, 266.0941,1856.3392,8.7578);
        }
        if (RandomSpawn == 35)
        {
        	SetPlayerPos(playerid, 260.8247,1879.2905,8.4375);
        }
        if (RandomSpawn == 36)
        {
        	SetPlayerPos(playerid, 273.8445,1878.0898,-1.3047);
        }
        if (RandomSpawn == 37)
        {
        	SetPlayerPos(playerid, 263.5170,1889.7573,-10.6953);
        }
        minute[playerid] = true;
        Gravity[playerid] = true;
			  ResetPlayerWeapons(playerid);
			  TogglePlayerControllable(playerid, 1);
				SetPlayerInterior(playerid, 0);
				GivePlayerWeapon(playerid, 46, 1);
				GivePlayerWeapon(playerid, 17, 6);
				GivePlayerWeapon(playerid, 37, 50);
help!
Reply
#2

That code, as far as I can see, only teleports you to a dm via a menu. To teleport you back after death you need something like
pawn Код:
IsPlayerInDM[MAX_PLAYERS];

//when player types command to go into dm1
IsPlayerInDM[playerid] = 1;

//OnPlayerSpawn
switch(IsPlayerInDM[playerid])
{
  case 1: SetPlayerPos(somewhere in dm1)
  case 2: SetPlayerPos(dm2)
///etc
Reply
#3

Quote:
Originally Posted by dice7
That code, as far as I can see, only teleports you to a dm via a menu. To teleport you back after death you need something like
pawn Код:
IsPlayerInDM[MAX_PLAYERS];

//when player types command to go into dm1
IsPlayerInDM[playerid] = 1;

//OnPlayerSpawn
switch(IsPlayerInDM[playerid])
{
  case 1: SetPlayerPos(somewhere in dm1)
  case 2: SetPlayerPos(dm2)
///etc
Yes true,but I don't think this is a good idea since I need to create a lot of variables for it?!
Like:
Код:
IsPlayerInDM[MAX_PLAYERS];

//when player types command to go into dm1
IsPlayerInDM[playerid] = 1;

//OnPlayerSpawn
switch(IsPlayerInDM[playerid])
{
  case 1: SetPlayerPos(somewhere in dm1)
  case 2: SetPlayerPos(dm2)
///etc
than another one like this but with other variable name?
PlayerInDM[MAX_PLAYERS];

//when player types command to go into dm1
PlayerInDM[playerid] = 1;

//OnPlayerSpawn
switch(PlayerInDM[playerid])
{
  case 1: SetPlayerPos(somewhere in dm1)
  case 2: SetPlayerPos(dm2)
///etc
like that? if yes than it's not good
Reply
#4

Also I have 20 death matches..so how than?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)