if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
{
if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerInfo[playerid][pLocal] != 255)
{
if(OnDuty[playerid]==0)
{
new name[MAX_PLAYER_NAME], string[124];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* Du hast deine Waffe aus dem Spinnt genommen.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string,sizeof(string),"* Der Beamte %s ist in den Dienst gegangen!", name);
SendClientMessageToAll(COLOR_NEWS,string);
SetPlayerHealth(playerid,100.0);
SetPlayerColor(playerid,COLOR_LIGHTBLUE);
SetPlayerArmour(playerid,100.00);
GivePlayerWeapon(playerid, 29, 999);
GivePlayerWeapon(playerid, 31, 999);
GivePlayerWeapon(playerid, 25, 999);
GivePlayerWeapon(playerid, 3, 0);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1)
{
new name[MAX_PLAYER_NAME], string[124];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* Du hast deine Waffe in den Spinnt gelegt.", sendername);
SetPlayerArmour(playerid,0.0);
ResetPlayerWeapons(playerid);
SetPlayerColor(playerid,COLOR_WHITE);
format(string,sizeof(string),"* Der Beamte %s ist aus dem Dienst gegangen!", name);
SendClientMessageToAll(COLOR_NEWS,string);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
OnDuty[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht im Umkleideraum !");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun auser Dienst.");
JobDuty[playerid] = 0;
Medics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst.");
JobDuty[playerid] = 1;
Medics += 1;
}
}
else if(PlayerInfo[playerid][pJob] == 7)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun auser Dienst.");
JobDuty[playerid] = 0;
Mechanics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst.");
JobDuty[playerid] = 1;
Mechanics += 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du bist kein Bulle !");
}
}
return 1;
}
Ich wollte das so machen aber da können aufeinmal alle duty gehen
if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pMember] == 1,2,3||PlayerInfo[playerid][pLeader] == 1,2,3)
{
if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) PlayerInfo[playerid][pLocal] != 255)
{
if(OnDuty[playerid]==0)
{
new name[MAX_PLAYER_NAME], string[124];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* Du hast deine Waffe aus dem Spinnt genommen.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string,sizeof(string),"* Der Beamte %s ist in den Dienst gegangen!", name);
SendClientMessageToAll(COLOR_NEWS,string);
SetPlayerHealth(playerid,100.0);
SetPlayerColor(playerid,COLOR_LIGHTBLUE);
SetPlayerArmour(playerid,100.00);
GivePlayerWeapon(playerid, 29, 999);
GivePlayerWeapon(playerid, 31, 999);
GivePlayerWeapon(playerid, 25, 999);
GivePlayerWeapon(playerid, 3, 0);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1)
{
new name[MAX_PLAYER_NAME], string[124];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* Du hast deine Waffe in den Spinnt gelegt.", sendername);
SetPlayerArmour(playerid,0.0);
ResetPlayerWeapons(playerid);
SetPlayerColor(playerid,COLOR_WHITE);
format(string,sizeof(string),"* Der Beamte %s ist aus dem Dienst gegangen!", name);
SendClientMessageToAll(COLOR_NEWS,string);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
OnDuty[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht im Umkleideraum !");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun auser Dienst.");
JobDuty[playerid] = 0;
Medics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst.");
JobDuty[playerid] = 1;
Medics += 1;
}
}
else if(PlayerInfo[playerid][pJob] == 7)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun auser Dienst.");
JobDuty[playerid] = 0;
Mechanics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst.");
JobDuty[playerid] = 1;
Mechanics += 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du bist kein Bulle !");
}
}
return 1;
}
Wie kann ich das hinbekommen ?