EnablePlayerCameraTarget Not Working (Question)
#1

I'm very frustrated with this. Why EnablePlayerCameraTarget is not working in my VPS? even though my VPS has unlimited bandwidth. EnablePlayerCameraTarget works perfectly in my local host. Can anyone tell me why? or what's wrong I mean EnablePlayerCameraTarget is not working IG when my server is being hosted at VPS. But when I tried in my local host EnablePlayerCameraTarget works pefectly.
Reply
#2

Show us some code example please.

It's working for me, and I'm sure it's working for others so it might be the script. Any differences between your local Server and VPS (maybe Linux?) Server?
Reply
#3

Quote:
Originally Posted by NaS
Посмотреть сообщение
Show us some code example please.

It's working for me, and I'm sure it's working for others so it might be the script. Any differences between your local Server and VPS (maybe Linux?) Server?
I don't think it's my code? because it works perfectly on my localhost. It detects objects, but then I tried to host my server via VPS (Windows) All plugins loaded. portfwarded. run as Administrator (Samp-server.exe) then I tried it's not really working. Windows OS Version is Windows Server 2012r2.

is it bug or what?

but Thank you for noticing my thread. <3
Reply
#4

Quote:
Originally Posted by ToiletDuck
Посмотреть сообщение
I don't think it's my code? because it works perfectly on my localhost. It detects objects, but then I tried to host my server via VPS (Windows) All plugins loaded. portfwarded. run as Administrator (Samp-server.exe) then I tried it's not really working. Windows OS Version is Windows Server 2012r2.

is it bug or what?

but Thank you for noticing my thread. <3
Can't tell if it's a bug or not. I can only tell that it's working for me on Linux and my PC, more I cannot say.

You can try running a test server with no plugins, and only one test gamemode with this function on your VPS. If it doesn't work for you then, it's a bug that should be possible to reproduce somehow.
Reply
#5

Quote:
Originally Posted by NaS
Посмотреть сообщение
Can't tell if it's a bug or not. I can only tell that it's working for me on Linux and my PC, more I cannot say.

You can try running a test server with no plugins, and only one test gamemode with this function on your VPS. If it doesn't work for you then, it's a bug that should be possible to reproduce somehow.
here's my code.
Код:
timer...
foreach(new playerid: Player)
	{
		if(!IsPlayerLogged{playerid} || GetPlayerState(playerid) == PLAYER_STATE_WASTED || IsPlayerNPC(playerid)) continue;
		if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
		{
			new obj = GetPlayerCameraTargetDynObject(playerid);
			if(obj != INVALID_OBJECT_ID)
			{
				for(new x = 0; x < MAX_OBJECTS; x++)
				{
					if(IsValidDynamicObject(LootData[x][lId]) && obj == LootData[x][lId])
					{
						return ShowPlayerInfo(playerid, LootData[x][lName], "Press Left '~yellow~Alt~white~' to pick up the item");
					} 
......
...
...
..
Reply
#6

Best for testing would be printing (or sending a client message) of the ID GetPlayerCameraTargetDynObject returns. That way you know if it returns anything useful at all, or INVALID_OBJECT_ID all the time. That would eliminate any errors within the rest of the code.

Is MAX_OBJECTS really correct btw? Shouldn't it be the size of the "LootData" Array? (ignore this if LootData is declared with the size of MAX_OBJECTS)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)