pInfo[MAX_PLAYERS][PlayerInfo] won't work in Linux?
#1

I've got a big problem, now that i got myself a VPS with Centos. All the pInfo[MAX_PLAYERS][PlayerInfo] things seem not to work, everything stays on 0. Now this problem is in my gamemode, but they do work in my admin filterscript.

How to solve this?
Reply
#2

So, anyone?
Reply
#3

firstly i scripted them as PVars but that didnt work either .. if that helps

This forum requires that you wait 120 seconds between posts. Please try again in 28 seconds.
FCK THE WAITING TIME RAAAH!!!
Reply
#4

Make sure you didn't upload it to the FTP server in ASCII mode.
Reply
#5

Код:
public OnPlayerConnect(playerid)
{
	new playerfile[256];
	new PlayerName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
	format(playerfile,sizeof(playerfile),"/Casino/%s",PlayerName);
	if(!dini_Exists(playerfile))
    {
		dini_Create(playerfile);
		dini_IntSet(playerfile, "VIP", 0);
		dini_IntSet(playerfile, "Caddy", 0);
		dini_IntSet(playerfile, "FreeDrinks", 0);
		dini_IntSet(playerfile, "Staff", 0);
	}
	//SetPVarInt(playerid, "VIP", dini_Int(playerfile, "VIP"));
	pInfo[playerid][VIP] = dini_Int(playerfile, "VIP");
	//SetPVarInt(playerid, "Caddy", dini_Int(playerfile, "Caddy"));
	pInfo[playerid][Caddy] = dini_Int(playerfile, "Caddy");
	//SetPVarInt(playerid, "FreeDrinks", dini_Int(playerfile, "FreeDrinks"));
	pInfo[playerid][FreeDrinks] = dini_Int(playerfile, "FreeDrinks");
	//SetPVarInt(playerid, "Staff", dini_Int(playerfile, "Staff"));
	pInfo[playerid][Staff] = dini_Int(playerfile, "Staff");
	//SetPVarInt(playerid, "LotteryNumber", 0);
	pInfo[playerid][LotteryNumber] = dini_Int(playerfile, "LotteryNumber");
	return 1;
}
The files do say that the var's are positive, but ingame everything's negative.
Reply
#6

Oh c'mon, there should be somebody knowing the answer, right?
Reply
#7

mind posting your

enum PlayerInfo

and the
new pInfo[MAX_PLAYERS][PlayerInfo]
Reply
#8

I also use CentOS (on a dedicated server but its pretty much the same) - Ive never had this problem, although i have noticed that using arrays like that is definetly slower on linux. To get around this, i gave the samp03svr file the directory permission 777. This allowed it to do what it can do anyway. However that did significantly speed up the loading of gamemodes, filterscripts and plugins. Maybe you should try it for the problem above.

Have you tested your problem on a windows server? It might be worth doing so if you havent. It may be a code problem.

Are you running the samp03svr server as root? I really hope not - If you are create a new user and run it via that user.

Hope i helped
Reply
#9

how should this line work?
pawn Код:
format(playerfile,sizeof(playerfile),"/Casino/%s",PlayerName);
shouldnt it be at least PlayerName(playerid) ? and %s.ini ?
Reply
#10

Quote:
Originally Posted by funky1234
Посмотреть сообщение
I also use CentOS (on a dedicated server but its pretty much the same) - Ive never had this problem, although i have noticed that using arrays like that is definetly slower on linux. To get around this, i gave the samp03svr file the directory permission 777. This allowed it to do what it can do anyway. However that did significantly speed up the loading of gamemodes, filterscripts and plugins. Maybe you should try it for the problem above.

Have you tested your problem on a windows server? It might be worth doing so if you havent. It may be a code problem.

Are you running the samp03svr server as root? I really hope not - If you are create a new user and run it via that user.

Hope i helped
So i set the permissions for samp03svr.exe but now the problem has switched to the admin filterscript in some way. The vars in the gamemode now work, but the ones in the fs don't. ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)