[HELP]Command not working
#6

pawn Код:
if(strcmp(cmd, "/duty", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        GetPlayerName(playerid, sendername, sizeof(sendername));
        new pm=PlayerInfo[playerid][pMember];
        new pi=PlayerInfo[playerid][pMember];
        if((pm>0&&pm<4)&&(pi>0&&pi<4))
        {
            if(!PlayerToPoint(3, playerid,255.3,77.4,1003.6))return SendClientMessage(playerid,COLOR_GRAD2,"  You are not in a locker room !");
            if(!PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875))return SendClientMessage(playerid,COLOR_GRAD2,"  You are not in a locker room !");
            if(!PlayerToPoint(3,playerid,2729.6565,-2451.3530,17.5937))return SendClientMessage(playerid,COLOR_GRAD2,"  You are not in a locker room !");
            if(!PlayerToPoint(3,playerid,300.8975,187.0387,1007.1719))return SendClientMessage(playerid,COLOR_GRAD2,"  You are not in a locker room !");
            if(OnDuty[playerid]==0)
            {
                if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
                {
                    format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    SafeGivePlayerWeapon(playerid, 24, 70);
                    SafeGivePlayerWeapon(playerid, 3, 0);
                    SetPlayerArmour(playerid, 100);
                    OnDuty[playerid] = 1;
                    SetPlayerColor(playerid,TEAM_BLUE_COLOR);
                    return 1;
                }
                else if(PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2)
                {
                    format(string, sizeof(string), "* Agent %s took a Badge and a Gun from his locker.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    SafeGivePlayerWeapon(playerid, 24, 70);
                    SafeGivePlayerWeapon(playerid, 3, 0);
                    SetPlayerArmour(playerid, 100);
                    OnDuty[playerid] = 1;
                    SetPlayerColor(playerid,TEAM_BLUE_COLOR);
                    return 1;
                }
                else if(PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 3)
                {
                    format(string, sizeof(string), "* Major %s took a Badge and a Gun from his locker.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    SafeGivePlayerWeapon(playerid, 24, 900);
                    SafeGivePlayerWeapon(playerid, 45, 900);
                    SafeGivePlayerWeapon(playerid, 30, 0);
                    SetPlayerArmour(playerid, 100);
                    OnDuty[playerid] = 1;
                    return 1;
                }
            }
            else if(OnDuty[playerid]==1)
            {
                if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
                {format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);}
                else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
                {format(string, sizeof(string), "* Agent %s places his Badge and Gun in his locker.", sendername);}
                else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
                {format(string, sizeof(string), "* Major %s places his Badge and Gun in his locker.", sendername);}
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                SafeResetPlayerWeapons(playerid);
                SetPlayerArmour(playerid, 0);
                SafeGivePlayerWeapon(playerid, 41, 500);
                OnDuty[playerid] = 0;
                return 1;
            }
        }
        if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
        {
            if(JobDuty[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Medic Job and will not receive calls anymore.");
                JobDuty[playerid] = 0;
                Medics -= 1;
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Medic Job and will receive calls from people in need.");
                JobDuty[playerid] = 1;
                Medics += 1;
                GetPlayerName(playerid,sendername,sizeof(sendername));
                format(string, sizeof(string), "[Advert] Paramedic %s is On Duty, /call 911.", sendername);
                OOCNews(COLOR_ALLDEPT,string);
                return 1;
            }
        }
        if(PlayerInfo[playerid][pJob] == 17)
        {
            if(JobDuty[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Pizza Delivery Job and will not receive calls anymore.");
                JobDuty[playerid] = 0;
                PizzaBoys -= 1;
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Pizza Delivery Job and will receive calls from people in need.");
                JobDuty[playerid] = 1;
                PizzaBoys += 1;
                GetPlayerName(playerid,sendername,sizeof(sendername));
                format(string, sizeof(string), "[Advert] Well stacked pizza worker %s is now On Duty, /call 111 to order a pizza.", sendername);
                OOCNews(0xFF7E00AA,string);
                return 1;
            }
        }
        if(PlayerInfo[playerid][pJob] == 7)
        {
            if(JobDuty[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Car Mechanic Job and will not receive calls anymore.");
                JobDuty[playerid] = 0;
                Mechanics -= 1;
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Car Mechanic Job and will receive calls from people in need.");
                JobDuty[playerid] = 1;
                Mechanics += 1;
                GetPlayerName(playerid,sendername,sizeof(sendername));
                format(string, sizeof(string), "[Advert] Car mechanic %s is now On Duty, /call 555 to call a mechanic.", sendername);
                OOCNews(0x2993EDAA,string);
                return 1;
            }
        }
    }
    SendClientMessage(playerid, COLOR_GRAD1, "  You are not a Cop !");
    return 1;
}
Reply


Messages In This Thread
[HELP]Command not working - by Lilcuete - 15.11.2009, 13:24
Re: [HELP]Command not working - by Lilcuete - 15.11.2009, 15:37
Re: [HELP]Command not working - by (Jeff) - 15.11.2009, 15:39
Re: [HELP]Command not working - by CuervO - 15.11.2009, 16:28
Re: [HELP]Command not working - by Lilcuete - 15.11.2009, 23:00
Re: [HELP]Command not working - by Badger(new) - 16.11.2009, 01:00

Forum Jump:


Users browsing this thread: 1 Guest(s)