SA-MP Forums Archive
Make it faster - 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: Make it faster (/showthread.php?tid=478065)



Make it faster - Riddick94 - 27.11.2013

Any idea how to make that script work faster?

https://sampforum.blast.hk/showthread.php?tid=309467

What I mean is.. basically when player move left - he will turn left, not after few momments. It works really smooth while you move UP or DOWN to increase or decrease your altitude, but not really when you don't do that.

Any ideas? or maybe it's a SA-MP fault about sending a package to the server..?


Re: Make it faster - Riddick94 - 28.11.2013

Curiosity..


Re: Make it faster - Ballu Miaa - 29.11.2013

It is a latency issue Riddick. You can optimize that script in a whole but still that wont do the trick. It is taking time to send the packet to the server also it takes time to get the response back from it too.


Re: Make it faster - Riddick94 - 29.11.2013

Just like I thought.. so basically, when I'm holding key to change my altitude it's keep sending my data to the server pretty quick. All right, but if I'm holding KEY_UP to go forward, it should do the same thing, right? )


Re: Make it faster - Ballu Miaa - 29.11.2013

Yeah right. The same thing.


Re: Make it faster - Riddick94 - 29.11.2013

Well, apparently it doesn't do that, that's why I'm asking for that.


Re: Make it faster - Ballu Miaa - 30.11.2013

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
Well, apparently it doesn't do that, that's why I'm asking for that.
Probably the code which is executed once the player's holds the UP_KEY to go forward takes more time compare to others. Do gettickrate to do this and share with us for both the functions getting executed.

pawn Код:
new count = GetTickCount();//Top of the function
    //Body of the Function
    printf("Time taken to execute the function: %d", GetTickCount() - count); //



Re: Make it faster - Riddick94 - 30.11.2013

Basically, it says 0 all the time, it said 1 just once. So, it seems to be fast, but something is stopping it from calling a function "SetPlayerLookAt" faster.


Re: Make it faster - Ballu Miaa - 01.12.2013

0 all the time. Thats fast. You should try to optimize the code. Thats all i can suggest now.


Re: Make it faster - Riddick94 - 01.12.2013

The point is, I have tried, but no results at all. Maybe you've got some idea what to change/edit/remove to make it more efficient?