EnablePlayerCameraTarget Not Working (Question) - 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: EnablePlayerCameraTarget Not Working (Question) (
/showthread.php?tid=642225)
EnablePlayerCameraTarget Not Working (Question) -
ToiletDuck - 26.09.2017
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.
Re: EnablePlayerCameraTarget Not Working (Question) -
NaS - 26.09.2017
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?
Re: EnablePlayerCameraTarget Not Working (Question) -
ToiletDuck - 26.09.2017
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
Re: EnablePlayerCameraTarget Not Working (Question) -
NaS - 26.09.2017
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.
Re: EnablePlayerCameraTarget Not Working (Question) -
ToiletDuck - 26.09.2017
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");
}
......
...
...
..
Re: EnablePlayerCameraTarget Not Working (Question) -
NaS - 26.09.2017
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)