Mein ADuty Befehl bugt ein wenig... Wenn ich aus dem Dienst gehe sterbe ich?
ocmd:aduty(playerid,params[])
{
new Float:Leben, Float:Ruestung, str[128];
if(sInfo[playerid][pEingeloggt] == 0) return SendClientMessage(playerid, GRAU, LOGINERROR);
if(sInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, GRAU, ADMERROR);
GetPlayerArmour(playerid,Ruestung);
GetPlayerHealth(playerid,Leben);
switch(GetPVarInt(playerid, "ADUTY"))
{
case 0:
{
SetPlayerHealth(playerid, FLOAT_INFINITY);
SetPlayerArmour(playerid, 100);
format(str,sizeof(str), "%s hat den Admindienst betreten.", SpielerName(playerid));
SendClientMessageToAll(ADMIN, str);
SetPVarInt(playerid, "ADUTY", 1);
}
case 1:
{
SetPlayerArmour(playerid,Ruestung);
SetPlayerHealth(playerid,Leben);
format(str,sizeof(str), "%s hat den Admindienst verlassen.", SpielerName(playerid));
SetPVarInt(playerid, "ADUTY", 0);
}
}
return 1;
}
Ich habs auch auch so probiert:
ocmd:aduty(playerid,params[])
{
new Float:Leben, Float:Ruestung, str[128];
if(sInfo[playerid][pEingeloggt] == 0) return SendClientMessage(playerid, GRAU, LOGINERROR);
if(sInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, GRAU, ADMERROR);
switch(GetPVarInt(playerid, "ADUTY"))
{
case 0:
{
GetPlayerArmour(playerid,Ruestung);
GetPlayerHealth(playerid,Leben);
SetPlayerHealth(playerid, FLOAT_INFINITY);
SetPlayerArmour(playerid, 100);
format(str,sizeof(str), "%s hat den Admindienst betreten.", SpielerName(playerid));
SendClientMessageToAll(ADMIN, str);
SetPVarInt(playerid, "ADUTY", 1);
}
case 1:
{
SetPlayerArmour(playerid,Ruestung);
SetPlayerHealth(playerid,Leben);
format(str,sizeof(str), "%s hat den Admindienst verlassen.", SpielerName(playerid));
SetPVarInt(playerid, "ADUTY", 0);
}
}
return 1;
}