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, 11:21 AM   #1
GospodinX
Big Clucker
 
Join Date: Nov 2017
Posts: 124
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:
https://i.imgur.com/dYcv4Fd.png

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:

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

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

Short code:

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);
	}
	else
	{
		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;
}

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

Code:
GetSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    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, 10 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 04:16 PM
[Profiler result] Gamemode is generating lags Amads Scripting Help 4 14/08/2016 03:21 PM
RAM profiler Tamer Discussion 8 06/10/2015 08:23 PM
[HELP] Profiler monster010 Scripting Help 3 26/06/2014 10:41 PM
[Include] profiler.inc - plugin-less profiler Zeex_ Includes 7 04/02/2012 07:16 AM


All times are GMT. The time now is 06:51 PM.


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