10.10.2017, 12:27
Read your code carefully. The code "translated" in english: If the file exists do ___ and end the function returning 1, else do ___ and end the function. If sSpelier[playerid][Deaktiviert] is equal to 1, kick playerid and end the function. End the function and return 1.
As you can see, for the compiler the code was ended in the first sentence. And then it was ended again when it was checking for Deaktiviert. And ended again.
Rearanged the code and solved it:
PS: Hope you understand me.
PS2: This is the way I make commands: condition, sscanf no parameter part, actual command. It also applies here.
As you can see, for the compiler the code was ended in the first sentence. And then it was ended again when it was checking for Deaktiviert. And ended again.
Rearanged the code and solved it:
PHP код:
public OnPlayerConnect(playerid)
{
new Spieler[64];
new Sname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Sname,sizeof(Sname));
format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
if(sSpieler[playerid][Deaktiviert] == 1) //check it. (just to make sure you don't show the dialog when he is Deaktiviert)
{
Kick(playerid);
return 1;
}
if(dini_Exists(Spieler))
{
SendClientMessage(playerid,0xFFAA00FF,"[Server]: Welcome back");
ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_PASSW ORD,"Login","Your Account was found. Login.","Login","Cancel");
return 1;
}
SendClientMessage(playerid,0x00B9FFFF,"Welcome to "ClanTag" DEATHMATCH /killme to Respawn!");
ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_IN PUT,"Register","Choose a Password to register","Register","Cancel");
return 1;
}
PS2: This is the way I make commands: condition, sscanf no parameter part, actual command. It also applies here.