Default values on custom functions
#1

How would I go about doing this?

PHP код:
forward ShowPlayerTeleportMenuplayeridpage ); 
// This compiles fine, it's when I add the actual function.
public ShowPlayerTeleportMenu playeridpage )
{
    return 
true;

This returns the following error:

Quote:
textdraws.inc(13) : error 059: function argument may not have a default value (variable "page")
textdraws.inc(103) : error 025: function heading differs from prototype

Reply
#2

It happened me once I wrote a function incorrectly
textdraws.inc(103) : error 025: function heading differs from prototype
Reply
#3

pawn Код:
stock ShowPlayerTeleportMenu(playerid, page = 1)
{
    return true;
}
Reply
#4

Quote:
Originally Posted by Magic_Time
Посмотреть сообщение
It happened me once I wrote a function incorrectly
textdraws.inc(103) : error 025: function heading differs from prototype
If I put = 1 after the public function, this happens;

Quote:

function argument may not have a default value (variable "page")

Reply
#5

You tried this?

pawn Код:
ShowPlayerTeleportMenu ( playerid, page = 1 )
{
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)