AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   different Knives (https://forums.alliedmods.net/showthread.php?t=164351)

PsychoPach 08-10-2011 10:37

different Knives
 
Hi all
how to make the models that they will have different knives?
And How make Menu for example:

1. BERSERK
2. KRALL
3. CARMINE
4. VOX
5. GIRL
6. BLADE
7. ROBOT



Sorry for my englsh I use translete :/

usaexelent 08-10-2011 10:46

Re: different Knives
 
There is a menu generator on amx studio.

Pur3Biatch 08-10-2011 11:21

Re: different Knives
 
Menu ->
New AMXX Menu System by Emp`

Change knife model ->
PHP Code:

#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Plugin"
#define VERSION "1.0"
#define AUTHOR "Pur3"

new const p_Model[] = "models/p_m134.mdl"  // way to p_model
new const v_Model[] = "models/v_m134.mdl" // way to v_model

new bool:HasBerseker[33] = false

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd"say /Berserk""Berserk")
    
    
register_event("CurWeapon" "cur_weapon" "be" "1=1")
}

public 
Berserk(id)
{
    
//...
    
HasBerseker[id] = true;
    
//...
}

public 
cur_weapon(id)
{
    if(
read_data(2) == CSW_KNIFE)
    {
        if(
HasBerseker[id])
        {
            
set_pev(idpev_viewmodel2v_Model)
            
set_pev(idpev_weaponmodel2p_Model)
        }
    }
    return 
PLUGIN_CONTINUE



PsychoPach 08-10-2011 12:07

Re: different Knives
 
Berserk knive model change, but i need to change krall,vox,girl.... too.

Pur3Biatch 08-10-2011 12:33

Re: different Knives
 
Copy/Paste, but do new variables (new bool:HasKrall[33] = false) and...
PHP Code:

new const p_Krall[] = "models/p_.mdll"  // way to p_model 
new const v_Krall[] = "models/v_.mdl" // way to v_model
//...
public cur_weapon(id

    if(
read_data(2) == CSW_KNIFE
    { 
        if(
HasBerseker[id]) 
        { 
            
set_pev(idpev_viewmodel2v_Model
            
set_pev(idpev_weaponmodel2p_Model
        }
        if(
HasKrall[id]) 
        { 
            
set_pev(idpev_viewmodel2v_Krall
            
set_pev(idpev_weaponmodel2p_Krall
        } 
    } 
    return 
PLUGIN_CONTINUE 


..and..
PHP Code:

public Krall(id)    
{   
  
//...
  
HasKrall[id] = true;
  
//...



usaexelent 08-10-2011 12:41

Re: different Knives
 
new bool:HasKrall[33] = false
Its already by default false :D

Pur3Biatch 08-10-2011 12:45

Re: different Knives
 
It doesn't matter :D

PsychoPach 08-10-2011 13:48

Re: different Knives
 
Very Thanks Pur3Biatch :)

PsychoPach 08-11-2011 11:30

Re: different Knives
 
how to make the individual knives should post their own power?
and how make that they should have their sounds?

Pur3Biatch 08-11-2011 12:01

Re: different Knives
 
Custom Damage ->
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>


public plugin_init() 
{
    
RegisterHam(Ham_TakeDamage"player""player_takedamage")    
}

public 
player_takedamage(victiminflictorattackerFloat:damagedamage_bits)
{
    if(
is_user_alive(attacker))
    {
        if(
get_user_weapon(attacker) == CSW_KNIFE)
        {
            if(
HasBerserk[attacker])
            {        
                
SetHamParamFloat(450//but it's left and right mouse button 
                //when attacking you give 50 damage
                
if(get_pdata_int(victim75) == HIT_HEAD//HeadShot
                
{
                    
SetHamParamFloat(475)
                                                        
// If you attack someone and give head give 75 damage
                
}
            }
        }
    }


And for other sound look at -> this <-


All times are GMT -4. The time now is 03:21.

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