26.03.2010, 17:16
Alright so, you know what you adjust the gravity too high and it makes your screen start flashing white...
Well I am getting that error whenever I log in, and I've traced it to this public:
It broke my indentation... but nevermind that...
I've traced it to the print("3")
Also, it only occurs on login, and if I try it on my own private LAN server it does not give the same problem.
Well I am getting that error whenever I log in, and I've traced it to this public:
pawn Код:
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), "accounts/%s.cer", pname2);
new File: UserFile = fopen(string2, io_read);
print("1");
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 , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
if( strcmp( key , "Skin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSkin] = strval( val ); }
if( strcmp( key , "DutySkin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDutySkin] = strval( val ); }
if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
if( strcmp( key , "Warns" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWarns] = strval( val ); }
if( strcmp( key , "Muted" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMute] = strval( val ); }
if( strcmp( key , "Inside" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pInside] = strval( val ); }
if( strcmp( key , "Exitx" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pExitx] = strval( val ); }
if( strcmp( key , "Exity" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pExity] = strval( val ); }
if( strcmp( key , "Exitz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pExitz] = strval( val ); }
if( strcmp( key , "House" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHouse] = strval( val ); }
if( strcmp( key , "Gender" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGender] = strval( val ); }
if( strcmp( key , "InBuilding" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pInBuilding] = strval( val ); }
if( strcmp( key , "Phone" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPhone] = strval( val ); }
if( strcmp( key , "PhoneCallerId" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPhoneCallerId] = strval( val ); }
if( strcmp( key , "Car" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCar] = strval( val ); }
if( strcmp( key , "AccountId" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAccountId] = strval( val ); }
if( strcmp( key , "PoliceDuty" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPoliceDuty] = strval( val ); }
if( strcmp( key , "PoliceRank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPolice] = strval( val ); }
if( strcmp( key , "Rank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pRank] = strval( val ); }
if( strcmp( key , "Frequency" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pRadioFreq] = strval( val ); }
if( strcmp( key , "SpawnX" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSpawnX] = strval( val ); }
if( strcmp( key , "SpawnY" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSpawnY] = strval( val ); }
if( strcmp( key , "SpawnZ" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSpawnZ] = strval( val ); }
if( strcmp( key , "M4A1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pM4A1] = strval( val ); }
if( strcmp( key , "AK47" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAK47] = strval( val ); }
if( strcmp( key , "Tec9" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTec9] = strval( val ); }
if( strcmp( key , "Uzi" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pUzi] = strval( val ); }
if( strcmp( key , "Mp5" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMp5] = strval( val ); }
if( strcmp( key , "CountryRifle" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCountryRifle] = strval( val ); }
if( strcmp( key , "SniperRifle" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSniperRifle] = strval( val ); }
if( strcmp( key , "SawnOff" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSawnOff] = strval( val ); }
if( strcmp( key , "CombatShotgun" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCombatShotgun] = strval( val ); }
if( strcmp( key , "Deagle" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeagle] = strval( val ); }
if( strcmp( key , "9mm" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][p9mm] = strval( val ); }
if( strcmp( key , "Knife" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKnife] = strval( val ); }
if( strcmp( key , "Baseballbat" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBaseballbat] = strval( val ); }
if( strcmp( key , "Nightstick" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pNightStick] = strval( val ); }
if( strcmp( key , "Pepperspray" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPepperspray] = strval( val ); }
if( strcmp( key , "Condoms" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCondoms] = strval( val ); }
print("2");
ResetPlayerMoney(playerid);
}
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), "Welcome %s, you have been succesfully logged in!", pname3);
SendClientMessage(playerid, COLOR_GREEN,string3);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Note: This is a public beta, any bugs you may find, do not be suprised, submit them to the forum please (forum.lethotas.com)");
SpawnPlayer(playerid);
SetPlayerPos(playerid, PlayerInfo[playerid][pSpawnX], PlayerInfo[playerid][pSpawnY], PlayerInfo[playerid][pSpawnZ]);
if(PlayerInfo[playerid][pAdmin] > 0)
{
print("3");
format(string3, sizeof(string3), "You logged in as a level %d administrator", PlayerInfo[playerid][pAdmin]);
SendClientMessage(playerid, COLOR_YELLOW, string3);
format(string3, sizeof(string3), "[A] %s(%d) has logged in!", pname3, playerid);
SendClientMessageToAdmins(COLOR_YELLOW, string3, 1);
SendClientMessage(playerid, COLOR_GREEN, "use /p or /o to talk in public chat to everyone else, otherwise just talk normal to communicate with people around you");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Password does not match your name");
fclose(UserFile);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Password Incorrect, try again.","Error","Login","Forgot Password");
}
}
return 1;
}
I've traced it to the print("3")
Also, it only occurs on login, and if I try it on my own private LAN server it does not give the same problem.