Hallo,
ich habe einen Freeroam Server gemacht in dem es 8 DM´s gibt. Leider, spawnd man ab und zu einfach nicht in den vorgegebenen Positionen.
Man bekommt zwar die waffen und wird in eine adnere Welt gesetzt, aber nicht in die DM Arena.
Code
new DMRandom[8];
public OnPlayerSpawn(playerid)
{
if(DM1[playerid] == 1){
SetPlayerVirtualWorld(playerid, 1);
ResetPlayerWeapons(playerid);
DMRandom[0] = random(4);
switch(DMRandom[0])
{
case 0:
{
SetPlayerPos(playerid, 1387.9513,2190.0144,11.0234);
}
case 1:
{
SetPlayerPos(playerid, 1391.1406,2109.3345,11.0156);
}
case 2:
{
SetPlayerPos(playerid, 1306.1323,2108.0132,11.0156);
}
case 3:
{
SetPlayerPos(playerid, 1334.8402,2136.6853,11.0156);
}
}
GivePlayerWeapon(playerid, 26, 5000);
}
und der Befehl
dcmd_dm1(playerid, params[])
{
#pragma unused params
if(dma[playerid] == 1) return SendClientMessage(playerid,Rot,"Du bist bereits in einem Deathmatch!");
new String[200];
dm[0] ++;
dma[playerid] = 1;
DM1[playerid] = 1;
dmupdate();
SetPlayerVirtualWorld(playerid, 1);
format(String,200,">> %s hat das dm1 betreten (/dm1)<<", SpielerName(playerid));
SendClientMessageToAll(Gelb,String);
DMRandom[0] = random(5);
switch(DMRandom[0])
{
case 0:
{
SetPlayerPos(playerid, 1387.9513,2190.0144,11.0234);
}
case 1:
{
SetPlayerPos(playerid, 1391.1406,2109.3345,11.0156);
}
case 2:
{
SetPlayerPos(playerid, 1306.1323,2108.0132,11.0156);
}
case 3:
{
SetPlayerPos(playerid, 1334.8402,2136.6853,11.0156);
}
}
SendClientMessage(playerid, 0xFFFFFFAA, "Tippe /exit um das DM zu verlassen!"); //Nachricht für Player wie man DM verlässt
GivePlayerWeapon(playerid, 26, 5000);
return 1;
}