Hi Leute, suche jetzt mal hier meine Hilfe.
Es ist so, ich hab ein paar Deathmatch Arenen in meinen Gamemode eingebaut. Diese funktionieren auch gut soweit. Das Problem ist, was ich erst gerade bemerkt habe, ist, wenn ein Spieler ohne /leave (also die Arena zu verlassen) das Spiel verlässt und der nächste Spieler spawnen will dann spawnt er anstatt auf den Random Spawns direkt in der Arena, was ja eigentlich nicht sein soll.
new a8check[MAX_PLAYERS]; //sniper
.....
new Float:a8Spawns[4][4] = { // sniper
{-662.6181,2316.1199,138.8176,90.6786},
{-867.2705,2308.4575,160.6870,274.8131},
{-762.2411,2408.5679,157.0142,229.2309},
{-731.5955,2423.9822,128.3631,183.6120}
};
.....
forward RemoveToArena8(playerid);
.....
OnPlayerSpawn
if(a8check[playerid] == 1)
{
RemoveToArena8(playerid); // ZURÜCK ZUR AREAN 5
}
.....
OnplayerCommandText
if (strcmp("/leave", cmdtext, true, 10) == 0)
{
new leave[256];
new playerleave[MAX_PLAYER_NAME];
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid,0);
TextDrawHideForPlayer(playerid, dmtextdraw1);
TextDrawHideForPlayer(playerid, dmtextdraw);
GetPlayerName(playerid, playerleave, sizeof (playerleave));
if(a8check[playerid] == 1)
{
a8check[playerid] = 0;
format(leave, sizeof(leave), "SERVERINFO™: %s has left the Sniper Deathmatch (/leave) !", playerleave);
SendClientMessage(playerid, grau,"* You have left Arena 8 !");
}
.....
if (strcmp("/sniper", cmdtext, true) == 0)
{
if(a8check[playerid] == 1) return SendClientMessage(playerid, grau, "You are already in an Arena!");
ResetPlayerWeapons(playerid);
SetPlayerArmour(playerid, 0.0);
new join[256];
new playerjoin[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerjoin, sizeof (playerjoin));
format(join, sizeof(join), "SERVERINFO™: %s has joined the Sniper Deathmatch! >>(/sniper)<<", playerjoin);
SendClientMessageToAll(grau, join);
a8check[playerid] = 1;
new rand = random(sizeof(a7Spawns));
SetPlayerPos(playerid,a8Spawns[rand][0],a8Spawns[rand][1],a8Spawns[rand][2]);
SetPlayerFacingAngle(playerid,a8Spawns[rand][3]);
GivePlayerWeapon(playerid,34,30001);GivePlayerWeapon(playerid,4,1);
SetPlayerVirtualWorld(playerid, 34);
return 1;
}
.....
public RemoveToArena8(playerid)
{
SetPlayerArmour(playerid, 0.0);
ResetPlayerWeapons(playerid);
new rand = random(sizeof(a5Spawns));
SetPlayerPos(playerid,a8Spawns[rand][0],a8Spawns[rand][1],a8Spawns[rand][2]);
SetPlayerFacingAngle(playerid,a8Spawns[rand][3]);
GivePlayerWeapon(playerid,34,30001);GivePlayerWeapon(playerid,4,1);
}
.....
Ich weiß nich woran es liegt, habe hier glaub ich alle funktionen gepostet, wäre schön wenn ihr damit was anfangen könntet und mir sagen lönntet was ich falsch gemacht habe.