AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Model (https://forums.alliedmods.net/showthread.php?t=160096)

2reason2kill 06-25-2011 03:58

[Help] Model
 
PHP Code:

#include <amxmodx>
#include <fakemeta>

new bool:g_bCustomSkin33 ]; // Holder for whether player gets a custom model or not

new g_szViewModel[ ] = ""// View model location
new g_szWeaponModel[ ] = ""// Weapon model location


public plugin_precache()
{
    
precache_modelg_szViewModel );
    
precache_modelg_szWeaponModel );
}

public 
plugin_init()
{
    
register_event"CurWeapon""Event_CurWeapon""be""1=1" ); // Register curweapon

    
register_clcmd"say /randomknife""CmdKnife" );
}


public 
Event_CurWeaponid )
{
    if( !
is_user_aliveid ) || !g_bCustomSkinid ] ) // If they aren't alive or they don't have a custom skin return
        
return PLUGIN_CONTINUE;
    
    if( 
get_user_weaponid ) == CSW_KNIFE // If weapon is a knife
    
{
        
set_pevidpev_viewmodel2g_szViewModel ); // set models
        
set_pevidpev_weaponmodel2g_szWeaponModel ); // set models
    
}
}

public 
CmdKnifeid )
{
    if( !( 
get_user_flagsid ) & ADMIN_BAN // If they don't have BAN flag return
        
return PLUGIN_HANDLED;
    
    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNum );
    
    new 
iRand randomiNum ); // Get random player
    
    
g_bCustomSkiniPlayersiNum ] ] = true// Set the array index to true


How Can I Make So If player have ak47 and the other weapon?


Do I make Switch Case Or Else?

FoxueR 06-26-2011 17:36

Re: [Help] Model
 
PHP Code:

switch ( get_user_weaponid ) ) 
{
    case 
CSW_KNIFECSW_AK47:
    {
        
// do your stuff 
    
}




All times are GMT -4. The time now is 23:29.

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