Unreachable Code
#5

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:
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;

PS: Hope you understand me.
PS2: This is the way I make commands: condition, sscanf no parameter part, actual command. It also applies here.
Reply


Messages In This Thread
If player name is - by pulsare - 10.10.2017, 09:55
Re: Unreachable Code - by FreAkeD - 10.10.2017, 10:11
Re: Unreachable Code - by pulsare - 10.10.2017, 10:27
Re: Unreachable Code - by pulsare - 10.10.2017, 12:06
Re: Unreachable Code - by 10MIN - 10.10.2017, 12:27
Re: Unreachable Code - by pulsare - 10.10.2017, 14:58
Re: Unreachable Code - by 10MIN - 10.10.2017, 15:15
Re: Unreachable Code - by pulsare - 10.10.2017, 16:40
Re: Unreachable Code - by Kraeror - 10.10.2017, 16:48
Re: Unreachable Code - by pulsare - 10.10.2017, 16:56

Forum Jump:


Users browsing this thread: 2 Guest(s)