Hallo habe ein problem wenn ich so compile kommt immer
error 025: function heading differs from prototype
und
error 021: symbol already defined: "OnPlayerLogin"
wie kann ich es am einfachsten machen das beide laufen sind verschiedene systeme
so siehts aus:
public OnPlayerLogin( playerid, password[ ] )
{
if( IsPlayerConnected( playerid ) )
{
new pass[ 129 ];
GetPVarString( playerid, "pPassword", pass, sizeof( pass ) );
if ( !strcmp ( Whirlpool_hash( password ), pass, false ) )
{
new p_str[ 48 ];
format( p_str, sizeof( p_str ), PLAYER_FILE, PlayerName( playerid ) );
if( fexist( p_str ) ) LoadPlayerData( playerid, p_str );
SetPVarInt( playerid, "pLogged", 1 );
SendClientMessage( playerid, RULE, " Du hast dich erfolgreich eingeloggt." );
PlayerPlaySound( playerid, 1058, 0.0, 0.0, 0.0 );
}
else
{
new hour, minute, second,playername[MAX_PLAYER_NAME],string[128];
AddPVarInt( playerid, "Warning", +1 );
gettime( hour, minute, second );
printf("[%02d:%02d:%02d] %s hat ein falsches PW benutzt. %i/%i", hour, minute, second, PlayerName( playerid ), GetPVarInt( playerid, "Warnung" ), MAX_FAILED_LOGINS );
if( GetPVarInt( playerid, "Warning" ) > MAX_FAILED_LOGINS -1 )
TogglePlayerControllable(playerid,false),GetPlayerName(playerid,playername,sizeof(playername)),format(string,sizeof(string),"[ANTI-HACK] %s wurdes vom System gekickt. Grund: Falsches Login Passwort",playername),SendClientMessageToAll(0xFF6347AA,string),Kick( playerid );
else
{
SendFormattedMessage( playerid, TOMATO, " Fehler: "COL_NEWS"Falsches Passwort. Du hast noch %d versuch(e)", MAX_FAILED_LOGINS - GetPVarInt( playerid, "Warnung" ) );
ShowPlayerDialog( playerid, LOG_DIALOG + playerid, DIALOG_STYLE_INPUT, ""COL_TOMATO"Spieler Security", LOGINTEXT, "Einloggen", "Wechseln" );
}
}
}
return 1;
}
public OnPlayerLogin(playerid,const string[])
{
new pname2[MAX_PLAYER_NAME];
new pname3[MAX_PLAYER_NAME];
new string2[64];
new string3[128];
GetPlayerName(playerid, pname2, sizeof(pname2));
format(string2, sizeof(string2), "%s.cer", pname2);
new File: UserFile = fopen(string2, io_read);
if (UserFile)
{
new valtmp[128];
fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);
if ((strcmp(PlayerInfo[playerid][pPassword], string, true, strlen(valtmp)-1) == 0))
{
new key[128],val[128];
new Data[128];
while(fread(UserFile,Data,sizeof(Data)))
{
key = ini_GetKey(Data);
if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
if( strcmp( key , "Admin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
}
fclose(UserFile);
gPlayerLogged[playerid] = 1;
gPlayerAccount[playerid] = 1;
new kills = PlayerInfo[playerid][pKills];
SetPlayerScore(playerid, kills);
GetPlayerName(playerid, pname3, sizeof(pname3));
format(string3, sizeof(string3), "Willkommen %s,!", pname3);
SendClientMessage(playerid, COLOR_WHITE,string3);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Falsches Passwort!");
fclose(UserFile);
}
}
return 1;
}
kann ich vlt. was bei public OnPlayerLogin(playerid,const string[]) ändern damit beide systeme laufen ?