AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Repeat function, through verification (https://forums.alliedmods.net/showthread.php?t=318337)

unrealgame 08-25-2019 09:04

Repeat function, through verification
 
Hi, not how can not understand how to do.
what I need


Thank you in advance

LearninG 08-25-2019 10:26

Re: Repeat function, through verification
 
Hi

PHP Code:

#include <engine>


#define    FL_ONGROUND    (1<<9)


if(get_entity_flags(id) & FL_ONGROUND)
{
    
//client is ON ground
}
else
{
    
//client is NOT on ground



unrealgame 08-25-2019 13:26

Re: Repeat function, through verification
 
Quote:

Originally Posted by LearninG (Post 2664667)
Hi

Spoiler

poorly explained, it is necessary to replace the account function, with whether the player was on the ground before touching the head, simply if you simply remove the timer, the function will loop.

LearninG 08-25-2019 14:34

Re: Repeat function, through verification
 
Quote:

Originally Posted by unrealgame (Post 2664694)
poorly explained, it is necessary to replace the account function, with whether the player was on the ground before touching the head, simply if you simply remove the timer, the function will loop.

I don't understand what you mean !

Natsheh 08-25-2019 14:35

Re: Repeat function, through verification
 
PHP Code:


#include <amxmodx>
#include <engine>
#include <cstrike>

#define PLUGIN "-"
#define VERSION "1.0"
#define AUTHOR "-"

#pragma semicolon 1

new Floatg_flLastHeadTouch[33], g_pDelayg_pDamage;

new const 
g_pHeadTouch0[] = "misc/risamalo.wav";


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
g_pDelay register_cvar("headtouch_delay""1.0");
    
g_pDamage register_cvar("headtouch_damage""0.0");
    
register_touch("player""*""PlayerTouches");
}

public 
PlayerTouches(iToucheriTouched)
{
        static 
pLastTouch[33] = {0, ...};
        
        if(!
is_user_alive(entity_get_edict(iToucherEV_ENT_groundentity))) { pLastTouch[iToucher] = iTouched; return; }

        if(
entity_get_edict(iToucherEV_ENT_groundentity) == iTouched ) {
                static 
FloatflGametime;
                
flGametime get_gametime();
        
                if( !(
<= pLastTouch[iToucher] <= 32)) {
                
// your code for touching player head when last stand was on ground(worldspawn,  brush entity, other non player entitys) 
                
}

                if(
flGametime g_flLastHeadTouch[iToucher] && cs_get_user_team(iToucher) == CS_TEAM_T && cs_get_user_team(iTouched) == CS_TEAM_CT) {
                   new 
szAttackerName[64],
                     
szTouchedName[64];
            
                   
get_user_name(iToucherszAttackerNamecharsmax(szAttackerName));
                   
get_user_name(iTouchedszTouchedNamecharsmax(szTouchedName));
                   
fakedamage(iTouchedszAttackerNameget_pcvar_float(g_pDamage), DMG_CRUSH);
            
                   
set_hudmessage(25585255, -1.00.2006.012.0);
                   
show_hudmessage(0"[TEST] %s hahaha %s !"szAttackerNameszTouchedName);
            
                   
g_flLastHeadTouch[iToucher] = flGametime get_pcvar_float(g_pDelay);
            
                   
emit_sound(0CHAN_STREAMg_pHeadTouch00.7ATTN_NORM0PITCH_NORM);
                   
client_cmd(0"spk %s"g_pHeadTouch0); 
            
                }
                
pLastTouch[iToucher] = iTouched
        }


PS : IF YOUR ENGLISH IS SO BAD WHY DON'T You ASK FOR SUPPORT ON RUSSIAN FORUMS.


All times are GMT -4. The time now is 17:29.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.