Problem On Linux - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem On Linux (
/showthread.php?tid=378450)
Problem On Linux -
BlackAtom - 17.09.2012
Hi! The code below works on Windows, but on Linux doesn't write to file (because I host my server on Linux) Whyy
??
pawn Код:
#include <a_samp>
public OnPlayerConnect(playerid)
{
new File:playerinfos, pntFinal[256], pntName[MAX_PLAYER_NAME+1], pntIp[16];
GetPlayerName(playerid,pntName,sizeof(pntName));
GetPlayerIp(playerid,pntIp,sizeof(pntIp));
format(pntFinal,sizeof(pntFinal),"Name: %s | %sIP: %s",pntName,pntIp);
playerinfos = fopen("playerinfos.txt", io_write);
if (playerinfos)
{
fwrite(playerinfos, pntFinal);
fclose(playerinfos);
}
return 1;
}
AW: Problem On Linux -
Blowfish - 17.09.2012
Check the permissions.
The user, that is executing the server might not have write access to the file playerinfos.txt.
Re: Problem On Linux -
BlackAtom - 17.09.2012
Yeah you are right, THANK YOU
D