[HELP]OnPlayerKeyStateChanged!
#1

Hey guys, was wondering if you could possibly help me out here.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  new string[128];
  new sendername[MAX_PLAYER_NAME];
    if(newkeys == KEY_FIRE)//Horn
    {
  if(IsPlayerArmy(playerid) || IsPlayerPolice(playerid) || IsPlayerFBI(playerid) || IsPlayerSwat(playerid))
    {
        if(PlayerToPoint(15, playerid, 96.669350, 1920.033936, 18.855873))//Aread 51 Entrance Gate
        {
          if(agStatus == 1)
          {
            MoveObject(aGate, 96.669350, 1925.953735, 18.855873, 4);
                        format(string, sizeof(string), "** %s presses a button and lifts the Area 51 elevator!", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            agStatus = 0;
            SetTimer("ObjectTimers", 5000, false);
            return 1;
            }
        }
            if(PlayerToPoint(10, playerid, 214.337631, 1875.739136, 13.162411))//Area 51 Garage Shutter
        {
            if(ag2Status == 1)
            {
                MoveObject(aGate2, 214.337631, 1875.739136, 9.000, 4);
                        format(string, sizeof(string), "** %s presses a button and lifts the Area 51 elevator!", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            ag2Status = 0;
            SetTimer("ObjectTimers", 5000, false);
                return 1;
          }
        }
        if(PlayerToPoint(25, playerid, 281.667694, 1821.519043, 16.701317))//Area 51 Lift
        {
          if(alStatus == 1)
          {
            MoveObject(aLift, 281.667694, 1821.519043, 23.451214, 4);
            MoveObject(aLift2, 290.248383, 1821.519043, 23.451214, 4);
            MoveObject(aLift3, 275.712830, 1821.519043, 23.451214, 4);
            MoveObject(aLift4, 296.168213, 1821.519043, 23.451214, 4);
                    format(string, sizeof(string), "** %s presses a button and lifts the Area 51 elevator!", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            alStatus = 0;
            SetTimer("ObjectTimers", 5000, false);
            return 1;
            }
          }
          else{ SendClientMessage(playerid, COLOR_GRAD1, "You are too far away from the Gate/Garage/Elevator"); return 1; }
        }
        if(PlayerToPoint(15, playerid, 96.669350, 1920.033936, 18.855873))//Aread 51 Entrance Gate
        {
          if(AccountInfo[playerid][Logged] == 1)
          {
            OpenLSPDGate(playerid, 3.0, 1, 30000);
            format(string, sizeof(string), "** %s presses a button and opens the LSPD gate!", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
            }
        }
            if(PlayerToPoint(10, playerid, 214.337631, 1875.739136, 13.162411))//Area 51 Garage Shutter
        {
            if(ag2Status == 1)
            {
                OpenSFPDGate(playerid, 3.0, 1, 30000);
                    format(string, sizeof(string), "** %s presses a button and opens the SFPD gate!", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                return 1;
          }
        }
        if(PlayerToPoint(25, playerid, 281.667694, 1821.519043, 16.701317))//Area 51 Lift
        {
          if(alStatus == 1)
          {
            OpenLVPDGate(playerid, 3.0, 1, 30000);
                        format(string, sizeof(string), "** %s presses a button and opens the LVPD gate!", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
            }
          }
          else{ SendClientMessage(playerid, COLOR_GRAD1, "You are too far away from the Gate/Garage/Elevator"); return 1; }
        }
     }
    return 1;
    }
Errors:
pawn Код:
C:\Users\Mike\Desktop\Games\GTA\San Andreas\Advanced-Gaming\0.3 Beta\gamemodes\nyrp.pwn(4565) : error 010: invalid function or declaration
Line 4565:
pawn Код:
return 1;
Any ideas?
Reply
#2

You will have to be more specific, i see multiple "return 1;"
Reply
#3

The very last 1.
Reply
#4

could you send me the define line or enum to define all of the things needed for the code? i will try it on my script and see what i can do
Reply
#5

-[IsPlayerPolice etc] - download
-[OpenLVPDGate etc] - download

pawn Код:
enum Info
{
    AdminLevel,
    Password[128],
    Cash,
    pLeader,
    pMember,
    pfMember,
    Name,
    pInt,
    Warns,
    Jail,
    Logged,
    Mute,
    Skin,
    WeaponStat,
    WarnReason1[128],
    WarnReason2[128],
    WarnReason3[128],
    IP[20],
};
new AccountInfo[playerid][pInfo];
Reply
#6

You've added an extra bracket before the last 'else'. I'm not sure if you took the code from somewhere else, but "KEY_FIRE" isn't the horn as a heads up. Lulz
Reply
#7

Код:
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(748) : error 017: undefined symbol "aLift"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(749) : error 017: undefined symbol "aLift2"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(750) : error 017: undefined symbol "aLift3"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(751) : error 017: undefined symbol "aLift4"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(753) : error 017: undefined symbol "ProxDetector"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(754) : error 017: undefined symbol "alStatus"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(754) : warning 215: expression has no effect
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(761) : warning 217: loose indentation
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(763) : warning 213: tag mismatch
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(767) : error 017: undefined symbol "ProxDetector"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(773) : error 017: undefined symbol "ag2Status"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(777) : error 017: undefined symbol "ProxDetector"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(783) : error 017: undefined symbol "alStatus"
C:\Users\richard\Desktop\Gta sa Related\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(787) : error 017: undefined symbol "ProxDetector"
i need the file to define them
Reply
#8

Nevermind, Problemo Solved! Thanks guys
Reply
#9

What was the error caused by?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)