AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   spr instead of mdl (https://forums.alliedmods.net/showthread.php?t=168601)

SGT 10-01-2011 10:50

spr instead of mdl
 
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.


All times are GMT -4. The time now is 19:43.

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