Error 055, and Error 010. - 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: Error 055, and Error 010. (
/showthread.php?tid=270064)
Error 055, and Error 010. -
iGetty - 18.07.2011
Код:
(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.
Re: Error 055, and Error 010. -
Adil - 18.07.2011
Re: Error 055, and Error 010. -
iGetty - 18.07.2011
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?
Re: Error 055, and Error 010. -
=WoR=Varth - 19.07.2011
Use "if(isnull(params))" function.
Re: Error 055, and Error 010. -
DRIFT_HUNTER - 19.07.2011
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: theseisexa
mple you check for character m (its 11's)
Re: Error 055, and Error 010. -
leong124 - 19.07.2011
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).