Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Fuzzy168 on August 12, 2011, 05:25:25 pm
-
[pawn]warning 235: public function lacks forward declaration (symbol "OnPlayerConnect")[/pawn]
So, this is my first time getting this kind of warning. What do I do?
-
Well, if you had a public function like this:
[pawn]
public myFunction(parameter)
{
return true;
}
[/pawn]
You would forward it like this:
[pawn]
forward myFunction(parameter);
[/pawn]
So forward the OnPlayerConnect function somewhere at the top of the script.
-
I forward the OnPlayerConnect with this:[pawn]forward OnPlayerConnect(playerid);[/pawn]Not sure if its correct. Then this is my script:[pawn]public OnPlayerConnect(playerid);
{//The error was referring to here.
SetWaterLevel(6.0);
SetGamespeed(100);
SetGravity(100);
GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
SendClientMessage(playerid,GREEN, "Welcome to Vice City Life");
}[/pawn] And this is the error I received:[pawn]error 055: start of function body without function header[/pawn] The error was referring to {
-
[pawn]OnPlayerConnect(playerid);[/pawn]
why ; on a function header ?
It should be [pawn]OnPlayerConnect(playerid)[/pawn]
-
[pawn]
public OnPlayerConnect(playerid)
{//The error was referring to here.
SetWaterLevel(6.0);
SetGamespeed(100);
SetGravity(100);
GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
SendClientMessage(playerid,GREEN, "Welcome to Vice City Life");
}
[/pawn]
Remove the ";"