Help Me with This Script
#1

I compile this when i make this script
can anyone help me fix it
pawn Код:
}
    if(strcmp(cmd, "/door", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 7)
            {
                if(IsPlayerInRangeOfPoint(playerid, 3, 246.3489,72.0905,1003.6406))
                {
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    if(IsPlayerConnected(playerid))
                    {
                        if(IsLSPDDoorOpen == 0)
                        {
                            MoveObject(LSPD_Door[ObjectID1], 247.3080, 72.3000, 1003.6700, 1.50);
                            MoveObject(LSPD_Door[ObjectID2], 245.480, 72.5750, 1003.6650, 1.50);
                            MoveObject(LSPD_Door[ObjectID3], 247.888, 72.4500, 1003.7000, 1.50);
                            MoveObject(LSPD_Door[ObjectID4], 244.908, 72.4500, 1003.7000, 1.50);
                            IsLSPDDoorOpen = 1;
                            format(string, sizeof(string), "* %s slides their card and opens the door", name);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            return 1;
                        }
                        if(IsLSPDDoorOpen == 1)
                        {
                            MoveObject(LSPD_Door[ObjectID1], 246.4050, 72.3000, 1003.6700, 1.50);
                            MoveObject(LSPD_Door[ObjectID2], 246.4050, 72.5750, 1003.6650, 1.50);
                            MoveObject(LSPD_Door[ObjectID3], 246.9850, 72.4500, 1003.7000, 1.50);
                            MoveObject(LSPD_Door[ObjectID4], 245.8330, 72.4500, 1003.7000, 1.50);
                            IsLSPDDoorOpen = 0;
                            format(string, sizeof(string), "* %s slides their card and closes the door", name);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            return 1;
                          }
                     }
                }
                if(IsPlayerInRangeOfPoint(playerid, 3, 222.09, 70.57, 1004.00))
                {
                    if(IsPlayerConnected(playerid))
                    {
                        if(DoorOpened==0)
                        {
                            MoveObject(door, 222.21, 72.27, 1004.00, 3);
                            chiefdoortimer = SetTimer("ClosePDDoor",3000,0);
                            DoorOpened = 1;
                        }
                        else if(DoorOpened==1)
                        {
                            MoveObject(door, 222.09, 70.57, 1004.00, 3);
                            KillTimer(chiefdoortimer);
                            DoorOpened = 0;
                        }
                    }
                }
            }
        }
Reply
#2

how to put the [pawno]
Reply
#3

Код:
[ pawn ]
public OnGameModeInit()
[ /pawn ]

Remove the spaces
oh and its help full that you post the errors you are getting from the compiler.
Reply
#4

Other way around. Starts with [ pawn ] and ends with [/pawn]

And what is the problem?
Reply
#5

Код:
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(18849) : error 017: undefined symbol "IsLSPDDoorOpen"
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(18855) : error 017: undefined symbol "IsLSPDDoorOpen"
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(18855) : warning 215: expression has no effect
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(18860) : error 017: undefined symbol "IsLSPDDoorOpen"
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(18866) : error 017: undefined symbol "IsLSPDDoorOpen"
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(18866) : warning 215: expression has no effect
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(25408) : warning 217: loose indentation
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(25453) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.





here are the errors..how can i fix that??
Reply
#6

add somewhere at the top of the script

pawn Код:
new IsLSPDDoorOpen = 0;
Like around the rest of the variables.
Reply
#7

can u put it in my pawno code so that i am easy to copy it and replace with the old one
like
pawn Код:
new IsLSPDDoorOpen = 0;
u place the code in my pawno script

pawn Код:
}
    if(strcmp(cmd, "/door", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 7)
            {
                if(IsPlayerInRangeOfPoint(playerid, 3, 246.3489,72.0905,1003.6406))
                {
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    if(IsPlayerConnected(playerid))
                    {
                        if(IsLSPDDoorOpen == 0)
                        {
                            MoveObject(LSPD_Door[ObjectID1], 247.3080, 72.3000, 1003.6700, 1.50);
                            MoveObject(LSPD_Door[ObjectID2], 245.480, 72.5750, 1003.6650, 1.50);
                            MoveObject(LSPD_Door[ObjectID3], 247.888, 72.4500, 1003.7000, 1.50);
                            MoveObject(LSPD_Door[ObjectID4], 244.908, 72.4500, 1003.7000, 1.50);
                            IsLSPDDoorOpen = 1;
                            format(string, sizeof(string), "* %s slides their card and opens the door", name);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            return 1;
                        }
                        if(IsLSPDDoorOpen == 1)
                        {
                            MoveObject(LSPD_Door[ObjectID1], 246.4050, 72.3000, 1003.6700, 1.50);
                            MoveObject(LSPD_Door[ObjectID2], 246.4050, 72.5750, 1003.6650, 1.50);
                            MoveObject(LSPD_Door[ObjectID3], 246.9850, 72.4500, 1003.7000, 1.50);
                            MoveObject(LSPD_Door[ObjectID4], 245.8330, 72.4500, 1003.7000, 1.50);
                            IsLSPDDoorOpen = 0;
                            format(string, sizeof(string), "* %s slides their card and closes the door", name);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            return 1;
                          }
                     }
                }
                if(IsPlayerInRangeOfPoint(playerid, 3, 222.09, 70.57, 1004.00))
                {
                    if(IsPlayerConnected(playerid))
                    {
                        if(DoorOpened==0)
                        {
                            MoveObject(door, 222.21, 72.27, 1004.00, 3);
                            chiefdoortimer = SetTimer("ClosePDDoor",3000,0);
                            DoorOpened = 1;
                        }
                        else if(DoorOpened==1)
                        {
                            MoveObject(door, 222.09, 70.57, 1004.00, 3);
                            KillTimer(chiefdoortimer);
                            DoorOpened = 0;
                        }
                    }
                }
            }
        }

then combined them together then i copy it..only that will fix the errors?
Reply
#8

How hard is it to place it in the start of the script, I can't put it in that code because it has to be a global variable.

If you don't know the difference between a global variable and local variable, I suggest you read some more around the forums and the wiki's tutorials.
Reply
#9

im not using filterscript im using gamemode so how do i add it on the top of my script

Код:
How do i do it??
Reply
#10

i already put it on the top of my gamemode line 23
then it has errors like this

Код:
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(25410) : warning 217: loose indentation
C:\Users\Aztecas Dark Killer\Desktop\Samp Servers\Grand turisMo\Gamemodes\GT-RP.pwn(25455) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)