Argument type mismatch on BanEx? - 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 type mismatch on BanEx? (
/showthread.php?tid=129195)
Argument type mismatch on BanEx? -
bajskorv123 - 21.02.2010
Hey, I made a ban command for my friend because he dont trust any other admin systems so i wanted to make one for him

He dont know how to use dcmd so i made it with strtok.
But when i try to compile it it says:
Код:
C:\Users\Administrator\Desktop\Server\admin.pwn(71) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Heres the code: (What am i doing wrong?

)
pawn Код:
if(strcmp(cmd, "/ban", true) == 0)
{
new tmp[128];
new tmp2[128];
new id;
new reason;
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
id = strval(tmp);
reason = strval(tmp2);
BanEx(id, reason);
return 1;
}
Re: Argument type mismatch on BanEx? -
BlackFoX - 21.02.2010
reason must be a Array
Re: Argument type mismatch on BanEx? -
bajskorv123 - 21.02.2010
I do like this:
and
Код:
reason = strval(tmp2);//Error on this row
Then i compile, i get
Код:
error 033: array must be indexed (variable "reason")
-------------------------------------------------------------------
Then i do like this:
and
Код:
reason[64] = strval(tmp2);//Error on this row
Then i compile, i get
Код:
error 032: array index out of bounds (variable "reason")
Re: Argument type mismatch on BanEx? -
pyrodave - 21.02.2010
Quote:
Originally Posted by BlackFoX_UD_
reason must be a Array
|
hes right, but heres what you need:
pawn Код:
new reason; //remove this line, you dont need it
reason = strval(tmp2); //you dont need this either now
BanEx(id, tmp2); //change reason to tmp2
Re: Argument type mismatch on BanEx? -
bajskorv123 - 21.02.2010
Quote:
Originally Posted by DavidC
Quote:
Originally Posted by BlackFoX_UD_
reason must be a Array
|
hes right, but heres what you need:
pawn Код:
new reason; //remove this line, you dont need it
reason = strval(tmp2); //you dont need this either now
BanEx(id, tmp2); //change reason to tmp2
|
Thanks