09.09.2011, 19:05
When someone clicks login on the dialog, with the pass, the server is crashing.
pawn Code:
public OnPlayerLogin(playerid,password[])
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new string2[128], keystring[256], string[256];
format(string2, sizeof(string2), "users/%s.ini", name);
keystring = dini_Get(string2, "Key");
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
printf("OnPlayerlogin has been called, but not loading stats.");
if(strcmp(keystring, password, true) == 0)
{
printf("Printing...");
PlayerInfo[playerid][pCash] = dini_Int(string2,"Cash");
printf("Printing...");
PlayerInfo[playerid][pAccount] = dini_Int(string2,"Account");
printf("Printing...");
PlayerInfo[playerid][pAdmin] = dini_Int(string2,"AdminLevel");
printf("Printing...");
PlayerInfo[playerid][pLevel] = dini_Int(string2,"Level");
printf("Printing...");
PlayerInfo[playerid][pExp] = dini_Int(string2,"Respect");
PlayerInfo[playerid][gPupgrade] = dini_Int(string2,"UpgradePoints");
PlayerInfo[playerid][pKills] = dini_Int(string2,"Kills");
PlayerInfo[playerid][pSHealth] = dini_Float(string2,"pSHealth");
PlayerInfo[playerid][pHealth] = dini_Float(string2,"Health");
PlayerInfo[playerid][pPos_x] = dini_Float(string2,"Pos_x");
printf("Printing...");
PlayerInfo[playerid][pPos_y] = dini_Float(string2,"Pos_y");
PlayerInfo[playerid][pPos_z] = dini_Float(string2,"Pos_z");
printf("Printing...");
PlayerInfo[playerid][pInt] = dini_Int(string2,"Int");
PlayerInfo[playerid][pLocal] = dini_Int(string2,"Local");
PlayerInfo[playerid][pTeam] = dini_Int(string2,"Team");
PlayerInfo[playerid][pModel] = dini_Int(string2,"Char");
PlayerInfo[playerid][pPnumber] = dini_Int(string2,"PhoneNr");
printf("Printing...");
PlayerInfo[playerid][pHousekey] = dini_Int(string2,"pHouseKey");
PlayerInfo[playerid][pPbiskey] = dini_Int(string2,"Bizz");
PlayerInfo[playerid][pBanned] = dini_Int(string2,"Banned");
PlayerInfo[playerid][pFightSkill] = dini_Int(string2,"FightSkill");
PlayerInfo[playerid][pSex] = dini_Int(string2,"Sex");
PlayerInfo[playerid][pAge] = dini_Int(string2,"Age");
PlayerInfo[playerid][pTut] = dini_Int(string2,"Tutorial");
printf("Printing...");
PlayerInfo[playerid][pMember] = dini_Int(string2,"Member");
PlayerInfo[playerid][pRank] = dini_Int(string2,"Rank");
PlayerInfo[playerid][pGun1] = dini_Int(string2,"Gun1");
PlayerInfo[playerid][pAmmo1] = dini_Int(string2,"Ammo1");
PlayerInfo[playerid][pGun2] = dini_Int(string2,"Gun2");
PlayerInfo[playerid][pAmmo2] = dini_Int(string2,"Ammo2");
PlayerInfo[playerid][pCrashed] = dini_Int(string2,"Crashed");
if(PlayerInfo[playerid][pCrashed]==1) {
printf("Printing...");
PlayerInfo[playerid][pGun1] = dini_Int(string2,"Gun1");
PlayerInfo[playerid][pGun2] = dini_Int(string2,"Gun2");
PlayerInfo[playerid][pGun3] = dini_Int(string2,"Gun3");
PlayerInfo[playerid][pGun4] = dini_Int(string2,"Gun4");
printf("Printing...");
PlayerInfo[playerid][pGun5] = dini_Int(string2,"Gun5");
PlayerInfo[playerid][pGun6] = dini_Int(string2,"Gun6");
PlayerInfo[playerid][pGun7] = dini_Int(string2,"Gun7");
PlayerInfo[playerid][pGun8] = dini_Int(string2,"Gun8");
PlayerInfo[playerid][pGun9] = dini_Int(string2,"Gun9");
PlayerInfo[playerid][pGun10] = dini_Int(string2,"Gun10");
PlayerInfo[playerid][pGun11] = dini_Int(string2,"Gun11");
printf("Printing...");
PlayerInfo[playerid][pGun12] = dini_Int(string2,"Gun12");
PlayerInfo[playerid][pGun13] = dini_Int(string2,"Gun13");
PlayerInfo[playerid][pAmmo1] = dini_Int(string2,"Ammo1");
PlayerInfo[playerid][pAmmo2] = dini_Int(string2,"Ammo2");
PlayerInfo[playerid][pAmmo3] = dini_Int(string2,"Ammo3");
PlayerInfo[playerid][pAmmo4] = dini_Int(string2,"Ammo4");
PlayerInfo[playerid][pAmmo5] = dini_Int(string2,"Ammo5");
printf("Printing...");
PlayerInfo[playerid][pAmmo6] = dini_Int(string2,"Ammo6");
PlayerInfo[playerid][pAmmo7] = dini_Int(string2,"Ammo7");
PlayerInfo[playerid][pAmmo8] = dini_Int(string2,"Ammo8");
PlayerInfo[playerid][pAmmo9] = dini_Int(string2,"Ammo9");
PlayerInfo[playerid][pAmmo10] = dini_Int(string2,"Ammo10");
PlayerInfo[playerid][pAmmo11] = dini_Int(string2,"Ammo11");
PlayerInfo[playerid][pAmmo12] = dini_Int(string2,"Ammo12");
printf("Printing...");
PlayerInfo[playerid][pAmmo13] = dini_Int(string2,"Ammo13");
}
PlayerInfo[playerid][pJob] = dini_Int(string2,"Job");
PlayerInfo[playerid][pPayCheck] = dini_Int(string2,"PayCheck");
PlayerInfo[playerid][pPayDay] = dini_Int(string2,"PayDay");
PlayerInfo[playerid][pDonateRank] = dini_Int(string2,"DonateRank");
printf("Printing...");
PlayerInfo[playerid][pConnectTime] = dini_Int(string2,"ConnectTime");
PlayerInfo[playerid][pDonateTime] = dini_Int(string2,"DonateTime");
PlayerInfo[playerid][pJailed] = dini_Int(string2,"Jailed");
PlayerInfo[playerid][pJailTime] = dini_Int(string2,"JailTime");
PlayerInfo[playerid][pDrugs] = dini_Int(string2,"Drugs");
PlayerInfo[playerid][pMats] = dini_Int(string2,"Materials");
printf("Printing...");
PlayerInfo[playerid][pVaultOwned] = dini_Int(string2,"VaultOwned");
PlayerInfo[playerid][pVaultDrugs] = dini_Int(string2,"VaultDrugs");
PlayerInfo[playerid][pVaultMats] = dini_Int(string2,"VaultMats");
PlayerInfo[playerid][pWatch] = dini_Int(string2,"Watch");
printf("Printing...");
PlayerInfo[playerid][pPhoneBook] = dini_Int(string2,"PhoneBook");
PlayerInfo[playerid][pDrivLic] = dini_Int(string2,"CarLic");
printf("Printing...");
PlayerInfo[playerid][pCarkey] = dini_Int(string2,"Car");
PlayerInfo[playerid][pCarkey2] = dini_Int(string2,"Car2");
PlayerInfo[playerid][pCarkey3] = dini_Int(string2,"Car3");
PlayerInfo[playerid][pMarried] = dini_Int(string2,"Married");
PlayerInfo[playerid][pHelper] = dini_Int(string2,"Helper");
WantedLevel[playerid] = dini_Int(string2,"WantedLevel");
PlayerInfo[playerid][pGunLic] = dini_Int(string2,"GunLic");
PlayerInfo[playerid][pCrimes] = dini_Int(string2,"Crimes");
printf("Printing...");
PlayerInfo[playerid][pArrested] = dini_Int(string2,"Arrested");
string = dini_Get(string2, "MarriedTo");
strmid(PlayerInfo[playerid][pMarriedTo], string, 0, strlen(string), 255);
string = dini_Get(string2, "Taunt");
strmid(PlayerInfo[playerid][pTaunt], string, 0, strlen(string), 255);
PlayerInfo[playerid][pInvWeapon] = dini_Int(string2,"InvWeapon");
PlayerInfo[playerid][pInvAmmo] = dini_Int(string2,"InvAmmo");
PlayerInfo[playerid][pCaseDrugs] = dini_Int(string2,"CaseDrugs");
PlayerInfo[playerid][pCaseMats] = dini_Int(string2,"CaseMats");
PlayerInfo[playerid][pInvBeer] = dini_Int(string2,"InvBeer");
PlayerInfo[playerid][pInvWine] = dini_Int(string2,"InvWine");
printf("Printing...");
PlayerInfo[playerid][pInvCiggy] = dini_Int(string2,"InvCiggy");
PlayerInfo[playerid][pHidden] = dini_Int(string2,"Hidden");
PlayerInfo[playerid][pWalkie] = dini_Int(string2,"Walkie");
PlayerInfo[playerid][pWalkieFreq] = dini_Int(string2,"WalkieFreq");
PlayerInfo[playerid][pLighter] = dini_Int(string2,"Lighter");
PlayerInfo[playerid][pCigs] = dini_Int(string2,"Cigs");
string = dini_Get(string2, "BanReason");
strmid(PlayerInfo[playerid][pBanReason], string, 0, strlen(string), 255);
string = dini_Get(string2, "Fishes1");
strmid(PlayerInfo[playerid][pFishes1], string, 0, strlen(string), 255);
string = dini_Get(string2, "Fishes2");
strmid(PlayerInfo[playerid][pFishes2], string, 0, strlen(string), 255);
string = dini_Get(string2, "Fishes3");
strmid(PlayerInfo[playerid][pFishes3], string, 0, strlen(string), 255);
string = dini_Get(string2, "Fishes4");
strmid(PlayerInfo[playerid][pFishes4], string, 0, strlen(string), 255);
printf("Printing...");
string = dini_Get(string2, "Fishes5");
strmid(PlayerInfo[playerid][pFishes5], string, 0, strlen(string), 255);
PlayerInfo[playerid][pFish][0] = dini_Int(string2,"Fish1");
PlayerInfo[playerid][pFish][1] = dini_Int(string2,"Fish2");
PlayerInfo[playerid][pFish][2] = dini_Int(string2,"Fish3");
PlayerInfo[playerid][pFish][3] = dini_Int(string2,"Fish4");
PlayerInfo[playerid][pFish][4] = dini_Int(string2,"Fish5");
PlayerInfo[playerid][pNote1s] = dini_Int(string2,"Note1s");
PlayerInfo[playerid][pNote2s] = dini_Int(string2,"Note2s");
PlayerInfo[playerid][pNote3s] = dini_Int(string2,"Note3s");
PlayerInfo[playerid][pNote4s] = dini_Int(string2,"Note4s");
printf("Printing...");
PlayerInfo[playerid][pNote5s] = dini_Int(string2,"Note5s");
string = dini_Get(string2, "Note1");
strmid(PlayerInfo[playerid][pNote1], string, 0, strlen(string), 255);
string = dini_Get(string2, "Note2");
strmid(PlayerInfo[playerid][pNote2], string, 0, strlen(string), 255);
string = dini_Get(string2, "Note3");
strmid(PlayerInfo[playerid][pNote3], string, 0, strlen(string), 255);
string = dini_Get(string2, "Note4");
strmid(PlayerInfo[playerid][pNote4], string, 0, strlen(string), 255);
string = dini_Get(string2, "Note5");
strmid(PlayerInfo[playerid][pNote5], string, 0, strlen(string), 255);
printf("Printing...");
JobDelay[playerid] = dini_Int(string2,"JobDelay");
string = dini_Get(string2, "Accent");
strmid(PlayerInfo[playerid][pAccent], string, 0, strlen(string), 255);
PlayerInfo[playerid][pVoted] = dini_Int(string2,"Voted2");
string = dini_Get(string2, "AdmName");
strmid(PlayerInfo[playerid][pAdmName], string, 0, strlen(string), 255);
PlayerInfo[playerid][pHeadValue] = dini_Int(string2,"HeadValue");
PlayerInfo[playerid][pHiddenNum] = dini_Int(string2,"HiddenNum");
PlayerInfo[playerid][pSkate] = dini_Int(string2,"Skate");
PlayerInfo[playerid][pRadio] = dini_Int(string2,"Radio");
PlayerInfo[playerid][pTicket][0] = dini_Int(string2,"Ticket0");
printf("Printing...");
PlayerInfo[playerid][pTicket][1] = dini_Int(string2,"Ticket1");
PlayerInfo[playerid][pTicket][2] = dini_Int(string2,"Ticket2");
PlayerInfo[playerid][pTicket][3] = dini_Int(string2,"Ticket3");
PlayerInfo[playerid][pTicket][4] = dini_Int(string2,"Ticket4");
printf("Printing...");
string = dini_Get(string2, "TicketReason0");
strmid(PlayerInfo[playerid][pTicketReason0], string, 0, strlen(string), 255);
string = dini_Get(string2, "TicketReason1");
printf("Printing...");
strmid(PlayerInfo[playerid][pTicketReason1], string, 0, strlen(string), 255);
string = dini_Get(string2, "TicketReason2");
strmid(PlayerInfo[playerid][pTicketReason2], string, 0, strlen(string), 255);
string = dini_Get(string2, "TicketReason3");
strmid(PlayerInfo[playerid][pTicketReason3], string, 0, strlen(string), 255);
string = dini_Get(string2, "TicketReason4");
strmid(PlayerInfo[playerid][pTicketReason4], string, 0, strlen(string), 255);
string = dini_Get(string2, "App");
strmid(PlayerInfo[playerid][pApp], string, 0, strlen(string), 255);
PlayerInfo[playerid][pChanges] = dini_Int(string2,"Changes");
PlayerInfo[playerid][pFamNum] = dini_Int(string2,"FamNum");
string = dini_Get(string2, "Tattoo");
strmid(PlayerInfo[playerid][pTattoo], string, 0, strlen(string), 255);
PlayerInfo[playerid][pCellphone] = dini_Int(string2,"Cellphone");
PlayerInfo[playerid][pCelltime] = dini_Int(string2,"Celltime");
printf("Printing...");
PlayerInfo[playerid][pCellplan] = dini_Int(string2,"Cellplan");
PlayerInfo[playerid][pDonerGate1] = dini_Int(string2,"DonerGate1");
BreakAllow[playerid] = dini_Int(string2,"BreakAllow");
PlayerInfo[playerid][pFurnLocked] = dini_Int(string2,"FurnLocked");
PlayerInfo[playerid][pDonatorCarDate] = dini_Int(string2,"DonateCarDate");
PlayerInfo[playerid][pWarrant] = dini_Int(string2,"Warrant");
printf("Printing...");
PlayerInfo[playerid][pLockTime] = dini_Int(string2,"LockTime");
string = dini_Get(string2, "WarrentReason");
PlayerInfo[playerid][pFactionIden] = dini_Int(string2,"FactionIdent");
strmid(PlayerInfo[playerid][pWarrantReason], string, 0, strlen(string), 255);
if(PlayerInfo[playerid][pCrashed] != 0) {
HouseEntered[playerid] = dini_Int(string2,"HouseEntered");
IntEntered[playerid] = dini_Int(string2,"IntEntered");
printf("Printing...");
PlayerInfo[playerid][pWorld] = dini_Int(string2,"World");
PlayerInfo[playerid][pCrashArmour] = dini_Float(string2,"CrashArmour");
PlayerInfo[playerid][pCrashHealth] = dini_Float(string2,"CrashHealth");
PlayerInfo[playerid][pMask] = dini_Int(string2,"Mask");
printf("Printing...");
PlayerInfo[playerid][pMaskUse] = dini_Int(string2,"MaskUse");
}
if(PlayerInfo[playerid][pDonateRank] != 0) {
PlayerInfo[playerid][pMask] = dini_Int(string2,"Mask");
}
}
else {
if(WrongPass[playerid] < 5) {
SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR]: Invalid Password.");
WrongPass[playerid]++;
}
else {
BanEx(playerid,"Wrong Password");
WrongPass[playerid] = 0;
}
return 1;
}
if(PlayerInfo[playerid][pBanned] == 1) {
if(strcmp(PlayerInfo[playerid][pBanReason], "None", true) == 0) {
SendClientMessage(playerid,COLOR_LIGHTRED,"[INFO]: Your account is locked, Please post an appeal on www.***.com");
}
else {
format(string2, sizeof(string2), "[INFO]: Your account is locked, For the following Reason: %s.",PlayerInfo[playerid][pBanReason]);
SendClientMessage(playerid, COLOR_LIGHTRED, string2);
SendClientMessage(playerid,COLOR_LIGHTRED,"[INFO]: Please post an appeal on www.**.com");
}
Kick(playerid);
return 1;
}
else if(getdate()<PlayerInfo[playerid][pLockTime]) {
if(strcmp(PlayerInfo[playerid][pBanReason], "None", true) == 0) {
format(string2,sizeof(string2),"[INFO]: Your account is locked for %i day(s), Please post an appeal on www.**.com",PlayerInfo[playerid][pLockTime]-getdate());
SendClientMessage(playerid,COLOR_LIGHTRED,string2);
}
else {
format(string2, sizeof(string2), "[INFO]: Your account is locked for %i day(s), For the following Reason: %s.",PlayerInfo[playerid][pLockTime]-getdate(),PlayerInfo[playerid][pBanReason]);
SendClientMessage(playerid, COLOR_LIGHTRED, string2);
SendClientMessage(playerid,COLOR_LIGHTRED,"[INFO]: Please post an Appeal on www.***.com");
}
Kick(playerid);
return 1;
}
ClearChatbox(playerid, 10);
SendClientMessage(playerid,COLOR_GREEN,"|____________________________________________________|");
SendClientMessage(playerid,COLOR_WHITE," * Roleplay: ");
format(string2, sizeof(string2), "[INFO]: Script Version: %s.",SCRIPT_VERSION);
SendClientMessage(playerid, COLOR_WHITE, string2);
format(string2, sizeof(string2), "[INFO]: Last Update: %s.",SCRIPT_UPDATE);
SendClientMessage(playerid, COLOR_WHITE, string2);
format(string2, sizeof(string2), "[INFO]: Ventrilo: %s.",SCRIPT_VENT);
SendClientMessage(playerid, COLOR_WHITE, string2);
SendClientMessage(playerid, COLOR_WHITE, "[INFO]: Forums: www.***.com");
SendClientMessage(playerid,COLOR_GREEN,"|____________________________________________________|");
if (PlayerInfo[playerid][pDonateRank] > 0) {
SendClientMessage(playerid, COLOR_WHITE,"Thank you for your donation to * Roleplay.");
}
if (PlayerInfo[playerid][pAdmin] > 0) {
format(string2, sizeof(string2), "[SERVER]: You are logged in as a Level %d Admin.",PlayerInfo[playerid][pAdmin]);
SendClientMessage(playerid, COLOR_LIGHTRED,string2);
format(string2, sizeof(string2), "Admin MOTD: %s.",AdminMotd);
SendClientMessage(playerid, COLOR_YELLOW,string2);
gAdminLogged[playerid]=1;
}
if(PlayerInfo[playerid][pHelper]>0) {
format(string2, sizeof(string2), "Supporter MOTD: %s.",HelperMotd);
SendClientMessage(playerid, COLOR_YELLOW,string2);
}
SetSpawnInfo(playerid, 1, PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
if(gTeam[playerid] == 0) {
gTeam[playerid] = 3;
}
else {
gTeam[playerid] = PlayerInfo[playerid][pTeam];
}
new string3[128];
if(PlayerInfo[playerid][pCrashed] == 0) {
format(string3, sizeof(string3), "~w~Welcome ~n~~y~ %s", playername2);
printf(string3);
}
else {
format(string3, sizeof(string3), "~p~Crashed...~n~~w~Returning to your last position");
printf(string3);
}
GameTextForPlayer(playerid, string3, 5000, 1);
if(PlayerInfo[playerid][pMember] >= 7) {
format(string3, sizeof(string3), "Family MOTD: %s",FamilyInfo[PlayerInfo[playerid][pMember]][FamilyMOTD]);
SendClientMessage(playerid,COLOR_YELLOW,string3);
}
TogglePlayerSpectating(playerid,0);
ResetPlayerPCash(playerid);
GivePlayerPCash(playerid,PlayerInfo[playerid][pCash]);
gPlayerLogged[playerid] = 1;
new LevScore;
LevScore = PlayerInfo[playerid][pLevel];
SetPlayerScore(playerid,LevScore);
TextDrawShowForPlayer(playerid, E1);
SetPlayerColor(playerid,COLOR_WHITE);
CarKeys(playerid);
PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0);
SetCameraBehindPlayer(playerid);
printf(" Printing...");
SetVehicleParamsForPlayer(88,playerid,0,1);
SetVehicleParamsForPlayer(89,playerid,0,1);
SetVehicleParamsForPlayer(90,playerid,0,1);
SetPlayerRandomSpawn(playerid,1);
printf("after setplayerrandomspawn");
if(PlayerInfo[playerid][pHousekey] == 0)
{
PlayerInfo[playerid][pHousekey] = 255;
}
if(strcmp(PlayerInfo[playerid][pAccent], " ", true) == 0) {
strmid(PlayerInfo[playerid][pAccent], "says", 0, strlen("says"), 255);
}
if(strcmp(PlayerInfo[playerid][pAdmName], " ", true) == 0) {
strmid(PlayerInfo[playerid][pAdmName], "None", 0, strlen("None"), 255);
}
if(strcmp(PlayerInfo[playerid][pAdminPass], " ", true) == 0) {
strmid(PlayerInfo[playerid][pAdminPass], "None", 0, strlen("None"), 255);
}
if(strcmp(PlayerInfo[playerid][pTattoo], " ", true) == 0) {
strmid(PlayerInfo[playerid][pTattoo], "None", 0, strlen("None"), 255);
}
PreloadAnimLib(playerid,"BENCHPRESS");
PreloadAnimLib(playerid,"BOMBER");
PreloadAnimLib(playerid,"RAPPING");
PreloadAnimLib(playerid,"SHOP");
PreloadAnimLib(playerid,"BEACH");
PreloadAnimLib(playerid,"SMOKING");
PreloadAnimLib(playerid,"FOOD");
printf(" Printing...after FOOD");
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
printf(" Printing... after INT_HOUSE");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"CRACK");
/*
for(new i = 0; i < sizeof(HouseInfo2); i++)
{
if(strcmp(playername2, HouseInfo2[i][h2Owner], true) == 0)
{
SendClientMessage(playerid,COLOR_WHITE,"Type /refundhouse to refund your old property.");
return 1;
}
}*/
if(PlayerInfo[playerid][pMember] >= 7)
{
if(PlayerInfo[playerid][pFamNum] == 0) {
FamilyInfo[PlayerInfo[playerid][pMember]][FamilyMembers]++;
printf(" Printing...");
SaveFamilies();
PlayerInfo[playerid][pFamNum] = 1;
printf(" Printing... after pfamnum = 1");
}
}
return 1;
}