A few PAWNO errors
#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/1337898", cmdtext, true, 10) == 0);
    {
        if(gate1status)
        {
          MoveObject(gate1,985,-1994.02, 2181, 7.00, 1);
          gate1status = 0;
    }
        else
    {
            MoveObject(gate1,985,-1994.02, 2187, 7.00, 1);
            gate1status = 1;
        return 1;
    }
    if (strcmp("/69875", cmdtext, true, 10) == 0)
    {
        if(gate2status)
        {
          MoveObject(gate2,986, -1994.02, 2173, 7.00, 1);
          gate2status = 0;
        }
        else
        {
            MoveObject(gate2,986, -1994.02, 2167, 7.00, 1);
            gate2status = 1;
 }
        return 1;
  }
  }
pawn Код:
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(299) : error 036: empty statement
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(303) : warning 202: number of arguments does not match definition
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(308) : warning 202: number of arguments does not match definition
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(310) : warning 217: loose indentation
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(316) : warning 202: number of arguments does not match definition
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(321) : warning 202: number of arguments does not match definition
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(327) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Please do help.. I can't find these.. I usually can ^^
Reply
#2

Remove the modelid from MoveObject, you don't have that.

That will get rid of 4 warnings.

Replace if (strcmp("/1337898", cmdtext, true, 10) == 0);

With if (strcmp("/1337898", cmdtext, true, 10) == 0)

No ; is meant to be in it. That will remove the error.

Loose indentations are not really a problem.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/1337898", cmdtext, true, 10) == 0)
    {
            if(gate1status)
            {
              MoveObject(gate1,-1994.02, 2181, 7.00, 1);
              gate1status = 0;
        }
            else
        {
                MoveObject(gate1,-1994.02, 2187, 7.00, 1);
                gate1status = 1;
            return 1;
        }
        }
    if (strcmp("/69875", cmdtext, true, 10) == 0)
    {
            if(gate2status)
            {
              MoveObject(gate2, -1994.02, 2173, 7.00, 1);
              gate2status = 0;
            }
            else
            {
                MoveObject(gate2, -1994.02, 2167, 7.00, 1);
                gate2status = 1;
            }
        }
        return 1;
  }
 }
Reply
#3

Now I get:
pawn Код:
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(310) : warning 217: loose indentation
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(327) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
They don't matter?
Reply
#4

Quote:
Originally Posted by Shinzei_Banzai
Now I get:
pawn Код:
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(310) : warning 217: loose indentation
C:\Users\Bastian\Documents\Samp_server\gamemodes\Test.pwn(327) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
They don't matter?
no they don't matter, you can even disable them by putting this in the top of your script:
pawn Код:
#pragma tabsize 0
Reply
#5

I restarted server twice and I don't have any errors, but only "/1337898"(gate1) works.. "/69875"(gate2) says: "SERVER: UNKNOWN COMMAND"
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/1337898", cmdtext, true, 10) == 0)
    {
        if(gate1status)
        {
          MoveObject(gate1,-1994.02, 2181, 7.00, 1);
          gate1status = 0;
    }
        else
    {
            MoveObject(gate1,-1994.02, 2187, 7.00, 1);
            gate1status = 1;
        return 1;
    }
    if (strcmp("/69875", cmdtext, true, 10) == 0)
    {
        if(gate2status)
        {
          MoveObject(gate2, -1994.02, 2173, 7.00, 1);
          gate2status = 0;
        }
        else
        {
            MoveObject(gate2, -1994.02, 2167, 7.00, 1);
            gate2status = 1;
 }
        return 1;
  }
  }
Reply
#6

Sorry for double posting, but does anybody know why only the first command works? Look at the reply above ^^^^^^^^^^^^
Reply
#7

Does this work?? (Note: Not Tested)
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (strcmp("/1337898", cmdtext, true, 10) == 0)
  {
    if(gate1status)
    {
      MoveObject(gate1,-1994.02, 2181, 7.00, 1);
      gate1status = 0;
    }
    else
    {
      MoveObject(gate1,-1994.02, 2187, 7.00, 1);
      gate1status = 1;
    }
    return 1;
  }
  if (strcmp("/69875", cmdtext, true, 10) == 0)
  {
    if(gate2status)
    {
       MoveObject(gate2, -1994.02, 2173, 7.00, 1);
       gate2status = 0;
    }
    else
    {
      MoveObject(gate2, -1994.02, 2167, 7.00, 1);
      gate2status = 1;
    }
    return 1;
  }
  return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)