Mein Problem liegt daran, wenn ich den den Server betrete und z.B. in /dm1 möchte meint er immer zu mir das ich schon in einer Arena bin, was mache ich falsch?
if(strcmp(cmdtext,"/exit",true)==0)
{
if(IstInDM(playerid)==1)
{
new string[128];
SetPVarInt(playerid,"IstInDM",0);
SetPlayerPos(playerid,-2466.0884,2215.8916,4.9844);
SetPlayerInterior(playerid,0);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
ResetPlayerWeapons(playerid);
SendClientMessage(playerid,0x00FFFFFF,"[INFO]: Du hast die Arena verlassen");
format(string,sizeof(string),"[ARENA-INFO]: %s ist zurück in Bayside!",SpielerName(playerid));
SendClientMessageToAll(0xFF000050,string);
}
else
{
SendClientMessage(playerid,0xFF000050,"Du bist in keiner DM Arena!");
}
return 1;
}
if(strcmp(cmdtext,"/dm1",true)==0)
{
if(IstInDM(playerid)==0)
{
new string[128], rand;
ResetPlayerWeapons(playerid);
SetPVarInt(playerid,"IstInDM1",1);
SendClientMessage(playerid,0x00FFFFFF,"[INFO]: Um /dm1 zu verlassen, tippe /exit ein");
rand = random(sizeof(dm1Spawns));
SetPlayerPos(playerid, dm1Spawns[rand][0], dm1Spawns[rand][1], dm1Spawns[rand][2]);
SetPlayerInterior(playerid,10);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
GivePlayerWeapon(playerid, 24, 150);
GivePlayerWeapon(playerid, 25, 150);
GivePlayerWeapon(playerid, 34, 150);
format(string,sizeof(string),"[ARENA-INFO]: %s hat /dm1 betreten!",SpielerName(playerid));
SendClientMessageToAll(0xFF000050,string);
}
else
{
SendClientMessage(playerid,0xFF000050,"Du bist in bereits in einer Arena!");
}
return 1;
}
Dazugehöriger Stock:
stock IstInDM(playerid)
{
if(GetPVarInt(playerid, "IstInDM1") == 1 || GetPVarInt(playerid, "IstInDM2") == 1 || GetPVarInt(playerid, "IstIndeagle") == 1 || GetPVarInt(playerid, "IstInm4") == 1 || GetPVarInt(playerid, "IstInshotgun") == 1 || GetPVarInt(playerid, "IstInmp5") == 1 || GetPVarInt(playerid, "IstInknife") == 1 || GetPVarInt(playerid, "IstInsniper") == 1 || GetPVarInt(playerid, "IstInstartower") == 1 || GetPVarInt(playerid, "IstInsfpdgar") == 1)
return 1;
return 1;
}