Will es so machen das man /duty, als ARMY nen Dialog kriegt.
Aber er kriegt kein Dialog.
Wenn ich dann /duty mache steht da, ".. nimmt seine ... "
Und wenn ich nochma /duty mache das selbe, also gehe ich praktisch nich duty.
if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsACop(playerid))
{
if(SwatDuty[playerid]==1)
{
SendClientMessage(playerid, COLOR_RED, "Du bist gerade SWAT Duty und kannst nicht Duty gehen!");
return 1;
}
if (IsPlayerInRangeOfPoint(playerid,10.0,290.2056,-108.0194,1001.5156)
|| PlayerInfo[playerid][pLocal] != 255)
{
if(OnDuty[playerid]==0 || PilotDuty[playerid]==0 || SniperDuty[playerid]==0)
{
format(string, sizeof(string), "%s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(IsPlayerInFrac(playerid,1))
{
SetPlayerColor(playerid,0x0000FFFF);
SetPlayerSkin(playerid,280);
OnDuty[playerid] = 1;
}
if(IsPlayerInFrac(playerid,22))
{
SetPlayerSkin(playerid,280);
SetPlayerColor(playerid,0x0000FFFF);
OnDuty[playerid] = 1;
}
else if(IsPlayerInFrac(playerid,3))
{
SetPlayerSkin(playerid,287);
OnDuty[playerid] = 1;
ShowPlayerDialog(playerid,DIALOG_ARMYDUTY,DIALOG_STYLE_LIST,"Wie möchtest du Duty gehen?","Normal Duty\nPilot Duty\nSniper Duty","Ok","");
}
else if(IsPlayerInFrac(playerid,2))
{
SetPlayerColor(playerid,0x000000FF); // Copfarbe
SetPlayerSkin(playerid,286);
OnDuty[playerid] = 1;
}
}
else if(OnDuty[playerid]==1 || PilotDuty[playerid]==1 || SniperDuty[playerid]==1)
{
format(string, sizeof(string), "%s legt seine Marke in den Schrank und macht Feierabend.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ResetPlayerWeapons(playerid);
PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pAmmo4] = 0;
SetPlayerColor(playerid,COLOR_WHITE); // white
OnDuty[playerid] = 0; SniperDuty[playerid] = 0; PilotDuty[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Du bist in keiner Umkleide !");
return 1;
}
}
Dialog
if(dialogid == DIALOG_ARMYDUTY)
{
if(response)
{
if(listitem == 0)
{
OnDuty[playerid] = 1;
}
if(listitem == 1)
{
OnDuty[playerid] = 0;
PilotDuty[playerid] = 1;
SetPlayerColor(playerid,0xFFFFFF00);
}
if(listitem == 2)
{
OnDuty[playerid] = 0;
SniperDuty[playerid] = 1;
SetPlayerColor(playerid,0xFFFFFF00);
}
}
}