OnPlayerKeyStateChange No Erros In Compile But Does Not Work in Game
#1

This is one thing that has eluded me if someone could please show me my mistake
, the one that does not work is the key_crouch that is supposed to open gates.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_FIRE))
    {
        if(PlantedC4OnVault[playerid] == 1) // Vault Rigged
        {
            TakeWeapon(playerid, 40);
            RobStatus[BeingRobbed] = 1;
            RobStatus[Setup] = 0;
            SetPlayerCheckpoint(RobStatus[RobberID1], -1479.1213,2625.8848,58.7813, 5);
            SetPlayerCheckpoint(RobStatus[RobberID2], -1479.1213,2625.8848,58.7813, 5);
            SetPlayerCheckpoint(RobStatus[RobberID3], -1479.1213,2625.8848,58.7813, 5);
            SetPlayerCheckpoint(RobStatus[RobberID4], -1479.1213,2625.8848,58.7813, 5);
            SetPlayerCheckpoint(RobStatus[RobberID5], -1479.1213,2625.8848,58.7813, 5);
            SendClientMessage(RobStatus[RobberID1], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
            SendClientMessage(RobStatus[RobberID2], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
            SendClientMessage(RobStatus[RobberID3], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
            SendClientMessage(RobStatus[RobberID4], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
            SendClientMessage(RobStatus[RobberID5], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
            SendFamilyMessage(1, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(2, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(3, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(4, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(5, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(6, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(7, COLOR_DBLUE, "------------------------------------------------------------");
            PlayerInfo[RobStatus[RobberID1]][pWantedLevel] = 6;
            PlayerInfo[RobStatus[RobberID2]][pWantedLevel] = 6;
            PlayerInfo[RobStatus[RobberID3]][pWantedLevel] = 6;
            PlayerInfo[RobStatus[RobberID4]][pWantedLevel] = 6;
            PlayerInfo[RobStatus[RobberID5]][pWantedLevel] = 6;
            SetPlayerWantedLevel(RobStatus[RobberID1], 6);
            SetPlayerWantedLevel(RobStatus[RobberID2], 6);
            SetPlayerWantedLevel(RobStatus[RobberID3], 6);
            SetPlayerWantedLevel(RobStatus[RobberID4], 6);
            SetPlayerWantedLevel(RobStatus[RobberID5], 6);
            new string[126];
            format(string, sizeof(string), "** The Los Santos Bank and Trust vault has been destroyed  **");
            SendFamilyMessage(1, COLOR_DCHAT, string);
            SendFamilyMessage(2, COLOR_DCHAT, string);
            SendFamilyMessage(3, COLOR_DCHAT, string);
            SendFamilyMessage(4, COLOR_DCHAT, string);
            SendFamilyMessage(5, COLOR_DCHAT, string);
            SendFamilyMessage(6, COLOR_DCHAT, string);
            SendFamilyMessage(7, COLOR_DCHAT, string);
            SendFamilyMessage(1, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(2, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(3, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(4, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(5, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(6, COLOR_DBLUE, "------------------------------------------------------------");
            SendFamilyMessage(7, COLOR_DBLUE, "------------------------------------------------------------");
            SendClientMessageToAll(COLOR_ORANGE, "** A Bank Hiest has began");
            CreateExplosion(2311.6367,-0.4778,26.7422, 2, 4);
            DestroyObject(bankvault1);
            bankvault2 = CreateObject(2634,2312.11059570,-2.66468596,26.48641968,53.75942993,296.31378174,254.48004150); // Vault Exploded
            PlantedC4OnVault[playerid] = 0;
        }
        if(RampToggle[playerid] == 1)
        { // admin ramp
            if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER))
            {
                new Float: X, Float: Y, Float: Z, Float: A;
                GetXYInFrontOfPlayer(playerid, X, Y, Z, A);
                ramp = CreateObject(RAMP, X, Y, Z, 0.0, 0.0, A);
                SetTimerEx("Delete", TIME, 0, "d", ramp);
            }
        }
        if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK)
        {
            if(UseDrinkTimer[playerid]) return 1;
            new Float:health;
            GetPlayerHealth(playerid,health);
            if(health < 100.0)
            {
                if(health+5 > 100.0)
                {
                    SetPlayerHealth(playerid, 100);
                }
                else
                {
                    SetPlayerHealth(playerid, health+5);
                }
                UseDrinkTimer[playerid] = true;
                SetTimerEx("UseDrink",2*1000,0,"i",playerid);
            }
        }
        if(BombID[playerid] != 0)
        {
            if(GetPlayerWeapon(playerid) == 0)
            {
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    ClearAnimations(playerid);
                    ApplyAnimation(playerid,"PED","bomber",4.0,0,0,0,0,0);
                }
                new Float:X,Float:Y,Float:Z;
                GetObjectPos(BombID[playerid],X,Y,Z);
                DestroyObject(BombID[playerid]);
                CreateExplosion(X,Y,Z,12,1);
                BombID[playerid] = 0;
                SetPlayerWeapons(playerid);
                new killerid = GoChase[playerid];
                if(IsPlayerInRangeOfPoint(killerid,3,X,Y,Z))
                {
                    if(GoChase[playerid] == killerid)
                    {
                        if(PlayerInfo[killerid][pHeadValue] > 0)
                        {
                            new string[128];
                            new price = PlayerInfo[killerid][pHeadValue];
                            new name[MAX_PLAYER_NAME];
                            new killa[MAX_PLAYER_NAME];
                            GetPlayerName(playerid, name, sizeof(name));
                            GetPlayerName(killerid, killa, sizeof(killa));
                            PlayerInfo[killerid][pCash] = PlayerInfo[killerid][pCash]-price/2;
                            GivePlayerMoney(killerid, -price/2);
                            PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+price/2;
                            GivePlayerMoney(playerid, price/2);
                            format(string,128,"Hitman %s has fulfilled the contract on %s and collected $%d.",name,killa,price/2);
                            SendFamilyMessage(8, COLOR_YELLOW, string);
                            format(string,128,"You have been critically injured by a hitman and lost $%d.",price/2);
                            SendClientMessage(killerid, COLOR_YELLOW, string);
                            SetPlayerHealth(killerid, 0);
                            ClearContract(killerid);
                            GoChase[playerid] = 999;
                            PlayerInfo[playerid][pCHits]++;
                        }
                    }
                }
            }
        }
    }
    if(newkeys & KEY_FIRE && newkeys & KEY_HANDBRAKE)
    {
        if(GetPlayerWeapon(playerid) == 34 && PlayerInfo[playerid][pScope] == 1)
        {
            if(RecentlyShot[playerid] == 0)
            {
                RecentlyShot[playerid] = 1;
                SetTimerEx("AntiSpam", 1000, false, "d", playerid);
                {
                    new Float:blahx, Float:blahy, Float:blahz;
                    HeadshotCheck(playerid, blahx, blahy, blahz);
                }
            }
        }
    }
    if(!gPlayerUsingLoopingAnim[playerid]) { return 1; }
    if(IsKeyJustDown(KEY_SPRINT,newkeys,oldkeys))
    {
        PlayerHurt[playerid] = 0;
        StopLoopingAnim(playerid);
        TextDrawHideForPlayer(playerid,txtAnimHelper);
    }
    if(PRESSED(newkeys, KEY_SUBMISSION)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
        {
            new Float:ppX,Float:ppY,Float:ppZ;
            GetPlayerPos(playerid,ppX,ppY,ppZ);
            new Float:vvX,Float:vvY,Float:vvZ;
            new Found=0;
            new vid=0;
            while((vid<MAX_VEHICLES)&&(!Found))
            {
                vid++;
                GetVehiclePos(vid,vvX,vvY,vvZ);
                if ((floatabs(ppX-vvX)<7.0)&&(floatabs(ppY-vvY)<7.0)&&(floatabs(ppZ-vvZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
                {
                    Found=1;
                    if (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                    {
                        DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                    }
                    else
                    {
                        AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                    }
                }
            }
            if  (!Found)
            {
                SendClientMessage(playerid,COLOR_GREY,"   There is no car in range !");
            }
        }
    }

    if(PRESSED(KEY_CROUCH))
    {
        if(IsPlayerInRangeOfPoint(playerid,9,1588.3058,-1637.9652,13.4227))
        { //POLICE GATE
            if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SASP !");
            if(pdgategar==0)
            {
                pdgategar = 1;
                MoveObject(pdgaragegateobj, 1588.965698, -1637.882690, 7.710285, 1.50);
            }
            else if(pdgategar==1)
            {
                pdgategar = 0;
                MoveObject(pdgaragegateobj, 1588.965698, -1637.882690, 15.260185, 1.50);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid,9,1544.4913,-1627.2817,13.3828))
        { //POLICE BAR
            if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SASP !");
            if(pdgatebar==0)
            {
                pdgatebar = 1;
                SetObjectRot( pdbarriergateobj, 0.0000, 360.0000, 90.0000);
                SetObjectPos( pdbarriergateobj, 1544.682495, -1630.953003, 13.079567 );
            }
            else if(pdgatebar==1)
            {
                pdgatebar = 0;
                SetObjectRot( pdbarriergateobj, 0.0000, 90.0000, 90.0000);
                SetObjectPos( pdbarriergateobj, 1544.682495, -1630.980000, 13.215000 );
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid,12,135.35978699,1997.06042480,20.20645332))
        { //PRISON GATE
            if(!IsACop(playerid) && PlayerInfo[playerid][pMember] != 5) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SASP / NG !");
            if(Prison_Buttons[GateOpened] == 0)
            {
                MoveObject(Prison_Buttons[PrisonGate], 135.35978699,1997.06042480,16.756452560425, 1.50);
                Prison_Buttons[GateOpened] = 1;
                Prison_Buttons[GateTimerID]= SetTimer("PrisonGateCheck", 60000, 0);
            }
            else
            {
                MoveObject(Prison_Buttons[PrisonGate], 135.35978699,1997.06042480,20.20645332, 1.50);
                Prison_Buttons[GateOpened] = 0;
                KillTimer(Prison_Buttons[GateTimerID]);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid, 12.0,-80.057670593262, -352.7497253418, 7.6630787467957))
        { //SECRET SOCIETY GATE
            if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
            if(ssgateopen == 0)
            {
                ssgateopen = 1;
                MoveObject(ssgate, -80.057670593262, -352.7497253418, 7.6630787467957, 1.500000);
            }
            else
            {
                ssgateopen = 0;
                MoveObject(ssgate, -80.057670593262, -352.7497253418, 3.2030787467957, 1.500000);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid, 12,-206.34794617,-1665.31579590,4.44884586))
        { //Los Santos DHS
            if(!(PlayerInfo[playerid][pMember] == 5)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the DHS !");
            if(lsdhsgateopen == 0)
            {
                lsdhsgateopen = 1;
                MoveObject(lsdhsgate, -206.34794617,-1665.31579590,-5.7011566162109, 1.500000);
            }
            else
            {
                lsdhsgateopen = 0;
                MoveObject(lsdhsgate,-206.34794617,-1665.31579590,4.44884586, 1.500000);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid, 12.0,2777.25268555,913.85461426,11.42469025))
        { //Milita Gate LV
            if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
            if(militagateopen == 0)
            {
                militagateopen = 1;
                MoveObject(militagate, 2777.25268555,922.68481445313,11.42469025, 1.500000);
            }
            else
            {
                militagateopen = 0;
                MoveObject(militagate, 2777.25268555,913.85461426,11.42469025, 1.500000);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid, 12.0,1802.09790039,-1722.24621582,16.20718002))
        { //FBI LS 3
            if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
            if(fbithreegateopen == 0)
            {
                fbithreegateopen = 1;
                MoveObject(fbithreegate,1802.09790039,-1722.24621582,12.432180404663, 1.500000);
            }
            else
            {
                fbithreegateopen = 0;
                MoveObject(fbithreegate,1802.09790039,-1722.24621582,16.20718002, 1.500000);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid, 12.0,1761.13183594,-1701.84765625,16.43218040))
        { //FBI LS 2
            if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
            if(fbitwogateopen == 0)
            {
                fbitwogateopen = 1;
                MoveObject(fbitwogate,1761.13183594,-1701.84765625,12.432180404663, 1.500000);
            }
            else
            {
                fbitwogateopen = 0;
                MoveObject(fbitwogate,1761.13183594,-1701.84765625,16.43218040, 1.500000);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid, 12.0,1761.19519043,-1691.66284180,16.20718002))
        { //FBI LS 1
            if(!(PlayerInfo[playerid][pMember] == 7)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
            if(fbionegateopen == 0)
            {
                fbionegateopen = 1;
                MoveObject(fbionegate, 1761.19519043,-1691.66284180,12.432180404663, 1.500000);
            }
            else
            {
                fbionegateopen = 0;
                MoveObject(fbionegate,1761.19519043,-1691.66284180,16.20718002, 1.500000);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid, 12.0, 1937.20458984,-1602.79357910,15.31247330))
        { //Taylors Gang
            if(!(PlayerInfo[playerid][pFMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
            if(tlyganggateopen == 0)
            {
                tlyganggateopen = 1;
                MoveObject(tlygang, 1937.20458984,-1602.79357910,9.31247330, 1.500000);
            }
            else
            {
                tlyganggateopen = 0;
                MoveObject(tlygang, 1937.20458984,-1602.79357910,15.31247330, 1.500000);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid, 12.0, 1027.46203613, 1183.29357910, 12.45144653))
        { //FBI GATE
            if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the FBI !");
            if(fbigateopen == 0)
            {
                fbigateopen = 1;
                MoveObject(FBIGate, 1038.17248535, 1183.50256348, 12.45144653, 1.500000);
            }
            else
            {
                fbigateopen = 0;
                MoveObject(FBIGate, 1027.46203613,1183.29357910,12.45144653, 1.500000);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "   You are not near a gate !");
        }
    }
    return 1;
}
Reply
#2

Try this:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_FIRE)
    {
        if(PlantedC4OnVault[playerid] == 1) // Vault Rigged
        {
                TakeWeapon(playerid, 40);
                RobStatus[BeingRobbed] = 1;
                RobStatus[Setup] = 0;
                SetPlayerCheckpoint(RobStatus[RobberID1], -1479.1213,2625.8848,58.7813, 5);
                SetPlayerCheckpoint(RobStatus[RobberID2], -1479.1213,2625.8848,58.7813, 5);
                SetPlayerCheckpoint(RobStatus[RobberID3], -1479.1213,2625.8848,58.7813, 5);
                SetPlayerCheckpoint(RobStatus[RobberID4], -1479.1213,2625.8848,58.7813, 5);
                SetPlayerCheckpoint(RobStatus[RobberID5], -1479.1213,2625.8848,58.7813, 5);
                SendClientMessage(RobStatus[RobberID1], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
                SendClientMessage(RobStatus[RobberID2], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
                SendClientMessage(RobStatus[RobberID3], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
                SendClientMessage(RobStatus[RobberID4], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
                SendClientMessage(RobStatus[RobberID5], COLOR_YELLOW, "** You need to load the cash and get the safe point quickly, (( /loadcash ))");
                SendFamilyMessage(1, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(2, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(3, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(4, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(5, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(6, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(7, COLOR_DBLUE, "------------------------------------------------------------");
                PlayerInfo[RobStatus[RobberID1]][pWantedLevel] = 6;
                PlayerInfo[RobStatus[RobberID2]][pWantedLevel] = 6;
                PlayerInfo[RobStatus[RobberID3]][pWantedLevel] = 6;
                PlayerInfo[RobStatus[RobberID4]][pWantedLevel] = 6;
                PlayerInfo[RobStatus[RobberID5]][pWantedLevel] = 6;
                SetPlayerWantedLevel(RobStatus[RobberID1], 6);
                SetPlayerWantedLevel(RobStatus[RobberID2], 6);
                SetPlayerWantedLevel(RobStatus[RobberID3], 6);
                SetPlayerWantedLevel(RobStatus[RobberID4], 6);
                SetPlayerWantedLevel(RobStatus[RobberID5], 6);
                new string[126];
                format(string, sizeof(string), "** The Los Santos Bank and Trust vault has been destroyed  **");
                SendFamilyMessage(1, COLOR_DCHAT, string);
                SendFamilyMessage(2, COLOR_DCHAT, string);
                SendFamilyMessage(3, COLOR_DCHAT, string);
                SendFamilyMessage(4, COLOR_DCHAT, string);
                SendFamilyMessage(5, COLOR_DCHAT, string);
                SendFamilyMessage(6, COLOR_DCHAT, string);
                SendFamilyMessage(7, COLOR_DCHAT, string);
                SendFamilyMessage(1, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(2, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(3, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(4, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(5, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(6, COLOR_DBLUE, "------------------------------------------------------------");
                SendFamilyMessage(7, COLOR_DBLUE, "------------------------------------------------------------");
                SendClientMessageToAll(COLOR_ORANGE, "** A Bank Hiest has began");
                CreateExplosion(2311.6367,-0.4778,26.7422, 2, 4);
                DestroyObject(bankvault1);
                bankvault2 = CreateObject(2634,2312.11059570,-2.66468596,26.48641968,53.75942993,296.31378174,254.48004150); // Vault Exploded
                PlantedC4OnVault[playerid] = 0;
            }
            if(RampToggle[playerid] == 1)
            { // admin ramp
                if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER))
                {
                    new Float: X, Float: Y, Float: Z, Float: A;
                    GetXYInFrontOfPlayer(playerid, X, Y, Z, A);
                    ramp = CreateObject(RAMP, X, Y, Z, 0.0, 0.0, A);
                    SetTimerEx("Delete", TIME, 0, "d", ramp);
                }
            }
            if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK)
            {
                if(UseDrinkTimer[playerid]) return 1;
                new Float:health;
                GetPlayerHealth(playerid,health);
                if(health < 100.0)
                {
                    if(health+5 > 100.0)
                    {
                        SetPlayerHealth(playerid, 100);
                    }
                    else
                    {
                        SetPlayerHealth(playerid, health+5);
                    }
                    UseDrinkTimer[playerid] = true;
                    SetTimerEx("UseDrink",2*1000,0,"i",playerid);
                }
            }
            if(BombID[playerid] != 0)
            {
                if(GetPlayerWeapon(playerid) == 0)
                {
                    if(!IsPlayerInAnyVehicle(playerid))
                    {
                        ClearAnimations(playerid);
                        ApplyAnimation(playerid,"PED","bomber",4.0,0,0,0,0,0);
                    }
                    new Float:X,Float:Y,Float:Z;
                    GetObjectPos(BombID[playerid],X,Y,Z);
                    DestroyObject(BombID[playerid]);
                    CreateExplosion(X,Y,Z,12,1);
                    BombID[playerid] = 0;
                    SetPlayerWeapons(playerid);
                    new killerid = GoChase[playerid];
                    if(IsPlayerInRangeOfPoint(killerid,3,X,Y,Z))
                    {
                        if(GoChase[playerid] == killerid)
                        {
                            if(PlayerInfo[killerid][pHeadValue] > 0)
                            {
                                new string[128];
                                new price = PlayerInfo[killerid][pHeadValue];
                                new name[MAX_PLAYER_NAME];
                                new killa[MAX_PLAYER_NAME];
                                GetPlayerName(playerid, name, sizeof(name));
                                GetPlayerName(killerid, killa, sizeof(killa));
                                PlayerInfo[killerid][pCash] = PlayerInfo[killerid][pCash]-price/2;
                                GivePlayerMoney(killerid, -price/2);
                                PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+price/2;
                                GivePlayerMoney(playerid, price/2);
                                format(string,128,"Hitman %s has fulfilled the contract on %s and collected $%d.",name,killa,price/2);
                                SendFamilyMessage(8, COLOR_YELLOW, string);
                                format(string,128,"You have been critically injured by a hitman and lost $%d.",price/2);
                                SendClientMessage(killerid, COLOR_YELLOW, string);
                                SetPlayerHealth(killerid, 0);
                                ClearContract(killerid);
                                GoChase[playerid] = 999;
                                PlayerInfo[playerid][pCHits]++;
                            }
                        }
                    }
                }
            }
        }
        if ((newkeys & KEY_FIRE) && (newkeys & KEY_HANDBRAKE))
        {
            if(GetPlayerWeapon(playerid) == 34 && PlayerInfo[playerid][pScope] == 1)
            {
                if(RecentlyShot[playerid] == 0)
                {
                    RecentlyShot[playerid] = 1;
                    SetTimerEx("AntiSpam", 1000, false, "d", playerid);
                    {
                        new Float:blahx, Float:blahy, Float:blahz;
                        HeadshotCheck(playerid, blahx, blahy, blahz);
                    }
                }
            }
        }
        if(!gPlayerUsingLoopingAnim[playerid]) { return 1; }
        if(IsKeyJustDown(KEY_SPRINT,newkeys,oldkeys))
        {
            PlayerHurt[playerid] = 0;
            StopLoopingAnim(playerid);
            TextDrawHideForPlayer(playerid,txtAnimHelper);
        }
        if(newkeys == KEY_SUBMISSION)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
        {
            if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
            {
                new Float:ppX,Float:ppY,Float:ppZ;
                GetPlayerPos(playerid,ppX,ppY,ppZ);
                new Float:vvX,Float:vvY,Float:vvZ;
                new Found=0;
                new vid=0;
                while((vid<MAX_VEHICLES)&&(!Found))
                {
                    vid++;
                    GetVehiclePos(vid,vvX,vvY,vvZ);
                    if ((floatabs(ppX-vvX)<7.0)&&(floatabs(ppY-vvY)<7.0)&&(floatabs(ppZ-vvZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
                    {
                        Found=1;
                        if (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                        {
                            DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                        }
                        else
                        {
                            AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                        }
                    }
                }
                if  (!Found)
                {
                    SendClientMessage(playerid,COLOR_GREY,"   There is no car in range !");
                }
            }
        }

        if(PRESSED(KEY_CROUCH))
        {
            if(IsPlayerInRangeOfPoint(playerid,9,1588.3058,-1637.9652,13.4227))
            { //POLICE GATE
                if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SASP !");
                if(pdgategar==0)
                {
                    pdgategar = 1;
                    MoveObject(pdgaragegateobj, 1588.965698, -1637.882690, 7.710285, 1.50);
                }
                else if(pdgategar==1)
                {
                    pdgategar = 0;
                    MoveObject(pdgaragegateobj, 1588.965698, -1637.882690, 15.260185, 1.50);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid,9,1544.4913,-1627.2817,13.3828))
            { //POLICE BAR
                if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SASP !");
                if(pdgatebar==0)
                {
                    pdgatebar = 1;
                    SetObjectRot( pdbarriergateobj, 0.0000, 360.0000, 90.0000);
                    SetObjectPos( pdbarriergateobj, 1544.682495, -1630.953003, 13.079567 );
                }
                else if(pdgatebar==1)
                {
                    pdgatebar = 0;
                    SetObjectRot( pdbarriergateobj, 0.0000, 90.0000, 90.0000);
                    SetObjectPos( pdbarriergateobj, 1544.682495, -1630.980000, 13.215000 );
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid,12,135.35978699,1997.06042480,20.20645332))
            { //PRISON GATE
                if(!IsACop(playerid) && PlayerInfo[playerid][pMember] != 5) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SASP / NG !");
                if(Prison_Buttons[GateOpened] == 0)
                {
                    MoveObject(Prison_Buttons[PrisonGate], 135.35978699,1997.06042480,16.756452560425, 1.50);
                    Prison_Buttons[GateOpened] = 1;
                    Prison_Buttons[GateTimerID]= SetTimer("PrisonGateCheck", 60000, 0);
                }
                else
                {
                    MoveObject(Prison_Buttons[PrisonGate], 135.35978699,1997.06042480,20.20645332, 1.50);
                    Prison_Buttons[GateOpened] = 0;
                    KillTimer(Prison_Buttons[GateTimerID]);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 12.0,-80.057670593262, -352.7497253418, 7.6630787467957))
            { //SECRET SOCIETY GATE
                if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
                if(ssgateopen == 0)
                {
                    ssgateopen = 1;
                    MoveObject(ssgate, -80.057670593262, -352.7497253418, 7.6630787467957, 1.500000);
                }
                else
                {
                    ssgateopen = 0;
                    MoveObject(ssgate, -80.057670593262, -352.7497253418, 3.2030787467957, 1.500000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 12,-206.34794617,-1665.31579590,4.44884586))
            { //Los Santos DHS
                if(!(PlayerInfo[playerid][pMember] == 5)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the DHS !");
                if(lsdhsgateopen == 0)
                {
                    lsdhsgateopen = 1;
                    MoveObject(lsdhsgate, -206.34794617,-1665.31579590,-5.7011566162109, 1.500000);
                }
                else
                {
                    lsdhsgateopen = 0;
                    MoveObject(lsdhsgate,-206.34794617,-1665.31579590,4.44884586, 1.500000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 12.0,2777.25268555,913.85461426,11.42469025))
            { //Milita Gate LV
                if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
                if(militagateopen == 0)
                {
                    militagateopen = 1;
                    MoveObject(militagate, 2777.25268555,922.68481445313,11.42469025, 1.500000);
                }
                else
                {
                    militagateopen = 0;
                    MoveObject(militagate, 2777.25268555,913.85461426,11.42469025, 1.500000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 12.0,1802.09790039,-1722.24621582,16.20718002))
            { //FBI LS 3
                if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
                if(fbithreegateopen == 0)
                {
                    fbithreegateopen = 1;
                    MoveObject(fbithreegate,1802.09790039,-1722.24621582,12.432180404663, 1.500000);
                }
                else
                {
                    fbithreegateopen = 0;
                    MoveObject(fbithreegate,1802.09790039,-1722.24621582,16.20718002, 1.500000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 12.0,1761.13183594,-1701.84765625,16.43218040))
            { //FBI LS 2
                if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
                if(fbitwogateopen == 0)
                {
                    fbitwogateopen = 1;
                    MoveObject(fbitwogate,1761.13183594,-1701.84765625,12.432180404663, 1.500000);
                }
                else
                {
                    fbitwogateopen = 0;
                    MoveObject(fbitwogate,1761.13183594,-1701.84765625,16.43218040, 1.500000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 12.0,1761.19519043,-1691.66284180,16.20718002))
            { //FBI LS 1
                if(!(PlayerInfo[playerid][pMember] == 7)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
                if(fbionegateopen == 0)
                {
                    fbionegateopen = 1;
                    MoveObject(fbionegate, 1761.19519043,-1691.66284180,12.432180404663, 1.500000);
                }
                else
                {
                    fbionegateopen = 0;
                    MoveObject(fbionegate,1761.19519043,-1691.66284180,16.20718002, 1.500000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 12.0, 1937.20458984,-1602.79357910,15.31247330))
            { //Taylors Gang
                if(!(PlayerInfo[playerid][pFMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
                if(tlyganggateopen == 0)
                {
                    tlyganggateopen = 1;
                    MoveObject(tlygang, 1937.20458984,-1602.79357910,9.31247330, 1.500000);
                }
                else
                {
                    tlyganggateopen = 0;
                    MoveObject(tlygang, 1937.20458984,-1602.79357910,15.31247330, 1.500000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 12.0, 1027.46203613, 1183.29357910, 12.45144653))
            { //FBI GATE
                if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the FBI !");
                if(fbigateopen == 0)
                {
                    fbigateopen = 1;
                    MoveObject(FBIGate, 1038.17248535, 1183.50256348, 12.45144653, 1.500000);
                }
                else
                {
                    fbigateopen = 0;
                    MoveObject(FBIGate, 1027.46203613,1183.29357910,12.45144653, 1.500000);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not near a gate !");
            }
        }
    }
    return 1;
}
Reply
#3

Код:
C:\Documents and Settings\Robert Crawford\Desktop\Vanity Role Play\gamemodes\VR112a.pwn(11974) : warning 217: loose indentation
C:\Documents and Settings\Robert Crawford\Desktop\Vanity Role Play\gamemodes\VR112a.pwn(12049) : warning 217: loose indentation
C:\Documents and Settings\Robert Crawford\Desktop\Vanity Role Play\gamemodes\VR112a.pwn(12071) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Robert Crawford\Desktop\Vanity Role Play\gamemodes\VR112a.pwn(12071) : warning 215: expression has no effect
C:\Documents and Settings\Robert Crawford\Desktop\Vanity Role Play\gamemodes\VR112a.pwn(12071) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Robert Crawford\Desktop\Vanity Role Play\gamemodes\VR112a.pwn(12071) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Robert Crawford\Desktop\Vanity Role Play\gamemodes\VR112a.pwn(12071) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Line 12071
pawn Код:
if(newkeys == KEY_SUBMISSION)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
Reply
#4

Please post the full GM in www.pastebin.com so we can understand what's wrong.
Reply
#5

The issue is only with this one function i see no reason to post the whole gm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)