SA-MP Forums Archive
9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP (/showthread.php?tid=88420)



9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP - Moustafa - 26.07.2009

IAM REALLY MAD AND WHEN IAM USING CAPS ITS COOLING ME DOWN, AND I'VE BEEN TRYING TO FIX THESE FUCKING ERRORS AND THEY DONT WANT TO FUCKING GET FIXED AND IAM JUST MAD AND I NEED SOMEONE'S HELP IF YOU CAN HELP ME!!!!!!!!!!!!

Script:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
            if (PlayerToPoint(1, playerid, -2660.8972,1423.4766,906.4609))
            {
                SetPlayerPos(playerid, 1630.1722,1789.5437,10.8203);
                SendClientMessage(playerid, 0xFF8080FF, " Elevator: Press the 'R' button to lift up to the roof top (( /roof )) ");
                }
            }
    return 1;
        }
   
    if (strcmp("/roof", cmdtext, true, 10) == 0) // Line 50
    {
      if (elevused[playerid] == 0) // Line 52
        {
            if (PlayerToPoint(4, playerid, 1630.1722,1789.5437,10.8203)) // Line 54
            {
                SendClientMessage(playerid, 0xFF8080FF, " Elevator: You're being lifted up ");
                SetTimer("liftup1", 2000, 1);
                }
            }
    return 1; // Line 60
        }
   
    if (strcmp("/exit", cmdtext, true, 10) == 0) // Line 63
    {
      if (elevused[playerid] == 1) // Line 65
      {
        if (PlayerToPoint(4, playerid, 1630.1722, 1789.5437, 10.8203)) // Line 67
        {
          SetPlayerPos(playerid, 1628.8466,1780.0254,30.4688);
          }
            }
    return 1; // Line 72
        }
    return 0; // Line 74
}
Scroll down to see full of the script!!!

here are the errors after compiling:

Код:
C:\Users\Soka\Desktop\Server\elevator.pwn(50) : error 010: invalid function or declaration
C:\Users\Soka\Desktop\Server\elevator.pwn(52) : error 010: invalid function or declaration
C:\Users\Soka\Desktop\Server\elevator.pwn(54) : error 010: invalid function or declaration
C:\Users\Soka\Desktop\Server\elevator.pwn(60) : error 010: invalid function or declaration
C:\Users\Soka\Desktop\Server\elevator.pwn(63) : error 010: invalid function or declaration
C:\Users\Soka\Desktop\Server\elevator.pwn(65) : error 010: invalid function or declaration
C:\Users\Soka\Desktop\Server\elevator.pwn(67) : error 010: invalid function or declaration
C:\Users\Soka\Desktop\Server\elevator.pwn(72) : error 010: invalid function or declaration
C:\Users\Soka\Desktop\Server\elevator.pwn(74) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Errors.
I WILL BE REALLY GREATFULL AND THANKFULL TO WHO WILL HELP ME!!!


Re: 9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP - MadeMan - 26.07.2009

With /enter command I think you have 1 extra "}" that causes troubles. Look if all brackets match.


Re: 9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP - Moustafa - 26.07.2009

LOL @ ME how could i miss that

really thank you man, you rescued me... i was nearly fired from my job !


Re: 9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP - woot - 26.07.2009

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enter", cmdtext, true) == 0)
    {
            if (PlayerToPoint(1, playerid, -2660.8972,1423.4766,906.4609))
            {
                SetPlayerPos(playerid, 1630.1722,1789.5437,10.8203);
                SendClientMessage(playerid, 0xFF8080FF, " Elevator: Press the 'R' button to lift up to the roof top (( /roof )) ");
                return 1;
            }
    }
    if (strcmp("/roof", cmdtext, true) == 0) // Line 50
    {
      if (elevused[playerid] == 0) // Line 52
        {
            if (PlayerToPoint(4, playerid, 1630.1722,1789.5437,10.8203)) // Line 54
            {
                SendClientMessage(playerid, 0xFF8080FF, " Elevator: You're being lifted up ");
                SetTimer("liftup1", 2000, 1);
                return 1;
            }
        }
    }
    if (strcmp("/exit", cmdtext, true) == 0) // Line 63
    {
        if (elevused[playerid] == 1) // Line 65
        {
            if (PlayerToPoint(4, playerid, 1630.1722, 1789.5437, 10.8203)) // Line 67
            {
                SetPlayerPos(playerid, 1628.8466,1780.0254,30.4688);
                return 1;
            }
        }
    }
    return 0; // Line 74
}



Re: 9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP - Moustafa - 26.07.2009

Quote:
Originally Posted by //exora
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enter", cmdtext, true) == 0)
    {
            if (PlayerToPoint(1, playerid, -2660.8972,1423.4766,906.4609))
            {
                SetPlayerPos(playerid, 1630.1722,1789.5437,10.8203);
                SendClientMessage(playerid, 0xFF8080FF, " Elevator: Press the 'R' button to lift up to the roof top (( /roof )) ");
                return 1;
            }
    }
    if (strcmp("/roof", cmdtext, true) == 0) // Line 50
    {
      if (elevused[playerid] == 0) // Line 52
        {
            if (PlayerToPoint(4, playerid, 1630.1722,1789.5437,10.8203)) // Line 54
            {
                SendClientMessage(playerid, 0xFF8080FF, " Elevator: You're being lifted up ");
                SetTimer("liftup1", 2000, 1);
                return 1;
            }
        }
    }
    if (strcmp("/exit", cmdtext, true) == 0) // Line 63
    {
        if (elevused[playerid] == 1) // Line 65
        {
            if (PlayerToPoint(4, playerid, 1630.1722, 1789.5437, 10.8203)) // Line 67
            {
                SetPlayerPos(playerid, 1628.8466,1780.0254,30.4688);
                return 1;
            }
        }
    }
    return 0; // Line 74
}
Each time i type a command it says Unknown Command, help.


Re: 9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP - MadeMan - 26.07.2009

I thought you got it fixed?

EDIT: In exora's code return 1; comes only when player is typing the command AND is near the point also.


Re: 9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP - Moustafa - 26.07.2009

It is fixed, but somehow they're not working, so i tried exora's one, and it is telling me Unknown Command


Re: 9 FREAKING ERRORS I CANNOT FIX THEM !!!! I NEED SERIOUS HELP - miceiken - 26.07.2009

LOL @ Nerdrage, diaf.