Raised This Month: $ Target: $400
 0% 

Buttons and OldButtons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 11-18-2013 , 08:12   Buttons and OldButtons
Reply With Quote #1

I am currently working at naruto mod and i need to know if iam doing this correctly:
PHP Code:
public PlayerPreThink(id)
{
    new 
button pev(idpev_button)
    new 
oldbuttons pev(idpev_oldbuttons)
    
    if(
buttons IN_ATTACK2 && !(oldbuttons IN_ATTACK2)) // Press One Time In Attack2, start using chakra
    
{
        
Attack_With_Chakra[id] = true
        set_task
(3.0"remove_attack_with_chakra"id)
    }
    
    if(
buttons IN_ATTACK && !(oldbuttons IN_ATTACK)) // Press One Time Attack and if using chakra, send the kunai
    
{
        if(
Attack_With_Chakra[id])
            
pull_kunai(id)
    }
    
    if(
buttons IN_USE && oldbuttons IN_USE// Reload Chakra
    
{
        if(
Chakra[id] < Max_Chakra[id])
            
Chakra[id]++
        
        else
            
client_print(idprint_center"You Reached Max Chakra!")
    }
    
    return 
FMRES_IGNORED
}

public 
remove_attack_with_chakra(id)
{
    
Attack_With_Chakra[id] = false

Also i need to know if player is moving or not for reload chakra and i need to detect if is using chackra (Attack_With_Chakra[id]) and moving at same time (For make player faster)
__________________
Jhob94 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:14.


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