YCMD:duty(playerid, params[], help) {
if(PlayerInfo[playerid][pGunLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai licenta de arme. Cauta un instructor pentru a obtine licenta.");
new house = PlayerInfo[playerid][pHouse],string[200],sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(!IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu esti politist.");
if(PlayerInfo[playerid][pSleeping] == 1) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta comanda deoarece esti pe sleep!");
if(GetPlayerVirtualWorld(playerid) == house || IsPlayerInRangeOfPoint(playerid, 150.0, 245.8297,112.4436,1003.2188) || IsPlayerInRangeOfPoint(playerid, 150.0, 236.3031,162.9478,1003.0300)) {
if(GetPlayerInterior(playerid) != 0) {
if(OnDuty[playerid] == 0) {
if(PlayerInfo[playerid][pWantedLevel] != 0 || PlayerInfo[playerid][pJailTime] != 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece esti in jail sau ai wanted.");
format(string, sizeof(string), "%s takes some guns and a badge from his locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ServerWeapon(playerid, 24, 500);
ServerWeapon(playerid, 3, 0);
ServerWeapon(playerid, 41, 500);
ServerWeapon(playerid, 29, 1000);
ServerWeapon(playerid, 31, 1000);
SetPlayerArmourEx(playerid, 99);
SetPlayerHealthEx(playerid, 99);
OnDuty[playerid] = 1;
SetPlayerSkinEx(playerid, PlayerInfo[playerid][pChar]);
SCM(playerid, -1, "You are now on duty!");
}
else if(OnDuty[playerid]==1) {
SCM(playerid, -1, "You are now off duty!");
format(string, sizeof(string), "%s puts his badge and uniform in his locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
OnDuty[playerid] = 0;
SetPlayerArmourEx(playerid, 0);
ResetWeapons(playerid);
SetPlayerSkinEx(playerid, 305);
NearWanted[playerid] = 0;
PlayerTextDrawHide(playerid, NearTD);
tazer[playerid] = 0;
//SCM(playerid, COLOR_LGREEN, "Optiune dezactivata!");
}
SetPlayerToTeamColor(playerid);
}
else SCM(playerid, COLOR_GREY, "You can only use this command in houses or in Police HQ.");
}
else SCM(playerid, COLOR_GREY, "You can only use this command in houses or in Police HQ.");
return 1;
}