Issues with scriptfiles in hosted server
#1

I have a problem , i put my gamemode in the host(i put everything) and the server starts well but it doesnt save anything and it is not running scriptfiles(like dms , arenas , bases - a/d gamemode) , but in home server all of this runs , anyone can help me?
Reply
#2

Check capitalization first. On a Linux server File.txt and file.txt are not the same, on Windows they are. If that still doesn't work, make sure that you have set the proper permissions. The scriptfiles folder should be chmodded to 700 or 755 (or really anything that starts with 7, this indicates the the owner has permission to read (4), write (2) and execute (1) [4 + 2 + 1 = 7]). All files in the folder should be chmodded to 600 or 644 (or - again - really anything that starts with 6). You don't want random files to be executable, that's why you don't use 7 in this case.
Reply
#3

@Vince , mate i dont understand , because im noob in this things , i use ultra-h samp free host , and the files in scriptfiles as "areas , dms , bases , users" are not reading , and when i change something ingame , its not saved.
Reply
#4

Show someting from your users out your gamemode what is inside the users.txt
Reply
#5

@hwakinsRP , this
Код:
Password=167DE65E95D1359C4364DE27582DC5215031FB87CF8CD56B66354314AE60C5F80B66F5D8898F88117DAF1ECE5D4DB635B2C093B4F7C85D22D1905F5CFEDF53C4
Level=5
Weather=0
Time=10
ChatChannel=-1
And it doesnt read .ini files too.
Reply
#6

Код:
public OnPlayerStatsUpdate(playerid)
{
	if(GetPVarInt(playerid, "TempName") == 1) return 1;
	if(IsPlayerConnected(playerid))
	{
		if(gPlayerLogged{playerid})
		{
			new string3[32];
			new playername3[MAX_PLAYER_NAME];
			GetPlayerName(playerid, playername3, sizeof(playername3));
			format(string3, sizeof(string3), "users/%s.ini", playername3);
			new File: hFile = fopen(string3, io_write);
			if (hFile)
			{
				new var[156];
				format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
				format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
				format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
				fclose(hFile);
			}
		}
	}
	return 1;
}
Код:
public OnPlayerLogin(playerid,password[])
{
	new string[128];
	new tmp2[256];
	new string2[128];
	new playername2[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername2, sizeof(playername2));
	format(string2, sizeof(string2), "users/%s.ini", playername2);
	new File: UserFile = fopen(string2, io_read);
	if ( UserFile )
	{
		new PassData[256];
		new keytmp[256], valtmp[256];
		fread( UserFile , PassData , sizeof( PassData ) );
		keytmp = ini_GetKey( PassData );
		if( strcmp( keytmp , "Key" , true ) == 0 )
		{
			valtmp = ini_GetValue( PassData );
			strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
		}
		if( strfind( PlayerInfo[playerid][pKey], "\r", true) != -1)
		{
			format(string, sizeof(string), "Warning: \\r found in player %s's password.  Removing now. Password Before: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pKey]);
			Log("logs/password.log", string);
			new pos = strfind( PlayerInfo[playerid][pKey], "\r", true);
			strdel(PlayerInfo[playerid][pKey], pos, pos+2);
			format(string, sizeof(string), "%s's Password After: %s  (Note these passwords are encrypted)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pKey]);
			Log("logs/password.log", string);
		}
		//if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
		if(strcmp(PlayerInfo[playerid][pKey],password,true) == 0)
		{
			new key[ 256 ] , val[ 256 ];
			new Data[ 256 ];
			while ( fread( UserFile , Data , sizeof( Data ) ) )
			{
				key = ini_GetKey( Data );
				if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
				if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
			}
			fclose(UserFile);
		}
I copy this from my gamemode try someting like this you may edit it a big besure you have


pLevel
pAdmin
pKey

In your pInfo
Reply
#7

Can someone help me?
Reply
#8

All files are 666 , in which number should i chmod them?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)