Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

[ANY] Bunnyhop Statistics (v1.0.0 09/August/2016)


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
GitHub Repository

bhopstats.svg?branch=master

Bunnyhop Statistics
Bunnyhop Statistics is an API made in SourcePawn for developers that provides bhop related statistics.
Made with hope it will be used for the creation of high quality, open sourced anti-cheats or bhop server utilities for Source Engine games.
Note: Not tested with autobhop plugins at all, use at your own risk!

Download
Either download the attached .zip or from the GitHub releases page.

Requirements:
Forwards
Code:

// Called when the jump key is pressed.
// The variable `onground` will be true if the jump key will do anything for the player when tapped.
forward void Bunnyhop_OnJumpPressed(int client, bool onground);

// Called when the jump key is released.
// The variable `onground` will be true if the jump key will do anything for the player when tapped.
forward void Bunnyhop_OnJumpReleased(int client, bool onground);

// Called when the player touches the ground.
forward void Bunnyhop_OnTouchGround(int client);

// Called when the player leaves the ground, by either jumping or falling from somewhere.
// AKA the HookEventless better version of player_jump.
// The `jumped` variable is true if the ground was left by tapping the jump key, or false if the player fell from somewhere.
// `ladder` is true if the player left the 'ground' from a ladder.
forward void Bunnyhop_OnLeaveGround(int client, bool jumped, bool ladder);

Natives: (Methodmap equivalents are also available)
Code:

// Amount of separate +jump inputs since the player left the ground.
// The result will be 0 if the player is on ground.
native int Bunnyhop_GetScrollCount(int client);

// Is the player on ground?
// The result will be true if the player is on a ladder or in water, as jumping will be functional.
native bool Bunnyhop_IsOnGround(int client);

// Is the player holding the jump key?
native bool Bunnyhop_IsHoldingJump(int client);

// Gets a percentage of perfectly timed bunnyhops.
// Resets at player connection or the Bunnyhop_ResetPerfectJumps native for it is called.
// Results are from 0.0 to 100.0.
native float Bunnyhop_GetPerfectJumps(int client);

// Resets the perfect jumps percentage of a player back to 0.0.
native void Bunnyhop_ResetPerfectJumps(int client);

Methodmaps usage:
Code:

// Class-like
BunnyhopStats stats = new BunnyhopStats(client);
PrintToServer("Scroll count: %d\nOn ground? %s\nHolding jump key? %s", stats.ScrollCount, (stats.OnGround)? "Yes":"No", (stats.HoldingJump)? "Yes":"No");

// Static
PrintToServer("Scroll count: %d\nOn ground? %s\nHolding jump key? %s", BunnyhopStats.GetScrollCount(client), (BunnyhopStats.IsOnGround(client))? "Yes":"No", (BunnyhopStats.IsHoldingJump(client))? "Yes":"No");

Report issues here.
Contribute by sending a pull request here.

Attached Files
File Type: sp Get Plugin or Get Source (bhopstats.sp - 5.3 KB)
File Type: inc bhopstats.inc (5.3 KB)
File Type: zip bhopstats-1.0.0.zip (23.4 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...