Hallo,
Wen der Admin /aduty macht bekommt er die 100 HP und ich hab ein Timer gesetzt wen der Admin Lebenverliert das es sich sofort wider auffüllen soll was hab ich Falsch gemacht das funktioniert nicht?
if (strcmp(cmd, "/adminduty", true) == 0 || strcmp(cmd, "/aduty", true) == 0)
{
if(AdminDuty[playerid] == 0)
{
if(PlayerInfo[playerid][pAdmin] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun als Moderator im Dienst!");
SetPlayerColor(playerid,0xFF0000FF);
AdminDuty[playerid] = 1;
Mod[playerid] = Create3DTextLabel("*Moderator im Dienst*",COLOR_GOLD,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Mod[playerid], playerid, 0.0, 0.0, 0.4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s hat sich als Moderator angemeldet",sendername);
SendClientMessageToAll(COLOR_GOLD, string);
SetPlayerHealth(playerid, 100);
SetTimer("unsterblich", 1500, 1);
return 1;
}
else if(PlayerInfo[playerid][pAdmin] == 2)
{
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun als Admin");
SetPlayerColor(playerid,0xFF0000FF);
AdminDuty[playerid] = 1;
Mod[playerid] = Create3DTextLabel("*Administrator im Dienst*",COLOR_GOLD,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Mod[playerid], playerid, 0.0, 0.0, 0.4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s hat sich als Admin angemeldet",sendername);
SendClientMessageToAll(0xFF0000FF, string);
SetPlayerHealth(playerid, 100);
SetTimer("unsterblich", 1500, 1);
return 1;
}
else if(PlayerInfo[playerid][pAdmin] == 3)
{
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun als Admin im Dienst.");
SetPlayerColor(playerid,0xFF0000FF);
AdminDuty[playerid] = 1;
Supermod[playerid] = Create3DTextLabel("*Administrator im Dienst*",COLOR_GOLD,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Supermod[playerid], playerid, 0.0, 0.0, 0.4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s hat sich als Admin angemeldet",sendername);
SendClientMessageToAll(0xFF0000FF, string);
SetPlayerHealth(playerid, 100);
SetTimer("unsterblich", 1500, 1);
return 1;
}
else if(PlayerInfo[playerid][pAdmin] ==4)
{
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun als Head Admin im Dienst.");
SetPlayerColor(playerid,0xFF0000FF);
AdminDuty[playerid] = 1;
Admin[playerid] = Create3DTextLabel("*Administrator im Dienst*",COLOR_GOLD,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Admin[playerid], playerid, 0.0, 0.0, 0.4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s hat sich als Supporter angemeldet",sendername);
SendClientMessageToAll(0xFF0000FF, string);
SetPlayerHealth(playerid, 100);
SetTimer("unsterblich", 1500, 1);
return 1;
}
else if(PlayerInfo[playerid][pAdmin] ==5)
{
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun als Administrator im Dienst!");
SetPlayerColor(playerid,0xFF0000FF);
AdminDuty[playerid] = 1;
Admin[playerid] = Create3DTextLabel("*Administrator im Dienst*",COLOR_GOLD,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Admin[playerid], playerid, 0.0, 0.0, 0.4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s hat sich als Admin angemeldet",sendername);
SendClientMessageToAll(0xFF0000FF, string);
SetPlayerHealth(playerid, 100);
SetTimer("unsterblich", 1500, 1);
return 1;
}
else if(PlayerInfo[playerid][pAdmin] ==6)
{
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun als Head Admin im Dienst!");
SetPlayerColor(playerid,0xFF0000FF);
AdminDuty[playerid] = 1;
Admin[playerid] = Create3DTextLabel("*Head Admin im Dienst*",COLOR_GOLD,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Admin[playerid], playerid, 0.0, 0.0, 0.4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s hat sich als Head Admin angemeldet",sendername);
SendClientMessageToAll(0xFF0000FF, string);
SetPlayerHealth(playerid, 100);
SetTimer("unsterblich", 1500, 1);
return 1;
}
else if(PlayerInfo[playerid][pAdmin] ==7)
{
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun als Projektleiter im Dienst!");
SetPlayerColor(playerid,0xFF0000FF);
AdminDuty[playerid] = 1;
Admin[playerid] = Create3DTextLabel("*Projektleiter im Dienst*",COLOR_GOLD,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Admin[playerid], playerid, 0.0, 0.0, 0.4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s hat sich als Projektleiter angemeldet",sendername);
SendClientMessageToAll(0xFF0000FF, string);
SetPlayerHealth(playerid, 100);
SetTimer("unsterblich", 1500, 1);
return 1;
}
else if(PlayerInfo[playerid][pAdmin] >=8)
{
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun als Projektleiter im Dienst!");
SetPlayerColor(playerid,0xFF0000FF);
AdminDuty[playerid] = 1;
Admin[playerid] = Create3DTextLabel("*Projektleiter im Dienst*",COLOR_GOLD,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Admin[playerid], playerid, 0.0, 0.0, 0.4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s hat sich als Projektleiter angemeldet",sendername);
SendClientMessageToAll(0xFF0000FF, string);
SetPlayerHealth(playerid, 100);
SetTimer("unsterblich", 1500, 1);
return 1;
}
else if(PlayerInfo[playerid][pSupporter] >= 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun als Supporter im Dienst!");
SetPlayerColor(playerid,0xFF0000FF);
AdminDuty[playerid] = 1;
Supporter[playerid] = Create3DTextLabel("*Supporter im Dienst*",COLOR_GOLD,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Supporter[playerid], playerid, 0.0, 0.0, 0.4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s hat sich als Supporter angemeldet",sendername);
SendClientMessageToAll(0xFF0000FF, string);
SetPlayerHealth(playerid, 100);
SetTimer("unsterblich", 1500, 1);
return 1;
}
}
if(AdminDuty[playerid] == 1)
{
if(PlayerInfo[playerid][pAdmin] == 1)
{
format(string,sizeof(string),"Moderator %s ist nun nicht mehr im Dienst. *",sendername);
SendClientMessageToAll(0xFF0000FF, string);
}
if(PlayerInfo[playerid][pAdmin] == 2)
{
format(string,sizeof(string),"Moderator %s ist nun nicht mehr im Dienst. *",sendername);
SendClientMessageToAll(0xFF0000FF, string);
}
else if(PlayerInfo[playerid][pAdmin] == 3)
{
format(string,sizeof(string),"Administrator %s ist nun nicht mehr im Dienst. *",sendername);
SendClientMessageToAll(0xFF0000FF, string);
}
else if(PlayerInfo[playerid][pAdmin] >=4)
{
format(string,sizeof(string),"Administrator %s ist nun nicht mehr im Dienst. *",sendername);
SendClientMessageToAll(0xFF0000FF, string);
}
else if(PlayerInfo[playerid][pAdmin] >=5)
{
format(string,sizeof(string),"Head Admin %s ist nun nicht mehr im Dienst. *",sendername);
SendClientMessageToAll(0xFF0000FF, string);
}
else if(PlayerInfo[playerid][pAdmin] >=6)
{
format(string,sizeof(string),"Head Admin %s ist nun nicht mehr im Dienst. *",sendername);
SendClientMessageToAll(0xFF0000FF, string);
}
else if(PlayerInfo[playerid][pAdmin] >=7)
{
format(string,sizeof(string),"Projektleiter %s ist nun nicht mehr im Dienst. *",sendername);
SendClientMessageToAll(0xFF0000FF, string);
}
else if(PlayerInfo[playerid][pAdmin] >=8)
{
format(string,sizeof(string),"Projektleiter %s] ist nun nicht mehr im Dienst. *",sendername);
SendClientMessageToAll(0xFF0000FF, string);
}
else if(PlayerInfo[playerid][pSupporter] >= 1)
{
format(string,sizeof(string),"Supporter %s ist nun nicht mehr im Dienst. *",sendername);
SendClientMessageToAll(0xFF0000FF, string);
}
SendClientMessage(playerid,COLOR_YELLOW,"Du bist nun nicht mehr im Dienst!");
Delete3DTextLabel(Admin[playerid]);
Delete3DTextLabel(Supermod[playerid]);
Delete3DTextLabel(Mod[playerid]);
Delete3DTextLabel(Supporter[playerid]);
Delete3DTextLabel(Admin[playerid]);
Delete3DTextLabel(Supermod[playerid]);
Delete3DTextLabel(Mod[playerid]);
Delete3DTextLabel(Supporter[playerid]);
SetPlayerArmour(playerid, 0);
AdminDuty[playerid] = 0;
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
SetPlayerToTeamColor(playerid);
}
else
{
SetPlayerToTeamColor(playerid);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
}
}
return 1;
}
return 1;
}
forward unsterblich(playerid);
public unsterblich (playerid) {
if(un[playerid]==1) {
SetPlayerHealth(playerid, 9999); }
return 1;
}