A weird bug with my aleave command
#1

Код:
CMD:aleave(playerid, params[])
{
   if(InArena1[playerid] == 1)
   {
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SendClientMessage(playerid, -1, "{EFB509}(INFO) You have left arena1!");
    SpawnPlayer(playerid);
   }
   else
   {
	  SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You're not in the arena!");
   }
   return 1;
}
.

When I use that command, Instead of spawning, It spawns me at the sky somewhere far, Why so?
Reply
#2

Show us the code where the player enters the arena
Reply
#3

Код:
CMD:arena1(playerid, params[])
{
   new Float:health, name[MAX_PLAYER_NAME], str[128];
   GetPlayerHealth(playerid, health);
   AFKTime[playerid] = SetTimer("AFKCheck",1000,1);
   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 arena1, Use /aleave to leave");
   else
   {
      InArena1[playerid] = 1;
	  SetPlayerVirtualWorld(playerid, 2);
	  SetPlayerInterior(playerid, 18);
	  new randomarena1 = random(sizeof(RandomArena1Spawns));
	  SetPlayerPos(playerid, RandomArena1Spawns[randomarena1][0],RandomArena1Spawns[randomarena1][1],RandomArena1Spawns[randomarena1][2]);
	  SetPlayerFacingAngle(playerid, RandomArena1Spawns[randomarena1][3]);
	  GetPlayerName(playerid, name, sizeof(name));
	  format(str, sizeof(str), "{4286f4}(INFO) %s has teleported to Arena 1, To go there type /arena1.", name);
	  SendClientMessageToAll(-1, str);
	  GivePlayerWeapon(playerid, 24, 999);
	  GivePlayerWeapon(playerid, 25, 999);
   }
   return 1;
}
Reply
#4

is RandomArena1Spawns[randomarena1] a float?
Reply
#5

I've fixed it, Had to add InArena1[playerid] = 0;

Haven't realized it, till my mate told me, lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)