samp.directory
← Skripte und Bibliotheken

Ghecco/SAMP-stamina

This simple include allows you to create and manage a stamina system for SA-MP Server.

Bibliothek★ 8aktualisiert Sept. 2022Keine LizenzPawnsampctl
Auf GitHub öffnen

Dieses Repository hat keine Lizenzdatei. Es ist öffentlich lesbar, aber das allein gibt noch keine Erlaubnis, es weiterzuverwenden.

Mit sampctl installieren

sampctl package install Ghecco/SAMP-stamina

Führe das in deinem Projektordner aus. sampctl lädt das Paket und alles herunter, wovon es abhängt.

Im Pawn-Compiler ausprobieren →

Fügt seine Include-Dateien samt der Bibliotheken, von denen es abhängt, dem Pawn-Compiler in deinem Browser hinzu, bereit zum Einbinden in ein Skript.

Hängt von 1 Paket ab

README.md

[Include] SAMP_stamina

This simple include allows you to create and manage a stamina system.

How does it work?

This includes allows you to quickly create a stamina system. (endurance in the sprint)

  1. Player's max stamina. - Maximum achievable stamina level. ( Integar )

  2. Player's current stamina. - Current stamina level. ( Integar )

  3. Exhausted. - Value assigned when the player performs the recovery animation.

  4. Sprint Velocity - You can set a speed per player. ( Float ) (in progress)

Callbacks & Functions

New Callback: public OnPlayerStaminaOver(playerid)

New Functions:


    IsPlayerRunning(playerid); // Check if the player is running.
    IsPlayerExhausted(playerid); // Check if the player is exhausted.
    SetPlayerExhausted(playerid, bool:Exhausted) // Set the exhausted player (if is true the player will do the tired anim).
    
    GetPlayerStamina(playerid)	// Get the player's current stamina.
    GivePlayerStamina(playerid, value) // Add / Subtract the player's current stamina.
    SetPlayerStamina(playerid, value) // Set the player's current stamina.	 
    
    GetPlayerMaxStamina(playerid) // Get the player's maximum stamina.
    GivePlayerMaxStamina(playerid, Float:value) // Add / Subtract the player's maximum stamina.
    SetPlayerMaxStamina(playerid, Float:value) // Set the player's maximum stamina.
    
    GivePlayerSprintVelocity(playerid, Float:value) // Multiply / divide the player's sprint speed (exceeded (2.0) you will get a bad result).
    GetPlayerSprintVelocity(playerid) // Get the player's sprint velocity. 

New Define:

#define STAMINA_DEFAULT_RECOVERYTIME		(5000) // Time in milliseconds of tired anim (Exhausted).

Installing

  • Download stamina.inc.
  • Move it in your SA-MP Server Folder --> pawno/include.
  • Include in your gamemode #include <stamina>.

If you use sampctl: sampctl package install Ghecco/SAMP_stamina

Simple Example

includesa-mpstamina

Diese Seite wird aus dem erstellt, was GitHub über das Repository veröffentlicht. samp.directory hostet den Code nicht. Ein Problem mit diesem Eintrag melden