CSPLague
3 Farklı renkte Işın bıçak plugini - Printable Version

+- CSPLague (https://www.csplague.com)
+-- Forum: CS 1.6 Plugin (Eklenti) Bölümü (https://www.csplague.com/forumdisplay.php?fid=6)
+--- Forum: [İSTEK] Cs 1.6 Plugin İstek Bölümü (https://www.csplague.com/forumdisplay.php?fid=80)
+---- Forum: Çözülmüş İstekler (https://www.csplague.com/forumdisplay.php?fid=87)
+---- Thread: 3 Farklı renkte Işın bıçak plugini (/showthread.php?tid=8239)



3 Farklı renkte Işın bıçak plugini - futtuluk - 04-08-13

Arkadaşlar 3 farklı renkte ışın modelli bıcak plugini olmasını istiyorum.. Model ve sound dosyaları ekte var. Buna göre bıçak pluginini yapmanızı istiyorum.


Eğer bıçak rengi nasıl değişecek diyorsanız : bıçak seçiliyken g ye basarak model değişecek.(yani renk de değişmiş olacak.).


Plugini yapmanızı bekliyorum.. Sevgilerle.
[MENTION=8515]akcaliberkk[/MENTION]


Cevap: 3 Farklı renkte Işın bıçak plugini - akcaliberkk - 04-08-13

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "LightSaber"
#define VERSION "1.0"
#define AUTHOR "akcaliberkk"

new usercolor[33];
new const 
models[][] = {
    
"models/v_light_saber_blu.mdl",
    
"models/p_light_saber_blu.mdl",
    
    
"models/v_light_saber_green.mdl",
    
"models/p_light_saber_green.mdl",
    
    
"models/v_light_saber_red.mdl",
    
"models/p_light_saber_red.mdl"
}
new const 
sounds[][] = {
    
    
"weapons/lightsaber_deploy1.wav",
    
"weapons/lightsaber_hit1.wav",
    
"weapons/lightsaber_hit2.wav",
    
"weapons/lightsaber_hitwall1.wav",
    
"weapons/lightsaber_slash1.wav",
    
"weapons/lightsaber_slash2.wav",
    
"weapons/lightsaber_stab.wav"
    
}
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("drop","ChangeColor")
    
    
register_event("CurWeapon","eCurWeapon","be","1=1")
    
register_forward(FM_EmitSound"fwdEmitSound")
    
}
public 
plugin_precache() {
    for(new 
ii<sizeof(models);i++) precache_model(models[i]);
    
    for(new 
ii<sizeof(sounds);i++) precache_sound(sounds);
}
public 
client_connect(id) {
    
usercolor[id] = 0;
}
public 
ChangeColor(id) {
    if(
get_user_weapon(id) == CSW_KNIFE) {
        
usercolor[id] = ++usercolor[id] % 3
        CheckModel
(id)
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}
public 
eCurWeapon(id) {
    new 
wpnID read_data(2);
    if(
wpnID == CSW_KNIFE) {
        
CheckModel(id)
    }
}
public 
CheckModel(id) {
    switch(
usercolor[id]) {
        case 
0: {
            
set_pev(idpev_viewmodel2models[0])
            
set_pev(idpev_weaponmodel2models[1])
        }
        case 
1: {
            
set_pev(idpev_viewmodel2models[2])
            
set_pev(idpev_weaponmodel2models[3])
        }
        case 
2: {
            
set_pev(idpev_viewmodel2models[4])
            
set_pev(idpev_weaponmodel2models[5])
        }
    }
}
public 
fwdEmitSound(idchannel, const sound[], Float:volumeFloat:attnflagspitch) {
    if(
containi(sound,"knife_deploy1") != -1) {
        
engfunc(EngFunc_EmitSoundidchannelsounds[0], volumeattnflagspitch)
        return 
FMRES_SUPERCEDE
    
}
    else if(
containi(sound,"knife_hit") != -1) {
        if(
containi(sound"hitwall") != -1) {
            
engfunc(EngFunc_EmitSoundidchannelsounds[3], volumeattnflagspitch)
        }
        else 
engfunc(EngFunc_EmitSoundidchannelsounds[random_num(1,2)], volumeattnflagspitch)
        return 
FMRES_SUPERCEDE
    
}
    else if(
containi(sound,"knife_slash") != -1) {
        
engfunc(EngFunc_EmitSoundidchannelsounds[random_num(4,5)], volumeattnflagspitch)
        return 
FMRES_SUPERCEDE
    
}
    else if(
containi(sound,"knife_stab") != -1) {
        
engfunc(EngFunc_EmitSoundidchannelsounds[6], volumeattnflagspitch)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

[/i][/i]


Cevap: 3 Farklı renkte Işın bıçak plugini - akcaliberkk - 14-08-13

Çözülmüş İsteklere taşındı.