AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Gun + knife models (https://forums.alliedmods.net/showthread.php?t=26879)

Kensai 04-10-2006 15:34

Gun + knife models
 
I was wondering how to set custom models and skins for guns.

I did this for my knife model and it worked

Code:
new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])     if(weapon == CSW_KNIFE)     {         entity_set_string(id, EV_SZ_viewmodel, "models/v_knife_finger.mdl")         entity_set_string(id, EV_SZ_weaponmodel, "models/p_knife_finger.mdl")     }

So I was wondering how to do the same thing for a gun? I tried using the knife code, but no luck.

Hawk552 04-10-2006 16:37

Same thing, except CSW_M4A1 or whatever it is you're trying to do.

Buddy 04-10-2006 17:33

hy....

how can i turn it [ON] [OFF] in the Map.cfg or Server.cfg, Amx.cfg

I used the Code from ---> Golden Colts

http://forums.alliedmods.net/showthread.php?p=132765

(I am from Germany and my english are very bad)

Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <cstrike>

new g_lastweap[33]

public plugin_init()
{
          register_plugin("amx_Dragon_knife1", AMXX_VERSION_STR, "[MUDDA]Middy")
          register_event("CurWeapon","handle_gun","be","1=1")
          register_forward(FM_TraceLine,"fw_traceline",1);
}

public handle_gun(id)
{
          new clip, ammo
        new weap = get_user_weapon(id,clip,ammo)

          if(clip > 16 && weap == CSW_KNIFE)
          {
                new iWPNidx = -1,wpn[32]
                get_weaponname(weap,wpn,31)
                while ((iWPNidx = find_ent_by_class(iWPNidx, wpn)) != 0)
                {
                        if (id == entity_get_edict(iWPNidx, EV_ENT_owner))
                        {
                                cs_set_weapon_ammo(iWPNidx,16)
                        }
                }
        }

          if(weap == CSW_KNIFE && g_lastweap[id] != weap)
          {
                entity_set_string(id, EV_SZ_viewmodel, "models/v_Dragon_knife1.mdl")
        }
}


public plugin_precache()
{
          precache_model("models/v_Dragon_knife1.mdl")
}

public plugin_modules()
{
        require_module("FakeMeta");
        require_module("Engine");
        require_module("Cstrike");
}

public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id)
{
        if(!is_user_connected(id) || !is_user_alive(id))
        {
                return FMRES_IGNORED;
        }

        new victim = get_tr(TR_pHit);

        if(!is_user_connected(victim) || !is_user_alive(victim))
        {
                return FMRES_IGNORED;
        }

        new clip, ammo, weapon = get_user_weapon(id,clip,ammo);

        if(weapon != CSW_KNIFE || clip <= 0)
        {
                return FMRES_IGNORED;
        }

        new hitplace = get_tr(TR_iHitgroup);

        if(hitplace == HIT_LEFTARM)
        {
                set_tr(TR_iHitgroup,random_num(HIT_STOMACH,HIT_CHEST)); // redirect it an arm
        }
        else if(hitplace == HIT_RIGHTARM)
        {
                set_tr(TR_iHitgroup,random_num(HIT_STOMACH,HIT_CHEST)); // redirect to a leg
        }
        else if(hitplace == HIT_RIGHTLEG)
        {
                set_tr(TR_iHitgroup,random_num(HIT_STOMACH,HIT_CHEST)); // redirect to a leg
        }
        else if(hitplace == HIT_LEFTLEG)
        {
                set_tr(TR_iHitgroup,random_num(HIT_STOMACH,HIT_CHEST)); // redirect to a leg
        }
       
        return FMRES_IGNORED;       
}


Jordan 04-10-2006 22:06

http://ghw-amxx.com/viewtopic.php?t=18
http://ghw-amxx.com/viewtopic.php?t=86

Buddy 04-10-2006 22:30

Hy..

thanks for help..

but the plugin is great.. it works

we have a other problem..

we want use a spezial old Deagl Model,
onely at one Map in the cycle--->de_westwood(western Map)

ore

we want to use a big mario hammer model for knife
at fun_mariodust

this forum are sooo great.... we love that
like Drugs.......
ther are the crazyest things for cs...
thanks too alll upers !!!! and admins from the forum

mfg Buddy and MichL

P.s. sorry my english are sooo bad....
but thanks forward

AAleaderNik 04-10-2006 22:34

im guessing then you would want to add those models in precache then you need a cvar that you can turn on mario hammer model and you need a cvar for your gun model so you can turn it off on westwood

Buddy 04-10-2006 22:37

hy..

thanks...

We know but we dont know what we had to write in
the .sma

you understand ????

mfg BUDDY MichL

AAleaderNik 04-10-2006 22:42

o i dont know scripting that well either i was just tellin ya what you would need to do if u wanted that hoping that you would know how to do those things :) lol

[ --<-@ ] Black Rose 04-10-2006 22:44

something like this in precache
Code:
    new mapname[64];     get_mapname(mapname, 63);     if ( equali(mapname, "de_westwood") )         precache_model("spezial old Deagl Model")     else if equali(mapname, "fun_mariodust")         precache_model("big mario hammer model")
also add something like this on CurWeapon
Code:
new mapname[64];     get_mapname(mapname, 63); if ( weap == CSW_KNIFE && equali(mapname, "fun_mariodust")

Buddy 04-10-2006 22:51

Hey

Your are all sooo great !!!

we get a post in german

Code:
amxx unpause Pluginname
amxx pause pluginname


at the and z.b. aim_map.cfg

Thanks too all !!!!

But we cam back and post selfmade Plugins


All times are GMT -4. The time now is 16:33.

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