Raised This Month: $ Target: $400
 0% 

spr instead of mdl


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SGT
Senior Member
Join Date: Sep 2011
Old 10-01-2011 , 10:50   spr instead of mdl
Reply With Quote #1

This is a winning message plugin. [tested and works, to an extent..] Looks pretty much like this http://prikachi.com/images/27/2982027J.png except it uses a .mdl file. Would it be possible to make it use sprites instead? Or would that require the whole code to be rewritten?

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

#define PLUGIN "Win models"
#define VERSION "1.0"
#define AUTHOR "reinert"

new bool:CT33 ];
new 
bool:T33 ];

new const 
CTwin[ ] = "models/ctwin.mdl";
new const 
Twin[ ] = "models/twin.mdl";

public 
plugin_precache( )
{
    
precache_modelCTwin );
    
precache_modelTwin );
}

public 
plugin_init( )
{
    
register_plugin    PLUGIN VERSION AUTHOR )
    
RegisterHam     Ham_Spawn "player" ,    "PlayerSpawnPost" );
    
register_event     "SendAudio" ,         "CT_win" "a" "2&%!MRAD_ctwin" );
    
register_event     "SendAudio" ,         "T_win" "a" "2&%!MRAD_terwin" );
    
register_event     "CurWeapon" ,        "Cur_Weapon""be" "1=1" );
}

public 
PlayerSpawnPostid )
{
    
CTid ] = false;
    
Tid ] = false;
}

public 
Cur_Weaponid )
{
    if( 
CTid ] )
        
set_pevid pev_viewmodel2 CTwin );
    else if( 
Tid ] )
        
set_pevid pev_viewmodel2 Twin );
}

public 
CT_win( )
{
    new 
Players32 ]
    new 
playerCountiplayer
    get_players
Players playerCount "ch" )
    for ( 
i=playerCount i++ )
    {
        
player Players]
        
set_pevplayerpev_viewmodel2 CTwin )
        
CTplayer ] = true;
    }
}

public 
T_win( )
{
    new 
Players32 ]
    new 
playerCountiplayer
    get_players
Players playerCount "ch" )
    for ( 
i=playerCount i++ )
    {
        
player Players]
        
set_pevplayerpev_viewmodel2 Twin )
        
Tplayer ] = true;
    }
}

public 
client_authorizedid )
{
    
CTid ] = false;
    
Tid ] = false;
}

public 
client_disconnectid )
{
    
CTid ] = false;
    
Tid ] = false;

Edit:

The reason I'd rather use .spr instead of mdl is that the models rotate randomly for some reason. I'm hoping that won't be an issue with sprites.

Last edited by SGT; 10-01-2011 at 10:57.
SGT 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 19:43.


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