How to getobjectpos by model id?
#6

Looping through your objects and finding out if the player is near (within a few meters) of each object is the only way to detect if the player is near any of your phonebooths.
Just like the code you already presented.

As for calculating the time a specific function takes to execute, you could add 2 variables at the start of your function, get the current time in milliseconds and afterwards calculate the difference.
pawn Code:
new StartTime, StopTime, Msg[128];

// Get the current time in milliseconds
StartTime = GetTickCount();

// Your code here to be tested

// Get the current time in milliseconds
StopTime = GetTickCount();

// Inform the admin by printing to the server console
printf("Your function takes %i milliseconds to execute", StopTime - StartTime);
// OR
// Inform the player in-game by sending a client message
format(Msg, sizeof(Msg), "Your function takes %i milliseconds to execute", StopTime - StartTime);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
Reply


Messages In This Thread
How to getobjectpos by model id? - by basicllsw - 12.02.2015, 16:45
Re: How to getobjectpos by model id? - by Pottus - 12.02.2015, 16:59
Re: How to getobjectpos by model id? - by basicllsw - 13.02.2015, 02:39
Re: How to getobjectpos by model id? - by basicllsw - 13.02.2015, 10:48
Re: How to getobjectpos by model id? - by basicllsw - 13.02.2015, 11:22
Re: How to getobjectpos by model id? - by PowerPC603 - 13.02.2015, 11:23
Re: How to getobjectpos by model id? - by Threshold - 13.02.2015, 14:03
Re: How to getobjectpos by model id? - by basicllsw - 14.02.2015, 02:49
Re: How to getobjectpos by model id? - by Threshold - 14.02.2015, 04:00
Re: How to getobjectpos by model id? - by basicllsw - 14.02.2015, 06:16

Forum Jump:


Users browsing this thread: 1 Guest(s)