An issue with #define -
zT KiNgKoNg - 30.06.2014
Recently i found one of my old defines that allowed the script (or via command) to work out a percent age,
but its giving me an error (not sure why).
Error: C:\Users\----\Documents\-----\----\---\script.pwn(1525) : warning 236: unknown parameter in substitution (incorrect #define pattern)
pawn Код:
COMMAND:percentage(playerid, params[], amount, percentage)
{
if(IsPlayerConnected(playerid))
{
if(HasCharacterSpawned[playerid])
{
if(AccountInfo[playerid][AccountStaffRank] > 0)
{
new tmpstr[1000];
new value;
value = WorkOutPercentage(amount, percentage);
}
} else CreateErrorMessage(playerid, "You must be spawned as one of your characters to use this command.");
}
return true;
}
Re: An issue with #define -
kamiliuxliuxliux - 30.06.2014
Don't use amount and percentage as parameters in COMMAND.
Re: An issue with #define -
zT KiNgKoNg - 30.06.2014
Quote:
Originally Posted by kamiliuxliuxliux
Don't use amount and percentage as parameters in COMMAND.
|
That's not the issue, and has nothing to do with it (it would not effect the command in any way), So please don't reply to a thread if you have no clue on what you're talking about.
Example: This works perfectly fine, so proves you wrong.
pawn Код:
COMMAND:factioninfo(playerid,params[], factioninfo)
Re: An issue with #define -
Dziugsas - 30.06.2014
USE sscanf.
Re: An issue with #define -
zT KiNgKoNg - 30.06.2014
Quote:
Originally Posted by Dziugsas
USE sscanf.
|
Again not the issue, and that you for point that out (forgot to add it). As you can see its a define issue.
pawn Код:
warning 236: unknown parameter in substitution (incorrect #define pattern)
Re: An issue with #define -
Dziugsas - 30.06.2014
COMMAND
ercentage(playerid, params[], amount, percentage) this is the line where you get warning?
Re: An issue with #define -
Konstantinos - 30.06.2014
If you use ZCMD, then you shouldn't use other arguments as kamiliuxliuxliux said because the include calls the cmd_... with 2 arguments only (playerid and params).
Anyways, the problem is with the #define pattern and not at the line is used. For example, doing:
pawn Код:
#define WorkOutPercentage(%0, %1) ... SOMETHING HERE ...
will give that warning because you cannot use space at the first part. The correct would be:
pawn Код:
#define WorkOutPercentage(%0,%1) ... SOMETHING HERE ...
Re: An issue with #define -
zT KiNgKoNg - 30.06.2014
Quote:
Originally Posted by Dziugsas
COMMAND ercentage(playerid, params[], amount, percentage) this is the line where you get warning?
|
Correction it isthis line; 1525
Again proving its this issue.
Note: If you're planning on reply to this thread please actually
READ the topic first.
Error: warning 236: unknown parameter in substitution You know this? that's what the thread is about. -->
(incorrect #define pattern) <-- You know this? that's what the thread is about.
Quote:
Originally Posted by Konstantinos
If you use ZCMD, then you shouldn't use other arguments as kamiliuxliuxliux said because the include calls the cmd_... with 2 arguments only (playerid and params).
Anyways, the problem is with the #define pattern and not at the line is used. For example, doing:
pawn Код:
#define WorkOutPercentage(%0, %1) ... SOMETHING HERE ...
will give that warning because you cannot use space at the first part. The correct would be:
pawn Код:
#define WorkOutPercentage(%0,%1) ... SOMETHING HERE ...
|
At-least someone helped out, and nothing else if the problem. +1 Repped.