AlliedModders

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

Merc3y 12-26-2009 04:05

Model Problem
 
Why it doesn't work ?


PHP Code:

/*================================================================================
 
    -----------------------------------
    -*- [ZP] Zombie Class : Mystique Zombie -*-
    -----------------------------------
 
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
 
    Press "v" to disguise as a human being.
 
================================================================================*/
#include <amxmodx>
#include <cstrike>
#include <zombieplague>
 
new g_zclass_mzombieBindMaxPlayers
new HasDisguise33 ] = 0
 
new const zclass_name[] = { "Mystique Zombie" }
new const 
zclass_info[] = { "Disguise" }
new const 
zclass_model[] = { "zombie_source" }
new const 
zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const 
zclass_health 1700
const zclass_speed 270
const Float:zclass_gravity 0.9
const Float:zclass_knockback 1.0
 
public plugin_init( )
{
        
register_plugin"[ZP] Zombie Class : Mystique Zombie""1.0""Merc3y" )
        
register_logevent"roundStart"2"1=Round_Start" )
        
register_clcmd"+disguise""disguise_start"ADMIN_ALL"bind [key] +disguise" )
        
Bind register_cvar"zp_mzombie_bindkey""1" )
        
MaxPlayers get_maxplayers( )
}
 
public 
plugin_precache( )
{
        
g_zclass_mzombie zp_register_zombie_classzclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback )
 
        
precache_model"models/player/sas/sas.mdl" )
        
precache_model"models/player/arctic/arctic.mdl" )
        
precache_model"models/player/gign/gign.mdl" )
        
precache_model"models/player/gsg9/gsg9.mdl" )
        
precache_model"models/player/guerilla/guerilla.mdl" )
        
precache_model"models/player/leet/leet.mdl" )
        
precache_model"models/player/terror/terror.mdl" )
        
precache_model"models/player/urban/urban.mdl" )
}
 
public 
zp_user_infected_postidinfector )
{
         if ( 
zp_get_user_zombie_classid ) == g_zclass_mzombie )
         {
                   
HasDisguiseid ] = 0
                   
new mode get_pcvar_numBind )
 
                   if ( 
mode == )
                   {
                        
client_cmdid"bind v ^"+disguise^"" )
                        
chat_printid"To disguise press ^'^'V^'^'" )
                   }
 
                   if ( 
mode == 
                   {
                        
chat_printid"To disguise type bind <key> +disguise" )
                   }
         }
}
 
public 
disguise_startid 
{
        if ( 
zp_get_user_zombieid ) && zp_get_user_zombie_classid ) == g_zclass_mzombie && !zp_get_user_nemesisid ) )
        {
                if ( !
is_user_aliveid ) )
                {
                      
chat_printid"You can't disguise when you are are dead." )
                      return
                }
 
                else
                {
                      
Disguiseid )
                      
HasDisguiseid ] = 1
                
}
        }
}
 
public 
Disguiseid )
{
          if ( 
zp_get_user_zombieid ) && zp_get_user_zombie_classid ) == g_zclass_mzombie && !zp_get_user_nemesisid ) )
          {
                 switch ( 
random_num1) )
                 {
                       case 
1:
                       {
                             
cs_set_user_modelid"models/player/sas/sas.mdl" )
                       }
 
                       case 
2:
                       {
                             
cs_set_user_modelid"models/player/arctic/arctic.mdl" )
                       } 

                       case 
3:
                       {
                             
cs_set_user_modelid"models/player/gign/gign.mdl" )
                       } 

                       case 
4:
                       {
                             
cs_set_user_modelid"models/player/gsg9/gsg9.mdl" )
                       }

                       case 
5:
                       {
                             
cs_set_user_modelid"models/player/guerilla/guerilla.mdl" )
                       }
 
                       case 
6:
                       {
                             
cs_set_user_modelid"models/player/leet/leet.mdl" )
                       } 

                       case 
7:
                       {
                             
cs_set_user_modelid"models/player/terror/terror.mdl" )
                       } 

                       case 
8:
                       {
                             
cs_set_user_modelid"models/player/urban/urban.mdl" )
                       } 
                 }
          }

 
public 
roundStart( )
{
      for ( new 
1<= MaxPlayersi++ )
      {
                
HasDisguise] = 0
      
}
}
 
