|
[ [debug] Server crashed while executing C-Basic.amx [ [debug] AMX backtrace: [ [debug] #0 native fclose () [004056c0] from samp-server.exe [ [debug] #1 00013b28 in ?? () from C-Basic.amx [ [debug] #2 00053418 in ?? () from C-Basic.amx [ [debug] #3 00056f30 in ?? () from C-Basic.amx [ [debug] #4 0001d2c8 in public OnDialogResponse () from C-Basic.amx [ [debug] Native backtrace: [ [debug] #0 0049316b in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe [ [debug] #1 004056cd in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe [ [debug] #2 00bc350a in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll [ [debug] #3 00bc51a6 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll [ [debug] #4 00bbd641 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll [ [debug] #5 00bc355a in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll [ [debug] #6 0046dac1 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe [ [debug] #7 00452850 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe [ [debug] #8 0012fd5c in ?? () [ [debug] #9 01080022 in ?? () |
|
Originally Posted by SA-MP Wiki
Important Note: The file handle must be valid, and must point to a file successfully opened by fopen.
|
new
File: fhandle = fopen("somefile.txt", io_append);
if (fhandle) // It opened the file successfully
{
fwrite(fhandle, "blabla..");
fclose(fhandle);
}
|
[ [debug] Server crashed while executing C-Basic.amx [ [debug] AMX backtrace: [ [debug] #0 native fclose () [004056c0] from samp-server.exe [ [debug] #1 00013b28 in ?? (0x00000000) from C-Basic.amx [ [debug] #2 00053418 in ?? (0x00000000) from C-Basic.amx [ [debug] #3 00056f30 in ?? (0x00000000, 0x00000064, 0x00000001, 0xffffffff, 0x011ab2bc) from C-Basic.amx [ [debug] #4 0001d2c8 in public OnDialogResponse (0x00000000, 0x00000064, 0x00000001, 0xffffffff, 0x011ab2bc) from C-Basic.amx [ [debug] Native backtrace: [ [debug] #0 0049316b in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe [ [debug] #1 004056cd in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe [ [debug] #2 00bc5f2a in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll [ [debug] #3 00bc822e in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll [ [debug] #4 00bbff6f in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll [ [debug] #5 00bc5f7a in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll [ [debug] #6 0046dac1 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe [ [debug] #7 00452850 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe [ [debug] #8 0012fd5c in ?? () [ [debug] #9 010801b0 in ?? () |
if(dialogid == REGISTER_DIALOG)
{
if(!response) return Kick(playerid);
else
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,REGISTER_DIALOG, DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\n\nYou left the password blank.","Register","");
return 1;
}
else
{
new nPass[130];
WP_Hash(nPass, sizeof(nPass), inputtext);
pData[playerid][Password] = nPass;
SavePlayerData(playerid);
ShowPlayerDialog(playerid, LOGIN_DIALOG, DIALOG_STYLE_PASSWORD, "Login", "Thank you for registering.\nEnter your password to login.", "Login", "");
}
return 1;
}
}
stock SavePlayerData(playerid)
{
SaveBackPack(playerid);
SaveTeleports(playerid);
new INI:file = INI_Open(Path(playerid));
INI_SetTag(file,"Player's Data");
INI_WriteString(file,"Password",pData[playerid][Password]);
INI_WriteFloat(file,"Health",GetPlayerHealthReturn(playerid), 2);
INI_WriteFloat(file,"Armour",GetPlayerArmourReturn(playerid), 2);
INI_WriteInt(file,"Level",pData[playerid][Level]);
INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
INI_WriteInt(file,"Score",GetPlayerScore(playerid));
INI_WriteInt(file,"Kills",pData[playerid][Kills]);
INI_WriteInt(file,"Deaths",pData[playerid][Deaths]);
INI_Close(file);
return 1;
}