Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Guide 1. Clientside Optimization (FPS++) | A Simle Method Expression

Ares

VAG
Admin
Joined
May 6, 2021
Messages
547
Reaction score
97,400
Points
411
Location
root
Website
vag.gg
Hello there,

There was a place where I explained how ClientSide and ServerSide can be optimized before.
but I thought my explanation was insufficient and I opened this issue.

What is the Event of the Optimization We Will Do?: We will use the code or code blocks for optimization of triggers such as distance / action / event that we set. In short, we will activate the code due to the event.

How is it done? ;

In the example you will see, I will use the optimization on the "DrawMarker" Nativesi.
DrawMarker natives heavily influences remon values

I will implement my method using distance. If the client (client) is at a certain distance from the location of the Marker, I will delete the Marker.

First, I will use the local operator to help me write my codes. PlayerPedId() or GetPlayerPed(-1) represents the player
but the texts are too long and it bothers me. I opened the Client Script (file) that I will optimize and clicked on the top line.


Code:
local player = PlayerPedId()

I'm posting your code...

Important : PlayerPedId() updates itself as the player enters, but GetPlayerPed(-1) means like no limit player, so definitely use PlayerPedId() (not much difference)
As I said, we were going to optimize DrawMarker (creating markers).
**DrawMarker is a native used in loop, otherwise it won't work**
Inside the loop where DrawMarker is located


Code:
local playerLoc = GetEntityCoords(player)

I'm posting your code. It takes the coordinates of the players on the server.
!! And I am writing a code above the line where DrawMarker is located.


C++:
if GetDistanceBetweenCoords(playerLoc.x, playerLoc.y, playerLoc.z, 1011.34, -692.64, 56.97, true) < 20 then

(( after playerLoc.<data> ".", we reach the data we want to receive in playerLoc, the "20" at the end represents the distance in meters))
and we add "end" under DrawMarker.


Ekran Alıntısı.png


You can review the parameters of GetDistanceBetweenCoords Natives

Other Examples:

Let's use something other than "distance" this time...
For example, if the player presses the "X" Key, the Marker will be created. We will use the IsControlPressed Native for this
First of all, we need to reach the INDEX, that is, the Button code of the "X" Key.
to browse native in parameters

Thinking that you understand the logic of doing it fast, I will give an example directly.



Ekran Alıntısı.png

Now the Marker is created when the "X" key is used.

There are too many examples that could be given. I think what I have given will make you understand the logic of Optimization.

If you have anything on your mind, feel free to share it in the comments.

Good Day Good Forums...
 

asdafcsafsas

You can also use RegisterKeyMapping instead of IsControlPressed so you can run the script at 0.00 :D
 
Top