Jump to content

Recommended Posts

Posted

va salut, cum as putea face la aceasta comanda /duty ca atunci cand un jucator sa pus duty off sa ramana asa pana cand se face el iar duty on? 

 

Spoiler

CMD:duty(playerid, params[])
{
    CheckCommandStatus(playerid, "duty");
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pGunLic] == 0) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}Nu ai licenta de Arme.");
        new house = PlayerInfo[playerid][pPhousekey],string[200],sendername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(IsACop(playerid))
        {
            if(PlayerInfo[playerid][pLocal] == house || IsPlayerInRangeOfPoint(playerid, 150.0, 245.8297,112.4436,1003.2188) || IsPlayerInRangeOfPoint(playerid, 150.0, 236.3031,162.9478,1003.0300))
            //if(InHouse[playerid] > 0 || IsPlayerInRangeOfPoint(playerid, 100.0, DynamicFactions[1][fcX], DynamicFactions[1][fcY], DynamicFactions[1][fcZ]) || IsPlayerInRangeOfPoint(playerid, 100.0, DynamicFactions[2][fcX], DynamicFactions[2][fcY], DynamicFactions[2][fcZ]) || IsPlayerInRangeOfPoint(playerid, 100.0, DynamicFactions[3][fcX], DynamicFactions[3][fcY], DynamicFactions[3][fcZ]) || IsPlayerInRangeOfPoint(playerid, 100.0, DynamicFactions[8][fcX], DynamicFactions[8][fcY], DynamicFactions[8][fcZ]))
            {
                if(GetPlayerInterior(playerid) != 0)
                {
                    if(OnDuty[playerid] == 0)
                    {
                           if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
                         {
                              format(string, sizeof(string), "* Ofiterul %s s-a echipat cu vesta anti-glont si armele pentru misiune.", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            GivePlayerWeaponEx(playerid, 24, 500);
                            GivePlayerWeaponEx(playerid, 3, 1);
                            GivePlayerWeaponEx(playerid, 41, 500);
                            GivePlayerWeaponEx(playerid, 29, 1000);
                            GivePlayerWeaponEx(playerid, 31, 1000);
                            SetPlayerArmourEx(playerid, 100);
                               SetPlayerHealthEx(playerid, 100);
                               SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
                            OnDuty[playerid] = 1;
                        }
                        if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
                        {
                              format(string, sizeof(string), "* Agentul %s s-a echipat cu vesta anti-glont si armele pentru misiune.", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            GivePlayerWeaponEx(playerid, 24, 500);
                            GivePlayerWeaponEx(playerid, 3, 1);
                            GivePlayerWeaponEx(playerid, 41, 500);
                            GivePlayerWeaponEx(playerid, 29, 1000);
                            GivePlayerWeaponEx(playerid, 31, 1000);
                            SetPlayerArmourEx(playerid, 100);
                            SetPlayerHealthEx(playerid, 100);
                            SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
                            OnDuty[playerid] = 1;
                        }
                        if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
                        {
                              format(string, sizeof(string), "* Militarul %s s-a echipat cu vesta anti-glont si armele pentru misiune", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            GivePlayerWeaponEx(playerid, 24, 500);
                            GivePlayerWeaponEx(playerid, 41, 500);
                            GivePlayerWeaponEx(playerid, 29, 1000);
                            GivePlayerWeaponEx(playerid, 31, 1000);
                            SetPlayerArmourEx(playerid, 100);
                            SetPlayerHealthEx(playerid, 100);
                            SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
                            OnDuty[playerid] = 1;
                        }
                    }
                    else if(OnDuty[playerid]==1)
                    {
                        format(string, sizeof(string), "* %s a pus Insigna si Pistoalele in Dulap.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        OnDuty[playerid] = 0;
                        SetPlayerArmourEx(playerid, 0);
                        ResetPlayerWeaponsEx(playerid);
                        ResetPlayerWeapons(playerid);
                        SetPlayerSkin(playerid, PlayerInfo[playerid][pSecSkin]);
                    }
                }
                   else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Nu va aflati intr-o Casa / HQ.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Nu va aflati intr-o Casa / HQ.");
                return 1;
            }
        }
        else if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLocal] == house)
        {
            if(IsPlayerInRangeOfPoint(playerid, 50.0, 1494.7902,1306.6029,1093.2947))
            {
                if(PlayerInfo[playerid][pMember] != 14) return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu esti paramedic.");
                if(OnDutymedic[playerid] == 0)
                {
                    format(string, sizeof(string), "* Medic %s a luat un set de sanatate si un stingator de incendiu din valiza lui.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    GivePlayerWeaponEx(playerid, 42, 1000);
                    OnDutymedic[playerid] = 1;
                }
                else if(OnDutymedic[playerid] > 0)
                {
                    format(string, sizeof(string), "* %s pune setul tau de sanatate si extinctorul de incendiu in dulap..", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    OnDutymedic[playerid] = 0;
                }
            }
           }
    }
    return 1;
}

comanda e functionala numai ca atunci cand sunt duty off si cineva imi da kill la respawn ma da duty off cu skin de pd cum as putea face dupa ce ma omoara cineva sa ramana cu acelasi skin de duty off?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.