stock chat_printplr, const message[ ], { FloatSqlResult}:... )
{
    static 
msg192 ], saytextmaxplayers;
    
formatmsg191"^x04[ZP]^x01 " );
    
vformatmsg], 185message);
 
    if ( !
saytext )
    {
        
saytext get_user_msgid"SayText" );
    }
 
    if ( !
maxplayers )
    {
        
maxplayers get_maxplayers( );
    }
    if ( 
plr <= maxplayers && plr )
    {
        
message_beginMSG_ONE_UNRELIABLEsaytext, { 00}, plr );
        
write_byteplr );
        
write_stringmsg );
        
message_end( );
    }
    else if ( !
plr )
    {
        for( new 
1<= maxplayersi++ )
        {
            if ( !
is_user_connected) )
            {
                continue;
            }
 
            
message_beginMSG_ONE_UNRELIABLEsaytext, { 00}, );
            
write_byte);
            
write_stringmsg );
            
message_end( );
        }
    }
 
    return 
1;



ProIcons 12-26-2009 04:12

Re: Model Problem
 
any error log in console?

xPaw 12-26-2009 06:02

Re: Model Problem
 
cs_set_user_model( id, "sas" )
without model path

Merc3y 12-26-2009 07:45

Re: Model Problem
 
Quote:

Originally Posted by ProIcons (Post 1031581)
any error log in console?

unknown command: +disguise
unknown command: -disguise

Quote:

Originally Posted by xPaw (Post 1031649)
cs_set_user_model( id, "sas" )
without model path

Doesn't work. The model still same.

Arkshine 12-26-2009 12:40

Re: Model Problem
 
Quote:

Originally Posted by Merc3y (Post 1031707)
unknown command: +disguise
unknown command: -disguise

add in the command callback : return PLUGIN_HANDLED;

By the way, show your code modified.

Merc3y 12-26-2009 13:52

Re: Model Problem
 
Quote:

Originally Posted by Arkshine (Post 1031943)
add in the command callback : return PLUGIN_HANDLED;

By the way, show your code modified.

PHP Code:

/*================================================================================
 
    -----------------------------------
    -*- [ZP] Zombie Class : Mystique Zombie -*-
    -----------------------------------
 
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
 
    Press "v" to disguise as a human being.
 
================================================================================*/
#include <amxmodx>
#include <cstrike>
#include <zombieplague>
 
new g_zclass_mzombieBindMaxPlayers
new HasDisguise33 ] = 0
 
new const zclass_name[] = { "Mystique Zombie" }
new const 
zclass_info[] = { "Disguise" }
new const 
zclass_model[] = { "zombie_source" }
new const 
zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const 
zclass_health 1700
const zclass_speed 270
const Float:zclass_gravity 0.9
const Float:zclass_knockback 1.0
 
public plugin_init( )
{
        
register_plugin"[ZP] Zombie Class : Mystique Zombie""1.0""Merc3y" )
        
register_logevent"roundStart"2"1=Round_Start" )
        
register_clcmd"+disguise""disguise_start"ADMIN_ALL"bind [key] +disguise" )
        
Bind register_cvar"zp_mzombie_bindkey""1" )
        
MaxPlayers get_maxplayers( )
}
 
public 
plugin_precache( )
{
        
g_zclass_mzombie zp_register_zombie_classzclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback )
 
        
precache_model"models/player/sas/sas.mdl" )
        
precache_model"models/player/arctic/arctic.mdl" )
        
precache_model"models/player/gign/gign.mdl" )
        
precache_model"models/player/gsg9/gsg9.mdl" )
        
precache_model"models/player/guerilla/guerilla.mdl" )
        
precache_model"models/player/leet/leet.mdl" )
        
precache_model"models/player/terror/terror.mdl" )
        
precache_model"models/player/urban/urban.mdl" )
}
 
public 
zp_user_infected_postidinfector )
{
         if ( 
zp_get_user_zombie_classid ) == g_zclass_mzombie )
         {
                   
HasDisguiseid ] = 0
                   
new mode get_pcvar_numBind )
 
                   if ( 
mode == )
                   {
                        
client_cmdid"bind v ^"+disguise^"" )
                        
