Raised This Month: $ Target: $400
 0% 

Model Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Merc3y
Member
Join Date: Dec 2009
Old 12-26-2009 , 04:05   Model Problem
Reply With Quote #1

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;


Last edited by Merc3y; 12-26-2009 at 04:18.
Merc3y is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 12-26-2009 , 04:12   Re: Model Problem
Reply With Quote #2

any error log in console?
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 12-26-2009 , 06:02   Re: Model Problem
Reply With Quote #3

cs_set_user_model( id, "sas" )
without model path
__________________
xPaw is offline
Merc3y
Member
Join Date: Dec 2009
Old 12-26-2009 , 07:45   Re: Model Problem
Reply With Quote #4

Quote:
Originally Posted by ProIcons View Post
any error log in console?
unknown command: +disguise
unknown command: -disguise

Quote:
Originally Posted by xPaw View Post
cs_set_user_model( id, "sas" )
without model path
Doesn't work. The model still same.
Merc3y is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-26-2009 , 12:40   Re: Model Problem
Reply With Quote #5

Quote:
Originally Posted by Merc3y View Post
unknown command: +disguise
unknown command: -disguise
add in the command callback : return PLUGIN_HANDLED;

By the way, show your code modified.
__________________
Arkshine is offline
Merc3y
Member
Join Date: Dec 2009
Old 12-26-2009 , 13:52   Re: Model Problem
Reply With Quote #6

Quote:
Originally Posted by Arkshine View Post
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;


Last edited by Merc3y; 12-27-2009 at 02:23.
Merc3y is offline
Merc3y
Member
Join Date: Dec 2009
Old 12-27-2009 , 00:52   Re: Model Problem
Reply With Quote #7

Quote:
Originally Posted by Arkshine View Post
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

Merc3y is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-27-2009 , 02:18   Re: Model Problem
Reply With Quote #8

yup
__________________
Zombiezzz is offline
Merc3y
Member
Join Date: Dec 2009
Old 12-27-2009 , 06:35   Re: Model Problem
Reply With Quote #9

Quote:
Originally Posted by Zombiezzz View Post
yup
No different it doesn't work.
Merc3y is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-27-2009 , 07:13   Re: Model Problem
Reply With Quote #10

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.
__________________
Arkshine 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 04:14.


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