argument type mismatch (1)
#1

Hi,
Hmm. Getting a warning about "argument type mismatch (argument 1)", when i'm trying to get the cmdtext to timer function. Any ideas, what did i wrong?

Код HTML:
.pwn(8450) : error 035: argument type mismatch (argument 1)
Код HTML:
cmd = strtok(cmdtext,idx);
if(!strcmp(cmd,"/attack",true))
{
	new money[256];
	money = strtok(cmdtext, idx);
	if(!strlen(money))
	{
    		SendClientMessage(playerid,COLOR_YELLOW,"* Use: /attack [money - "100000"]");
    		return 1;
	}
	// other things.

	new IsAttackCountTimer = SetTimer("IsAttackTimer", 60000, false);
	IsAttackTimer(money, gang, gplace, IsAttackCountTimer, playerid); // Line 8450
	return 1;
}
Код HTML:
forward IsAttackTimer(money, gang, gplace, IsAttackCountTimer, playerid);
public IsAttackTimer(money, gang, gplace, IsAttackCountTimer, playerid)
{
    new Message[410];
    format(Message,sizeof(Message),"*{FFFFFF}[{FF0000}Attack{FFFFFF}] {FF0000}%s {FFFFFF}Gang is Attacking a {FF9900AA}%s for {33AA33AA}%s {FFFFFF} USD.",gang, gplace, money);
    SendClientMessageToAll(0xB8860BAA,Message);
}
Thanks a lot!
Reply
#2

which of these lines is displaying the error?
Reply
#3

IsAttackTimer(money, gang, gplace, IsAttackCountTimer, playerid); // Line 8450
Reply
#4

I think it can only have playerid.
Did you try to create it as a stock?

PHP код:
stock IsAttackTimer(moneyganggplaceIsAttackCountTimerplayerid)
{
    new 
Message[410];
    
format(Message,sizeof(Message),"*{FFFFFF}[{FF0000}Attack{FFFFFF}] {FF0000}%s {FFFFFF}Gang is Attacking a {FF9900AA}%s for {33AA33AA}%s {FFFFFF} USD.",ganggplacemoney);
    
SendClientMessageToAll(0xB8860BAA,Message);

Reply
#5

Money is an array so do it like this
PHP код:
forward IsAttackTimer(money[], ganggplaceIsAttackCountTimerplayerid);
public 
IsAttackTimer(money[], ganggplaceIsAttackCountTimerplayerid
Reply
#6

@jasperschellekens: Yes, i tried. Same warnings.

@Sreyas: Ou, okey. But now, getting a "error 029: invalid expression, assumed zero" warning.
Reply
#7

How did you edit your code?
Reply
#8

Yes, changed it here:
Quote:

IsAttackTimer(money[], gang, gplace, IsAttackCountTimer, playerid); // Line 8450

and here

forward IsAttackTimer(money[], gang, gplace, IsAttackCountTimer, playerid);
public IsAttackTimer(money[], gang, gplace, IsAttackCountTimer, playerid)

Getting on all these lines:
Quote:

error 029: invalid expression, assumed zero

Reply
#9

Dont put [] on calling statements leave it like that.
IsAttackTimer(money, gang, gplace, IsAttackCountTimer, playerid);
Reply
#10

Okey.

Getting a warning:
Quote:

error 035: argument type mismatch (argument 2)

on the same line:
Quote:

IsAttackTimer(money, gang, gplace, IsAttackCountTimer, playerid);

gang, and gplace:
Quote:

new gang[128];
if(playerDB[playerid][plead] == 12) gang = "Grove Street";

new gplace[128];
gplace = "Bank";

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)