Hallo Cm.
Ich habe ein Problem unzwar /duty für Fraktion 22 = SWAT und einmal bei befehl /d fraktion 22 = SWAT bei /duty geht der nicht mehr Duty ( ging aber früher ), bei /d schreibt der nicht im /d chat !
if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(SpielerInfo[playerid][sMember] == 1 || SpielerInfo[playerid][sLeader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid,2,197.0455,168.4587,1003.0234) || IsPlayerInRangeOfPoint(playerid,2,197.0455,168.4587,1003.0234))
{
if(OnDuty[playerid]==0)
{
format(string, sizeof(string), "* Polizist %s nimmt seine Marke und seine Waffe aus dem Spint.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,3,1);//polizei schläger
GivePlayerWeapon(playerid,24,500);//deagle
GivePlayerWeapon(playerid,25,300);//shotgun
GivePlayerWeapon(playerid,29,800);//mp5
GivePlayerWeapon(playerid,41,800);//spray
OnDuty[playerid] = 1;
SetPlayerColor(playerid,copcolor);
}
else if(OnDuty[playerid]==1)
{
format(string, sizeof(string), "* Polizist %s legt seine Marke und seine Waffe in den Spint.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ResetPlayerWeapons(playerid);
OnDuty[playerid] = 0;
SetPlayerColor(playerid,TEAM_HIT_COLOR);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht vorm Spint!");
return 1;
}
}
else if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(SpielerInfo[playerid][sMember] == 2 || SpielerInfo[playerid][sLeader] == 2)
{
if(IsPlayerInRangeOfPoint(playerid,5, 226.0953,121.4277,1010.2188) || IsPlayerInRangeOfPoint(playerid,3, 226.0953,121.4277,1010.2188))
{
if(OnDuty[playerid]==0)
{
format(string, sizeof(string), "* FBI Agent %s nimmt seine Marke und seine Waffe aus dem Schrank.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,3,1);//polizei schläger
GivePlayerWeapon(playerid,24,500);//deagle
GivePlayerWeapon(playerid,25,500);//shotgun
GivePlayerWeapon(playerid,29,500);//mp5
GivePlayerWeapon(playerid,41,800);//spray
GivePlayerWeapon(playerid,31,500);//M4
OnDuty[playerid] = 1;
SetPlayerColor(playerid,copcolor);
}
else if(OnDuty[playerid]==1)
{
format(string, sizeof(string), "* FBI Agent %s legt seine Marke und seine Waffe in den Schrank.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ResetPlayerWeapons(playerid);
OnDuty[playerid] = 0;
SetPlayerColor(playerid,TEAM_HIT_COLOR);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht vorm Spint !");
return 1;
}
}
}
else if(SpielerInfo[playerid][sMember] == 22 || SpielerInfo[playerid][sLeader] == 22)
{
if(IsPlayerInRangeOfPoint(playerid,3,257.9104,77.3784,1003.6406) || IsPlayerInRangeOfPoint(playerid,3,257.9104,77.3784,1003.6406))
{
if(OnDuty[playerid]==0)
{
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,3,1);//polizei schläger
GivePlayerWeapon(playerid,24,500);//deagle
GivePlayerWeapon(playerid,31,800);//M4
GivePlayerWeapon(playerid,29,800);//mp5
GivePlayerWeapon(playerid,41,800);//spray
GivePlayerWeapon(playerid,34,200);//spray
OnDuty[playerid] = 1;
SetPlayerColor(playerid,copcolor);
if(SpielerInfo[playerid][sLeader]== 22 || SpielerInfo[playerid][sMember] == 22)
{
format(string, sizeof(string), "<< S.W.A.T Beamter %s ist nun als S.W.A.T Einheit verfügbar >>", sendername);
OOCNews(COLOR_LIGHTRED, string);
}
if(Maske[playerid] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, 0);
new MASKETEXT[MAX_PLAYER_NAME];
MASKETEXT = "Maskierter";
MASKE[playerid] = Create3DTextLabel(MASKETEXT,0x007380FF,0,0,0,20.5,1);
Attach3DTextLabelToPlayer(MASKE[playerid], playerid, 0.0, 0.0, 0.10);
Delete3DTextLabel(ADMIN1[playerid]);
Delete3DTextLabel(ADMIN2[playerid]);
Delete3DTextLabel(ADMIN3[playerid]);
Delete3DTextLabel(ADMIN4[playerid]);
Delete3DTextLabel(ADMIN5[playerid]);
Delete3DTextLabel(ADMIN6[playerid]);
Delete3DTextLabel(ADMIN7[playerid]);
Delete3DTextLabel(ADMIN8[playerid]);
Delete3DTextLabel(Premium9[playerid]);
Delete3DTextLabel(AFK[playerid]);
Maske[playerid] = 1;
}
}
else if(OnDuty[playerid]==1)
{
Delete3DTextLabel(MASKE[playerid]);
ResetPlayerWeapons(playerid);
OnDuty[playerid] = 0;
SetPlayerColor(playerid,TEAM_HIT_COLOR);
if(SpielerInfo[playerid][sLeader]== 22 || SpielerInfo[playerid][sMember] == 22)
{
format(string, sizeof(string), "<< S.W.A.T Beamter %s ist nun nicht mehr als S.W.A.T Einheit verfügbar >>", sendername);
OOCNews(COLOR_LIGHTRED, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht vorm Spint!");
return 1;
}
}
else if(SpielerInfo[playerid][sMember] == 4 ||SpielerInfo[playerid][sLeader] == 4)
{
if(OnDuty[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun als Arzt im Dienst. Du wirst Anrufe empfangen.");
OnDuty[playerid] = 1;
Medics += 1;
}
else if(OnDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun nicht mehr als Arzt im Dienst. Du wirst keine Anrufe empfangen.");
OnDuty[playerid] = 0;
Medics -= 1;
}
}
else if(SpielerInfo[playerid][sMember] == 18||SpielerInfo[playerid][sLeader] == 18)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun nicht mehr als Oamt im Dienst. Du wirst keine Anrufe empfangen.");
JobDuty[playerid] = 0;
OAmtler -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun als Oamt im Dienst. Du wirst Anrufe empfangen.");
JobDuty[playerid] = 1;
OAmtler += 1;
}
}
else if(SpielerInfo[playerid][sJob] == 7)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Als Mechaniker bist du nun nicht mehr im Dienst. In der Zeit wirst du keine Meldungen mehr bekommen.");
JobDuty[playerid] = 0;
Mechanics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Als Mechaniker bist du nun im Dienst. Leute werden deinen Service brauchen.");
JobDuty[playerid] = 1;
Mechanics += 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du bist nicht befugt diesen Befehl zu nutzen !");
}
}
return 1;
}
if(strcmp(cmd, "/department", true) == 0 || strcmp(cmd, "/d", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: (/d)epartment [text]");
return 1;
}
if(SpielerInfo[playerid][sMember] == 22 || SpielerInfo[playerid][sLeader] == 22)
{
if(SpielerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Commander %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Vice Commander %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Major %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Captain %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Lieutenant %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][sLeader] == 1) { format(string, sizeof(string), "** Commander %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result);
}
if(SpielerInfo[playerid][sMember] >= 22)
{
SendMemberMessage(SpielerInfo[playerid][sMember],0x6565FFFF, string);
SendLeaderMessage(SpielerInfo[playerid][sMember],0x6565FFFF, string);
}
else if(SpielerInfo[playerid][sLeader] >= 22)
{
SendMemberMessage(SpielerInfo[playerid][sLeader],0x6565FFFF, string);
SendLeaderMessage(SpielerInfo[playerid][sLeader],0x6565FFFF, string);
}
printf("%s", string);
return 1;
}
else if(SpielerInfo[playerid][sMember] == 1 || SpielerInfo[playerid][sLeader] == 1)
{
if(SpielerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** SAPD Präsident %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** SAPD Vice Präsident %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Lieutenant %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Cadet %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][sLeader] == 1) { format(string, sizeof(string), "** SAPD Präsident %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result);
}
SendMemberMessage(playerid,0x6565FFFF, string);
SendLeaderMessage(playerid,0x6565FFFF, string);
printf("%s", string);
return 1;
}
else if(SpielerInfo[playerid][sMember] == 2 || SpielerInfo[playerid][sLeader] == 2)
{
if(SpielerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Director %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Superbisor %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Clite Agent %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Special Agent %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Professional Agent %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** New Agent %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][sLeader] == 2) { format(string, sizeof(string), "** Director %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** New Agent %s: %s, over. **", sendername, result);
}
SendMemberMessage(playerid,0x6565FFFF, string);
SendLeaderMessage(playerid,0x6565FFFF, string);
printf("%s", string);
return 1;
}
else if(SpielerInfo[playerid][sMember] == 3 || SpielerInfo[playerid][sLeader] == 3)
{
if(SpielerInfo[playerid][pRank] == 12) { format(string, sizeof(string), "** General %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 11) { format(string, sizeof(string), "** Oberst BT %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 10) { format(string, sizeof(string), "** Oberst LW %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 9) { format(string, sizeof(string), "** Oberst GWD %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** Hauptmann GWD %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** Hauptmann BT %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Hauptmann LW %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Feldwebel %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Soldat BT %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Soldat LW %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Rekrut %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Wehrdienstler %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Wehrdienstler %s: %s, over. **", sendername, result);
}
SendMemberMessage(playerid,0x6565FFFF, string);
SendLeaderMessage(playerid,0x6565FFFF, string);
printf("%s", string);
return 1;
}
else if(SpielerInfo[playerid][sMember] == 7 || SpielerInfo[playerid][sLeader] == 7)
{
if(SpielerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Präsident %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Angestellter %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Angestellter %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Angestellter %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Angestellter %s: %s, over. **", sendername, result);
}
SendMemberMessage(playerid,0x6565FFFF, string);
SendLeaderMessage(playerid,0x6565FFFF, string);
printf("%s", string);
return 1;
}
else if(SpielerInfo[playerid][sMember] == 18 || SpielerInfo[playerid][sLeader] == 18)
{
if(SpielerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Ordnung %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Ordnung %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Ordnung %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Ordnung %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Ordnung %s: %s, over. **", sendername, result); }
else if(SpielerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Ordnung %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Ordnung %s: %s, over. **", sendername, result);
}
SendMemberMessage(playerid,0x6565FFFF, string);
SendLeaderMessage(playerid,0x6565FFFF, string);
printf("%s", string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Du darfst dieses Befehl nicht benutzen!");
return 1;
}
}
return 1;
}