Public error name
#1

pawn Код:
//At OnPlayerText
new tmp[256], idx;
tmp = strtok(text, idx);
Test(playerid,tmp);

//At Bottom
forward Test(playerid,check);
public Test(playerid,check)
{
  // Code using 'check'.
}
and it gives
Код:
error 035: argument type mismatch (argument 2)
What is wrong here?
Reply
#2

check is a string so you must format ti the right way:

public Test(playerid, check[])
Reply
#3

Oke done that, next question:
How to make a integer out of a string?

I want to make a integer out of check[].

Reply
#4

You need to use Strval to get an integer from a string. For example:

pawn Код:
new iValue = strval(tmp);
Reply
#5

strval is when you need to convert a integer in a string right?
Reply
#6

See for yourself, I might not have fully understood your query:

Click here
Reply
#7

Thanks, was confused with valstr.

Thanks again.
Reply
#8

Now you've confused me, i'll have to look up valstr!
Reply
#9

valstr can be used to convert an integer value to a string.

strval can be used to convert a string to an integer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)