Raised This Month: $ Target: $400
 0% 

DoD Custom Player Models


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 03-18-2011 , 09:12   DoD Custom Player Models
Reply With Quote #1

Compiles fine, but it do not set the player model.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <dodx>

new AUTHOR[] = "Rirre"
new PLUGIN_NAME[] = "DoD Custom Player Models"
new VERSION[] = "0.1b"

#define MODELS 4

new models[MODELS][128] =
{
    
"models/player/test/test.mdl",
    
"models/player/test/testT.mdl",
    
"models/player/coats/coats.mdl",
    
"models/player/coats/coatsT.mdl"
}

new 
models_type[2][32] =
{
    
"test",
    
"coats"
}

new 
body_number[33] = { 0, ...}

public 
plugin_init() 
{
    
// Register this plugin
    
register_plugin(PLUGIN_NAMEVERSIONAUTHOR)
 
    
// Register the Forwards
    
register_forward(FM_PrecacheModel"fw_precache"
    
register_forward(FM_PrecacheSound"fw_precache"
    
register_forward(FM_PrecacheGeneric"fw_precache")
}

public 
plugin_precache()
{
    for(new 
0MODELSx++)
    {
        if(!
file_exists(models[x]))
        {
            
log_amx("File: %s Does not Exist!"models[x])

            return 
PLUGIN_CONTINUE
        
}
    
        
precache_model(models[x])
        
enforce(models[x])
    }

    
precache_model("models/rpgrocket.mdl")
    
    return 
PLUGIN_CONTINUE
}

public 
client_putinserver(id)
{
    if(!
is_user_connected(id))
        
body_number[id] = 12
    
    
return PLUGIN_CONTINUE
}

public 
dod_client_changeteam(idteamoldteam)
{
    if(!
is_user_connected(id))
    {
        if(
team == ALLIES || team == AXIS)
            
dod_set_model(idmodels_type[team-1])
    }
        
    return 
PLUGIN_CONTINUE
}

public 
dod_client_changeclass(id, class, oldclass)
{
    if(!
is_user_connected(id))
    {
        
// Here you can play with some bodys to see the number of them and determine what body for what class
        
dod_set_body_number(idbody_number[id])
    }
        
    return 
PLUGIN_CONTINUE
}

public 
dod_client_spawn(id)
{
    if(!
is_user_connected(id))
    {
        
// Here you can play with some bodys to see the number of them and determine what body for what class
        
dod_set_body_number(idbody_number[id])
    }
        
    return 
PLUGIN_CONTINUE
}

public 
fw_precache(const file[]) 
{
    
enforce(file)
    return 
FMRES_IGNORED
}  

public 
enforce(const file[])
{
    
force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, file)
}

public 
inconsistent_file(id, const filename[], reason[64])
{
    
format(reason63"Delete %s and reconnect to get proper file!"filename)
    return 
PLUGIN_CONTINUE

Rirre is offline
 



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 14:38.


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