arena2 random spawns
#1

I've made arena2 dm teleport command but for some reason when I go there I spawn at mid air somewhere far away..

Код:
new Float:RandomArena2Spawns[][MAX_PLAYERS] =
{
  {244.8585, 144.8178,1003.0234,13.4334},
  {221.1501, 145.1775,1003.0234,180.6686},
  {298.2168, 182.5941,1007.1719,93.3538},
  {286.3303, 170.5405,1007.1719,11.3700}
};
(Those are the correct coordinates)

And for the command itself

Код:
CMD:arena2(playerid, params[])
{
   if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
   new Float:health, name[MAX_PLAYER_NAME], str[128];
   GetPlayerHealth(playerid, health);
   new arenainterior = GetPlayerInterior(playerid);
   if(health < 90) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You must have atleast 90 HP in order to go to the arena");
   if(arenainterior == 18) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You're already inside arena2, Use /aleave to leave");
   else
   {
      Killed[playerid] = 0;
      PlayerTotalKills[playerid] = 0;
      InArena2[playerid] = 1;
      SetPlayerVirtualWorld(playerid, 3);
      new randomarena2 = random(sizeof(RandomArena2Spawns));
      SetPlayerPos(playerid, RandomArena2Spawns[randomarena2][0],RandomArena2Spawns[randomarena2][1],RandomArena2Spawns[randomarena2][2]);
      SetPlayerFacingAngle(playerid, RandomArena2Spawns[randomarena2][3]);
      GetPlayerName(playerid, name, sizeof(name));
      format(str, sizeof(str), "{4286f4}(INFO) %s has teleported to Arena 2, (/arena2)", name);
      SendClientMessageToAll(-1, str);
      ResetPlayerWeapons(playerid);
      SetTimer("GiveWeaponsArena2", 1000, false);
   }
   return 1;
}
CMD:aleave(playerid, params[])
{
	if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
	else if(InArena1[playerid] == 1)
    {
    InArena1[playerid] = 0;
    Killed[playerid] = 0;
    PlayerTotalKills[playerid] = 0;
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SendClientMessage(playerid, -1, "{EFB509}(INFO) You have left arena1!");
    SpawnPlayer(playerid);
	}
    else if(InArena2[playerid] == 1)
    {
    InArena2[playerid] = 0;
    Killed[playerid] = 0;
    PlayerTotalKills[playerid] = 0;
    SetPlayerVirtualWorld(playerid, 0);
    SendClientMessage(playerid, -1, "{EFB509}(INFO) You have left arena2!");
    SpawnPlayer(playerid);
    }
    else return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You're not in the arena!");
    return 1;
}
Reply
#2

Quote:
Originally Posted by ivndosos
Посмотреть сообщение
I've made arena2 dm teleport command but for some reason when I go there I spawn at mid air somewhere far away..

Код:
new Float:RandomArena2Spawns[][MAX_PLAYERS] =
{
  {244.8585, 144.8178,1003.0234,13.4334},
  {221.1501, 145.1775,1003.0234,180.6686},
  {298.2168, 182.5941,1007.1719,93.3538},
  {286.3303, 170.5405,1007.1719,11.3700}
};
(Those are the correct coordinates)

And for the command itself

Код:
CMD:arena2(playerid, params[])
{
   if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
   new Float:health, name[MAX_PLAYER_NAME], str[128];
   GetPlayerHealth(playerid, health);
   new arenainterior = GetPlayerInterior(playerid);
   if(health < 90) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You must have atleast 90 HP in order to go to the arena");
   if(arenainterior == 18) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You're already inside arena2, Use /aleave to leave");
   else
   {
      Killed[playerid] = 0;
      PlayerTotalKills[playerid] = 0;
      InArena2[playerid] = 1;
      SetPlayerVirtualWorld(playerid, 3);
      new randomarena2 = random(sizeof(RandomArena2Spawns));
      SetPlayerPos(playerid, RandomArena2Spawns[randomarena2][0],RandomArena2Spawns[randomarena2][1],RandomArena2Spawns[randomarena2][2]);
      SetPlayerFacingAngle(playerid, RandomArena2Spawns[randomarena2][3]);
      GetPlayerName(playerid, name, sizeof(name));
      format(str, sizeof(str), "{4286f4}(INFO) %s has teleported to Arena 2, (/arena2)", name);
      SendClientMessageToAll(-1, str);
      ResetPlayerWeapons(playerid);
      SetTimer("GiveWeaponsArena2", 1000, false);
   }
   return 1;
}
CMD:aleave(playerid, params[])
{
	if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
	else if(InArena1[playerid] == 1)
    {
    InArena1[playerid] = 0;
    Killed[playerid] = 0;
    PlayerTotalKills[playerid] = 0;
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SendClientMessage(playerid, -1, "{EFB509}(INFO) You have left arena1!");
    SpawnPlayer(playerid);
	}
    else if(InArena2[playerid] == 1)
    {
    InArena2[playerid] = 0;
    Killed[playerid] = 0;
    PlayerTotalKills[playerid] = 0;
    SetPlayerVirtualWorld(playerid, 0);
    SendClientMessage(playerid, -1, "{EFB509}(INFO) You have left arena2!");
    SpawnPlayer(playerid);
    }
    else return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You're not in the arena!");
    return 1;
}
PHP код:
new Float:RandomArena2Spawns[][] =
{
  {
244.8585144.8178,1003.0234,13.4334},
  {
221.1501145.1775,1003.0234,180.6686},
  {
298.2168182.5941,1007.1719,93.3538},
  {
286.3303170.5405,1007.1719,11.3700}
}; 
Reply
#3

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
PHP код:
new Float:RandomArena2Spawns[][] =
{
  {
244.8585144.8178,1003.0234,13.4334},
  {
221.1501145.1775,1003.0234,180.6686},
  {
298.2168182.5941,1007.1719,93.3538},
  {
286.3303170.5405,1007.1719,11.3700}
}; 
Same issue, I just spawn in mid air, It's not even in an interior I don't know what's causing this!
Reply
#4

Quote:
Originally Posted by ivndosos
Посмотреть сообщение
Same issue, I just spawn in mid air, It's not even in an interior I don't know what's causing this!
are you 100 percent sure the coords are correct? re-check em.
Reply
#5

I'll try to re-make them, and I will inform you if It's the same issue.
Reply
#6

I've changed the coordinates and this time It's an interior, Seems to work now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)