Error 055, and Error 010.
#1

Код:
(41) : error 055: start of function body without function header
(43) : error 010: invalid function or declaration
pawn Код:
public PayDay(playerid);
{//line 41
    new string[128];
    CheckNumber[i] = 1000+random(8999);//line 43
    format(string, 128, "To receive your payday-money, please type: \"sighcheck %d\"", CheckNumber[playerid]);
    SendClientMessage(playerid, 0x00FF00AA, string);
}
Please help.
Reply
#2

pawn Код:
public PayDay(playerid)
Reply
#3

pawn Код:
CMD:signcheck(playerid, params[])
{
  if(!strlen(params[11]))
  {
    SendClientMessage(playerid, 0xFF0000AA, "{FFFFFF}Use: /signcheck [checknumber]");
    return 1;
  }
  new number = strval(params[11]);
  if(number == CheckNumber[playerid])
  {
    SendClientMessage(playerid, 0x00FF00AA, "{FFFFFF}You received your money!");
    GivePlayerMoney(playerid, -111);
  }
  else
  {
    SendClientMessage(playerid, 0xFF0000AA, "{FF3300}Wrong checknumber!");
  }
  return 1;
}
When I have the number, it comes up with this:

Use: /signcheck [checknumber]

Instead of the actual thing, any ideas?
Reply
#4

Use "if(isnull(params))" function.
Reply
#5

do not index params
I dont know how to explain it in English so i will give you example of what you do:

params - theseisexamplestring

With indexing that string with 11 you checking for 11's character/number/integer/whatever
In these string: theseisexample you check for character m (its 11's)
Reply
#6

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
do not index params
I dont know how to explain it in English so i will give you example of what you do:

params - theseisexamplestring

With indexing that string with 11 you checking for 11's character/number/integer/whatever
In these string: theseisexample you check for character m (its 11's)
You are right. For zcmd, the params string is the parameters that the player input already, it means it doesn't include the command name. Therefore you don't need to index it.

If you index it, and input it into strlen that it requires a string, probably it will cut off the characters from cell 0 to 10 (I think you know that).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)