Make it faster
#1

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..?
Reply
#2

Curiosity..
Reply
#3

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.
Reply
#4

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? )
Reply
#5

Yeah right. The same thing.
Reply
#6

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

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); //
Reply
#8

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.
Reply
#9

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)