Raised This Month: $51 Target: $400
 12% 

Request standart Counter Strike 1.6 weapons source code for Weaponmod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Foghrye4
Junior Member
Join Date: Dec 2010
Old 12-18-2010 , 19:32   Request standart Counter Strike 1.6 weapons source code for Weaponmod
Reply With Quote #1

I don't want to do same work twice, if it was already done. I need code for all standart Counter-Strike 1.6 weapons, with using WeaponMod plugin. I need it for changing they characteristics "on a fly" in amxx plugins. There is a sample code for "Avtomat Kalashnikova obraztsa 1947 goda" or AK47:
Code:
#include <amxmodx>
#include <fakemeta>
#include <weaponmod>

new wpnid=0, rndnum;

new v_mdl[]="models/v_ak47.mdl";
new p_mdl[]="models/p_ak47.mdl";
new w_mdl[]="models/w_ak47.mdl";

new fire1_snd[]="weapons/ak47-1.wav";
new fire2_snd[]="weapons/ak47-2.wav";
new boltpull_snd[]="ak47_boltpull.wav";
new clipin_snd[]="ak47_clipin.wav";
new clipout_snd[]="ak47_clipout.wav";

enum
{
    anim_idle1,
    anim_reload,
    anim_draw,
    anim_shoot1,
    anim_shoot2,
    anim_shoot3,
}


public plugin_precache(){
precache_model(v_mdl);
precache_model(p_mdl);
precache_model(w_mdl);
precache_sound(fire1_snd);
precache_sound(fire2_snd);
precache_sound(boltpull_snd);
precache_sound(clipin_snd);
precache_sound(clipout_snd);
}


public plugin_init(){
register_plugin("Avtomat Kalashnikova obraztsa 1947 goda", "0.1", "Foghrye4");
wpnid = wpn_register_weapon("Avtomat Kalashnikova obr. 1947", "ak47");
wpn_set_string(wpnid, wpn_viewmodel, v_mdl);
wpn_set_string(wpnid, wpn_weaponmodel, p_mdl);
wpn_set_string(wpnid, wpn_worldmodel, w_mdl);
wpn_set_string(wpnid, wpn_worldmodel, w_mdl);
wpn_set_float(wpnid, wpn_run_speed, 240.0);    // Running speed (bringed from examle)
wpn_set_integer(wpnid, wpn_ammo1, 30);        // Primary Ammo
wpn_set_integer(wpnid, wpn_ammo2, 120);    // Secondary Ammo
wpn_set_integer(wpnid, wpn_cost, 3000);    // Cost of this weapon (bringed from examle)
wpn_set_float(wpnid, wpn_refire_rate1, 0.1);
wpn_set_integer(wpnid, wpn_bullets_per_shot1, 1);
wpn_set_float(wpnid, wpn_recoil1, 7.0);
wpn_set_float(wpnid, wpn_reload_time, 1.0);

wpn_register_event(wpnid, event_attack1, "ev_attack1");
wpn_register_event(wpnid, event_draw, "ev_draw");
wpn_register_event(wpnid, event_reload, "ev_reload");
wpn_register_event(wpnid, event_hide, "ev_hide");
}

public ev_attack1(id)
{
wpn_bullet_shot(wpnid, id, 10, random_num(30, 40));
rndnum=random_num(1,3);
switch(rndnum){
case 1:
    {
    wpn_playanim(id, anim_shoot1);
    }
case 2:
    {
    wpn_playanim(id, anim_shoot2);
    }
case 3:
    {
    wpn_playanim(id, anim_shoot3);
    }
default:
    {
    wpn_playanim(id, anim_shoot1);        
    }
}
rndnum=random_num(1,2);
switch(rndnum){
case 1:
    {
emit_sound(id, CHAN_WEAPON, fire1_snd, 1.0, ATTN_NORM, 0, PITCH_NORM);
    }
case 2:
    {
emit_sound(id, CHAN_WEAPON, fire2_snd, 1.0, ATTN_NORM, 0, PITCH_NORM);
    }
default:
    {
emit_sound(id, CHAN_WEAPON, fire2_snd, 1.0, ATTN_NORM, 0, PITCH_NORM);
    }
}
}

public ev_draw(id)
{
wpn_playanim(id, anim_draw);
}

public ev_reload(id)
{
wpn_playanim(id, anim_reload);
emit_sound(id, CHAN_WEAPON, clipin_snd, 1.0, ATTN_NORM, 0, PITCH_NORM);
}

public ev_hide(id)
{
wpn_playanim(id, anim_draw);
}
Offtopic: Hate grammar! All right with my english?
__________________
|卍|///A山E己ロME・ロ丁AK凵///|卍|
Foghrye4 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-18-2010 , 22:52   Re: Request standart Counter Strike 1.6 weapons source code for Weaponmod
Reply With Quote #2

Quote:
Originally Posted by Foghrye4 View Post
All right with my english?
No. I have no clue what you are asking.
__________________
fysiks is offline
Foghrye4
Junior Member
Join Date: Dec 2010
Old 12-19-2010 , 07:32   Re: Request standart Counter Strike 1.6 weapons source code for Weaponmod
Reply With Quote #3

OK, try one more time. There is a normal weapons in cs 1.6. Such as AWP, Desert Eagle and other. And. There is a some new weapons, created by scripting with Weaponmod plugin. (before that all understandable?)
Problem with normal weapons is that you can't change their characteriscics easy way. But for Weaponmod weapons - you do. I need code, like in a sample code i post, for all normal cs 1.6 weapons.
Now understandable?
__________________
|卍|///A山E己ロME・ロ丁AK凵///|卍|
Foghrye4 is offline
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 12-19-2010 , 07:36   Re: Request standart Counter Strike 1.6 weapons source code for Weaponmod
Reply With Quote #4

He wants a plugin to change all weapons characteristics with .ini file maybe Am i right?

Last edited by dj_freeze; 12-19-2010 at 07:46.
dj_freeze is offline
Send a message via Skype™ to dj_freeze
Foghrye4
Junior Member
Join Date: Dec 2010
Old 12-19-2010 , 07:45   Re: Request standart Counter Strike 1.6 weapons source code for Weaponmod
Reply With Quote #5

*facepalm*
One more post and start knocking in a wall with my head.
Just look in a sample code!
I want same, but for awp, famas, deserteagle and other!
What's wrong with my english?!
__________________
|卍|///A山E己ロME・ロ丁AK凵///|卍|
Foghrye4 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 02:55.


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