SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 28/02/2018, 10:21 AM   #1
Big Clucker
Join Date: Nov 2017
Posts: 138
Reputation: 20
Default Profiler result's -Optimization mode

I want to optimize my gamemode and I need some help.I'm put profiler plugin on my server from 01:00 to 11:23 today,so i'm get results.

So there are picture who don't want to download:

So if you can tell me what i need to opimize,because i'm not sure what i need to look on this profiler results.For example i don't understand this:

operator>=(Float:,Float 1515576 6.83%
operator>(Float:,Float 1281151 3.33%

Is this much?
floatcmp 13220491 3.75%
I use floatcmp just in one line in my mode.For afk check

Short code:

function AFKCheck(playerid)
	GetPlayerPos(playerid, PlayerCurrentPos[playerid][0], PlayerCurrentPos[playerid][1], PlayerCurrentPos[playerid][2]);
	if(!floatcmp(PlayerCurrentPos[playerid][0], PlayerLastPos[playerid][LastX]) && !floatcmp(PlayerCurrentPos[playerid][1], PlayerLastPos[playerid][LastY]))
		PovecajPVarInt(playerid, "PlayerAFK", 1);
		SetPVarInt(playerid, "PlayerAFK", 0);
   		AFK[playerid] = false;
	PlayerLastPos[playerid][LastX] = PlayerCurrentPos[playerid][0];
	PlayerLastPos[playerid][LastY] = PlayerCurrentPos[playerid][1];
	PlayerLastPos[playerid][LastZ] = PlayerCurrentPos[playerid][2];

	if(GetPVarInt(playerid, "PlayerAFK") >= 20)
          //kick(afk 20 minute)
       return 1;

GetSpeed 790181 8.17%
This function I use in OnPlayerUpdate( if(GetSpeed > 299) kick

    new Float:ST[4];
    else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 178.8617875;
    return floatround(ST[3]);
I'm upload full .html file in attachmens.Thank you
Attached Files
File Type: rar v58.rar (15.3 KB, 12 views)
GospodinX is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Profiler StrikerZ Scripting Help 6 08/01/2017 03:16 PM
[Profiler result] Gamemode is generating lags Amads Scripting Help 4 14/08/2016 02:21 PM
RAM profiler Tamer Discussion 8 06/10/2015 07:23 PM
[HELP] Profiler monster010 Scripting Help 3 26/06/2014 09:41 PM
[Include] - plugin-less profiler Zeex_ Includes 6 04/02/2012 06:16 AM

All times are GMT. The time now is 02:08 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.