06.12.2010, 16:32
No, there's a bracket to much :P
pawn Code:
public OnPlayerRequestSpawn(playerid)
{
#if defined mustlogin
if(logged[playerid] == 0)
{
new playerfile[100], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "/maxadmin/users/%s.ini",pname);
#if defined autologin
if(dini_Exists(playerfile))
{
new playerid;
level[playerid]= dini_Int(playerfile, "level");
logged[playerid] = 0;
GivePlayerMoney(playerid, dini_Int(playerfile, "Cash"));
SetPlayerScore(playerid, dini_Int(playerfile, "Score"));
SpawnPlayer(playerid);
return 1;
}
#endif
if(dini_Exists(playerfile)) SendClientMessage(playerid, COLOR_GREEN, "This playername is registered! Please type /login to login or change your name");
else SendClientMessage(playerid, COLOR_ORANGE, "This playername is not registered! Please type /register to create account");
return 0;
}
#endif
return 1;
}