Raised This Month: $ Target: $400
 0% 

is there a way to make player look like he has m4a1 if he doesn't? =0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-28-2009 , 09:42   is there a way to make player look like he has m4a1 if he doesn't? =0
Reply With Quote #1

Owyn is offline
Send a message via ICQ to Owyn
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-28-2009 , 11:32   Re: is there a way to make player look like he has m4a1 if he doesn't? =0
Reply With Quote #2

This should work, but the way the player will hold the weapon will be appropriately to the actual weapon he is using.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define VERSION "1.0"

new const SZ_PRECACHE[] = "models/p_m4a1.mdl";

new 
g_szAllocedPModel

public plugin_precache()
{
    
precache_model(SZ_PRECACHE);
}

public 
plugin_init()
{    
    
register_clcmd("wpn""Cmd_WpnModelChange");
    
    
g_szAllocedPModel engfunc(EngFunc_AllocStringSZ_PRECACHE);
}

public 
Cmd_WpnModelChange(id)
{
    if(
read_argc() != 2)
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
arg[32];
    
read_argv(1argcharsmax(arg));
    new 
tar cmd_target(idargCMDTARGET_ALLOW_SELF CMDTARGET_ONLY_ALIVE);
    if(!
tar)
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
pModel[22];
    
pev(tarpev_weaponmodel2pModelcharsmax(pModel));
    
    if(!
equal(pModelSZ_PRECACHE))
    {
        
set_pev(tarpev_weaponmodelg_szAllocedPModel);
    }
    
    return 
PLUGIN_HANDLED;

Type in console: wpn <target name>.

I.E: wpn Dores
And see if his gun looks like a M4A1.

Notes: Might cause weird things as invisibility of the weapon from different view angles.
This code is just an example.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 01-28-2009 at 11:35.
Dores 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 01:42.


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