Raised This Month: $ Target: $400
 0% 

Weapon with grenade launcher.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ratosluaf
New Member
Join Date: Sep 2011
Old 01-31-2013 , 03:28   Weapon with grenade launcher.
Reply With Quote #1

I've just got smth like this:
Code:
public PlayerPreThink(id)
{
    if(!is_user_alive(id) || !ma_klase[id])
        return FMRES_IGNORED 
    
    if((pev(id, pev_button) & IN_ATTACK2 && !(pev(id, pev_oldbuttons) & IN_ATTACK2)) && get_user_weapon(id) == CSW_GALIL) {
        if(ma_granatnik[id] == true) {
            set_task(1.0,"wylaczGranatnik", id+TASK_WYLACZGRANATNIK);
            UTIL_PlayWeaponAnimation(id, 11);
        }
        else if(ma_granatnik[id] == false) {
            set_task(1.0,"wlaczGranatnik", id+TASK_WLACZGRANATNIK);
            UTIL_PlayWeaponAnimation(id, 5);
        }
    }
    
    if(ma_granatnik[id] == true) {
        if((pev(id, pev_button) & IN_ATTACK && !(pev(id, pev_oldbuttons) & IN_ATTACK)) && get_user_weapon(id) == CSW_GALIL)
        {
            Stworz(id)
        }
    }
    
    return FMRES_IGNORED;
}
public wlaczGranatnik(id) {
    ma_granatnik[id] = true;
}
public wylaczGranatnik(id) {
    ma_granatnik[id] = false;
}
The code doesn't work. I just wanna to switch between weapon and grenade launcher with attack2 button. When click attack1 on grenade launcher, it does function "Stworz(id)".
Can anyone help me?

============
How can I easily get the animations ID? In .qc file there's nothing, only list.

Last edited by ratosluaf; 01-31-2013 at 03:29.
ratosluaf 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 20:30.


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