Hallo,
Wie die Überschrift schon sagt, habe ich ein Problem mit dem Timeout/crash public.
Woran liegt der Fehler?
public PlayerDisconnected(playerid, reason)
{
new string[64], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
}
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
Den Warning zeigt er mir hier an:
public PlayerDisconnected(playerid, reason)
Error:
C:\Users\Matze\Desktop\Script\gamemodes\Script.pwn(51156) : warning 235: public function lacks forward declaration (symbol "PlayerDisconnected")
Ich muss ein forward machen, aber wenn ich dies mache:
forward PlayerDisconnected(playerid, reason)
public PlayerDisconnected(playerid, reason)
{
new string[64], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
}
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
Kommt dieser Error:
C:\Users\Matze\Desktop\Script\gamemodes\Script.pwn(51157) : error 001: expected token: ";", but found "public"
Ich versteh das nicht so ganz, und würde mich sehr um Hilfe freuen.
Schöne Grüße,
Soldier