SA-MP Forums Archive
Argument mismatch(Type1) - 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: Argument mismatch(Type1) (/showthread.php?tid=83309)



Argument mismatch(Type1) - Allu - 24.06.2009

Ok,i got this error:
pawn Код:
C:\Documents and Settings\Allu\Desktop\Failid\samp02Xserver.win32\gamemodes\lvdm.pwn(599) : error 035: argument type mismatch (argument 1)
And the code is:
Quote:

if(strcmp(cmdtext,"/varav", true) == 0)

Where is the problem?
Full code is:
pawn Код:
new cmdtext;
new AnthonyVarav;
new playerid;
new COLOR_LIGHTRED;

if(strcmp(cmdtext,"/varav", true) == 0)
{

    {
    new gateuse;
    if(gateuse == 0)
      {
      MoveObject(AnthonyVarav, 322.057648, -1187.713867, 76.314163, 2.00);
      gateuse = 1;
    return 1;
    }
    else if(gateuse == 1)
    {
      MoveObject(AnthonyVarav, -322.057648, -1187.713867, 70.788826, 2.00);
      gateuse = 0;
      }
    else
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Sa ei saa seda avada.");
        }
    }
}



Re: Argument mismatch(Type1) - abhinavdabral - 24.06.2009

lol ...... such a silly mistake
change this
Код:
if(strcmp(cmdtext,"/varav", true) == 0)
To
Код:
if(strcmp(cmdtext,"/varav", true,6) == 0)
----- The syntax is if(strcmp(cmdtext,"/command", IgnoreCase(true to ignore) ,size of command including / ) == 0) --------- I guess this would be helpful for you ....


Re: Argument mismatch(Type1) - Allu - 24.06.2009

it still gives me this error


Re: Argument mismatch(Type1) - Nero_3D - 24.06.2009

the given line
pawn Код:
if(strcmp(cmdtext,"/varav", true) == 0)
is completly ok, you are sure thats the line 599 ?


Re: Argument mismatch(Type1) - luby - 24.06.2009

Somebody see any logic in this script?


Re: Argument mismatch(Type1) - Allu - 24.06.2009

Im a beginner,but can u give me a working script then?
Like this one,u can open a gate with a command?

And,
Quote:
Originally Posted by ♣ ⓐⓢⓢ
the given line
pawn Код:
if(strcmp(cmdtext,"/varav", true) == 0)
is completly ok, you are sure thats the line 599 ?
Yes,Im Sure.



Re: Argument mismatch(Type1) - [TouchX]Ash - 24.06.2009

Код:
if(strcmp(cmdtext,"/varav", true) == 0)
{
new gateuse;
if(gateuse == 0)
  {
  MoveObject(AnthonyVarav, 322.057648, -1187.713867, 76.314163, 2.00);
 	  gateuse = 1;
    return 1;
    }
else if(gateuse == 1)
    {
 	  MoveObject(AnthonyVarav, -322.057648, -1187.713867, 70.788826, 2.00);
 	  gateuse = 0;
 	  }
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Sa ei saa seda avada.");
}
return 1;
	}
You could try that, your original script compiles fine for me though.


Re: Argument mismatch(Type1) - Allu - 24.06.2009

I dont know then,if u can compile and I can't,where is the problem then?
I still got an error in this line:
pawn Код:
if(strcmp(cmdtext,"/varav", true) == 0)



Re: Argument mismatch(Type1) - luby - 24.06.2009

new cmdtext;
should be
new cmdtext[256];

I know it is incorrect AT ALL, but anyway it is fix.


Re: Argument mismatch(Type1) - Allu - 24.06.2009

I know its wrong,but thank you.