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

velocity detect


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
I have a plugin that detect velocity when player is jumping. So I want to detecting Player's first jumping velocity and second jumping velocity and third,....
I want to detect if player's first jumping velocity is equal to second or third jumping velocity the player is punish.
Example First jump : 250.000
Second jump : 250.000
In this example this player should be punish. And should be a cvar that I will setting detecting which jump number. When cvar is 5, first jumping 250,second 250, third 250 , fourth 250, fifth 250 and the player will punish. Can you edit this plugin as that style?
HTML Code:


#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>


enum _:PLAYER_DATA
{
        m_JumpPressCount,
        m_Velocity
}
new g_ePlayerInfo[33][PLAYER_DATA]
public plugin_init() {
       
        register_forward(FM_PlayerPreThink, "FM_PlayerPreThink_Pre", false);       
}



public FM_PlayerPreThink_Pre(id)
{
        if(!is_user_alive(id)) return FMRES_IGNORED;
       
        new buttons = pev(id, pev_button);
        new oldbuttons = pev(id, pev_oldbuttons);
       
        if(buttons & IN_JUMP && ~oldbuttons & IN_JUMP)
        {
                g_ePlayerInfo[id][m_JumpPressCount]++;
        }
        if(~buttons & IN_JUMP && oldbuttons & IN_JUMP)
        {       
        }
        new on_ground = bool:(pev(id, pev_flags) & FL_ONGROUND);
       
        if(on_ground)
        {
        if(g_ePlayerInfo[id][m_JumpPressCount] > 0)
                {       
        new Float:velocity[3]; pev(id, pev_velocity, velocity); velocity[2] = 0.0;
        g_ePlayerInfo[id][m_Velocity] = _:vector_length(velocity);
        console_print(id, "velocity [%.3f]", g_ePlayerInfo[id][m_Velocity]);
       
}
}
g_ePlayerInfo[id][m_JumpPressCount] = 0;
return FMRES_IGNORED;
}

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×
×
  • Dodaj nową pozycję...