11.02.2018, 12:58
I've made arena2 dm teleport command but for some reason when I go there I spawn at mid air somewhere far away..
(Those are the correct coordinates)
And for the command itself
Код:
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} };
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; }