Problem On Linux
#1

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;
}
Reply
#2

Check the permissions.
The user, that is executing the server might not have write access to the file playerinfos.txt.
Reply
#3

Yeah you are right, THANK YOU D
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)