function argument may not have a default value.
#1

public function's arguments cant own a default value

Code:
forward kick(playerid, bool:check = false);
public kick(playerid, bool:check = false) {
	if(!kick) SetTimerEx("kick", 1000, false, "dd", playerid, true);
	else Kick(playerid);
}
Just make a simple example, and we complie it.
get a error about that.

Code:
error 059: function argument may not have a default value (variable "check")
long time not coding makes my programming disordered.Fxxk.
Reply
#2

Code:
forward kick(playerid);
public kick(playerid) {
	static check[MAX_PLAYERS] = {false, ...};
	check[playerid] = true;
	if(!check[playerid]) SetTimerEx("kick", 1000, false, "d", playerid);
	else {
		check[playerid] = false;
		Kick(playerid);
	}
}
Reply
#3

You can't use default values in public functions.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)