timer stats - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: timer stats (
/showthread.php?tid=613142)
timer stats -
risktaker - 25.07.2016
how do i make message like 'it takes you 80 miliseconds to load your stats'every player spawn?
Re: timer stats -
Dayrion - 25.07.2016
Why 80 miliseconds ?
Under the callback OnPlayerSpawn, add a message "it takes you 80 miliseconds to load your stats" with SendClientMessage and load player's stats.
Re: timer stats -
risktaker - 25.07.2016
uh man,you don't know what i'm talking about
Re: timer stats -
JustMe.77 - 25.07.2016
Well I also don't understand exactly what you need, could you explain more detailed please?
Re: timer stats -
Threshold - 25.07.2016
I'm not sure why you would ever want this... but this is how you would do it.
PHP код:
public OnPlayerSpawn(playerid)
{
new
fstr[50], // This will be used to format the string being sent to the player
LoadTime = GetTickCount() // We will use this variable to store the loading times.
;
// Load user stats here... (I can't imagine why you would do this every time the player spawns... but oh well...
format(fstr, sizeof(fstr), "It took %d milliseconds to load your stats.", GetTickCount() - LoadTime);
SendClientMessage(playerid, -1, fstr);
// Rest of OnPlayerSpawn...
return 1;
}
https://sampwiki.blast.hk/wiki/GetTickCount
Re: timer stats -
Sew_Sumi - 25.07.2016
PHP код:
SendClientMessage(playerid, -1, "It takes you 80 miliseconds to load your stats");
I'm sure if you explained a little more we can make better suggestions.