Mein Admin Login befehl ist folgender:
if(strcmp("/admin login",cmdtext,true)==0)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,MAX_PLAYERS);
new FILE[128];
format(FILE,sizeof(FILE),"/user/%s.ini",playername);
if(admin_eingeloggt[playerid]==0)
{
ShowPlayerDialog(playerid,DIALOG_ADMIN_LOGIN,1,"Login","Passwort:","Abbrechen","Weiter");
}
else
{
SendClientMessage(playerid,RED,"Du bist bereits als Admin eingeloggt!");
}
return 1;
}
Der Dialog:
if(dialogid==2)
{
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Passwort:","Abbrechen","Weiter");
return SendClientMessage(playerid,RED,"Kein Passwort angegeben!");
}
if(strcmp(inputtext,"ENTFERNT :P")==0)
{
new playername2[MAX_PLAYER_NAME], ausgabe2[MAX_PLAYERS];
GetPlayerName(playerid,playername2,sizeof(playername2));
format(ausgabe2,sizeof(ausgabe2),"%s hat sich als Adminstrator angemeldet!",playername2);
SendClientMessageToAll(ORANGE,ausgabe2);
admin_eingeloggt[playerid]=1;
SetPlayerColor(playerid,PINK);
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Passwort:","Abbrechen","Weiter");
SendClientMessage(playerid,RED,"Das Passwort war Falsch!");
}
}
}