Moin,
Habe ein Problem bei meinem /duty cmd. Die Positionsabfrage geht und die Fraktionsabfrage klappt ebenfalls. Wenn ich aber beides einhalte gehts nicht weiter.
dcmd_duty(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][Duty] == 0)
{
if(PlayerInfo[playerid][Leader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid,8.0,327.2312,307.6949,999.1484))
{
if(PlayerInfo[playerid][Rank] == 1)
{
SetPlayerSkin(playerid,170);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,29,600);
GivePlayerWeapon(playerid,33,150);
GivePlayerWeapon(playerid,41,500);
PlayerInfo[playerid][Duty] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du bist nun im Dienst.");
return 1;
}
else if(PlayerInfo[playerid][Rank] == 2)
{
SetPlayerSkin(playerid,282);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,29,600);
GivePlayerWeapon(playerid,33,150);
GivePlayerWeapon(playerid,41,500);
PlayerInfo[playerid][Duty] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du bist nun im Dienst.");
return 1;
}
else if(PlayerInfo[playerid][Rank] == 3)
{
SetPlayerSkin(playerid,282);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,29,600);
GivePlayerWeapon(playerid,33,150);
GivePlayerWeapon(playerid,41,500);
PlayerInfo[playerid][Duty] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du bist nun im Dienst.");
return 1;
}
else if(PlayerInfo[playerid][Rank] == 4)
{
SetPlayerSkin(playerid,282);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,29,600);
GivePlayerWeapon(playerid,33,150);
GivePlayerWeapon(playerid,41,500);
PlayerInfo[playerid][Duty] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du bist nun im Dienst.");
return 1;
}
else if(PlayerInfo[playerid][Rank] == 5)
{
SetPlayerSkin(playerid,282);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,29,600);
GivePlayerWeapon(playerid,33,150);
GivePlayerWeapon(playerid,41,500);
PlayerInfo[playerid][Duty] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du bist nun im Dienst.");
return 1;
}
else if(PlayerInfo[playerid][Rank] == 6)
{
SetPlayerSkin(playerid,283);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,29,600);
GivePlayerWeapon(playerid,33,150);
GivePlayerWeapon(playerid,41,500);
PlayerInfo[playerid][Duty] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du bist nun im Dienst.");
return 1;
}
else if(PlayerInfo[playerid][Rank] == 7)
{
SetPlayerSkin(playerid,288);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,29,600);
GivePlayerWeapon(playerid,33,150);
GivePlayerWeapon(playerid,41,500);
PlayerInfo[playerid][Duty] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du bist nun im Dienst.");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"Du bist nicht am Spinnt.");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"Du bist kein Polizist.");
return 1;
}
}
else if(PlayerInfo[playerid][Duty] == 1)
{
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
ResetPlayerWeapons(playerid);
PlayerInfo[playerid][Duty] = 0;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du bist nun nichtmehr im Dients.");
return 1;
}
return 1;
}