chat_printid"To disguise press ^'^'V^'^'" )
                   }
 
                   if ( 
mode == 
                   {
                        
chat_printid"To disguise type bind <key> +disguise" )
                   }
         }
}
 
public 
disguise_startid 
{
        if ( 
zp_get_user_zombieid ) && zp_get_user_zombie_classid ) == g_zclass_mzombie && !zp_get_user_nemesisid ) )
        {
                if ( !
is_user_aliveid ) )
                {
                      
chat_printid"You can't disguise when you are are dead." )
                      return 
PLUGIN_HANDLED
                
}
 
                else
                {
                      
Disguiseid )
                      
HasDisguiseid ] = 1
                
}
        }
        return 
PLUGIN_HANDLED
}
 
public 
Disguiseid )
{
          if ( 
zp_get_user_zombieid ) && zp_get_user_zombie_classid ) == g_zclass_mzombie && !zp_get_user_nemesisid ) )
          {
                 switch ( 
random_num1) )
                 {
                       case 
1:
                       {
                             
cs_set_user_modelid"sas" )
                       }
 
                       case 
2:
                       {
                             
cs_set_user_modelid"arctic" )
                       } 
 
                       case 
3:
                       {
                             
cs_set_user_modelid"gign" )
                       } 
 
                       case 
4:
                       {
                             
cs_set_user_modelid"gsg9" )
                       }
 
                       case 
5:
                       {
                             
cs_set_user_modelid"guerilla" )
                       }
 
                       case 
6:
                       {
                             
cs_set_user_modelid"leet" )
                       } 
 
                       case 
7:
                       {
                             
cs_set_user_modelid"terror" )
                       } 
 
                       case 
8:
                       {
                             
cs_set_user_modelid"urban" )
                       } 
                 }
          }

 
public 
roundStart( )
{
      for ( new 
1<= MaxPlayersi++ )
      {
                
HasDisguise] = 0
      
}
}
 
stock chat_printplr, const message[ ], { FloatSqlResult}:... )
{
    static 
msg192 ], saytextmaxplayers;
    
formatmsg191"^x04[ZP]^x01 " );
    
vformatmsg], 185message);
 
    if ( !
saytext )
    {
        
saytext get_user_msgid"SayText" );
    }
 
    if ( !
maxplayers )
    {
        
maxplayers get_maxplayers( );
    }
    if ( 
plr <= maxplayers && plr )
    {
        
message_beginMSG_ONE_UNRELIABLEsaytext, { 00}, plr );
        
write_byteplr );
        
write_stringmsg );
        
message_end( );
    }
    else if ( !
plr )
    {
        for( new 
1<= maxplayersi++ )
        {
            if ( !
is_user_connected) )
            {
                continue;
            }
 
            
message_beginMSG_ONE_UNRELIABLEsaytext, { 00}, );
            
write_byte);
            
write_stringmsg );
            
message_end( );
        }
    }
 
    return 
1;



Merc3y 12-27-2009 00:52

Re: Model Problem
 
Quote:

Originally Posted by Arkshine (Post 1031943)
add in the command callback : return PLUGIN_HANDLED;

By the way, show your code modified.

I don't understand what you mean by add in the command callback : return PLUGIN_HANDLED

Like this ? :

PHP Code:

public disguise_startid 
{
        if ( 
zp_get_user_zombieid ) && zp_get_user_zombie_classid ) == g_zclass_mzombie && !zp_get_user_nemesisid ) )
        {
                if ( !
is_user_aliveid ) )
                {
                      
chat_printid"You can't disguise when you are are dead." )
                      return 
PLUGIN_HANDLED
                
}
 
                else
                {
                      
Disguiseid )
                      
HasDisguiseid ] = 1
                
}
        }
        return 
PLUGIN_HANDLED



Zombiezzz 12-27-2009 02:18

Re: Model Problem
 
yup :P

Merc3y 12-27-2009 06:35

Re: Model Problem
 
Quote:

Originally Posted by Zombiezzz (Post 1032528)
yup :P

No different it doesn't work.

Arkshine 12-27-2009 07:13

Re: Model Problem
 
It was to remove the "unknown command".

The code looks fine, so I don't why it doesn't work. Make sure you use the modified version.


All times are GMT -4. The time now is 04:14.

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