Raised This Month: $ Target: $400
 0% 

Player model changes.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
egbertjan
Senior Member
Join Date: Mar 2007
Location: The Netherlands
Old 04-05-2011 , 12:25   Player model changes.
Reply With Quote #1

Hello I got a diablo mod server and I wanted to give assassins their own player model. When I added this to the script it compiled without any trouble, but when I picked the assassin race the server crashes. Does anyone see anything wrong or any improvements?

PHP Code:
        if(player_class[id] == Assassin && cs_get_user_team(id) == CS_TEAM_CT
        {
          
cs_set_user_model(id"models/diablomod/dbo/AssassinCT.mdl")
        }

        if(
player_class[id] == Assassin && cs_get_user_team(id) == CS_TEAM_T
        {
          
cs_set_user_model(id"models/diablomod/dbo/AssassinT.mdl")
        } 
P.S. The precache also works just fine.
egbertjan is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-05-2011 , 12:51   Re: Player model changes.
Reply With Quote #2

It should be "AssassinCT" and "AssassinT"
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-05-2011 , 13:39   Re: Player model changes.
Reply With Quote #3

Also, folder has to be named with the same name as model, and has to be put directly in player folder.

models/player/MODELNAME/MODELNAME.mdl

And don't forget to precache models.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
egbertjan
Senior Member
Join Date: Mar 2007
Location: The Netherlands
Old 04-05-2011 , 15:02   Re: Player model changes.
Reply With Quote #4

Thanks for the quick replies. When I have followed your reactions I come with a compilation error that says it's losing it's identation. From the beginning of the "if(player_class[id] == Assassin && cs_get_user_team(id) == CS_TEAM_CT)"
to the last bracket of the "
if(player_class[id] == Assassin && cs_get_user_team(id) == CS_TEAM_T)"
Would there be any reason for this?

Last edited by egbertjan; 04-05-2011 at 15:05.
egbertjan is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 04-05-2011 , 15:25   Re: Player model changes.
Reply With Quote #5

post your code hear, it's more easy to help you.
__________________

padilha007 is offline
egbertjan
Senior Member
Join Date: Mar 2007
Location: The Netherlands
Old 04-05-2011 , 16:00   Re: Player model changes.
Reply With Quote #6

It's quite some big script so I will just post the essential things:
PHP Code:
new ASSASSINT[]  = "models/player/AsassinT/AssassinT.mdl"
new ASSASSINCT[]  = "models/player/AsassinCT/AssassinCT.mdl" 
PHP Code:
public plugin_precache()

    
precache_model("ASSASSINCT")
    
precache_model("ASSASSINT")

PHP Code:
//more script parts here. but would make it look messy so I will just post 
//the model part here

if (is_user_connected(id))
    {
        if(
player_class[id] == Assassin && cs_get_user_team(id) == CS_TEAM_CT
        {
          
cs_set_user_model(id"ASSASSINCT")
        }

        if(
player_class[id] == Assassin && cs_get_user_team(id) == CS_TEAM_T
        {
          
cs_set_user_model(id"ASSASSINT")
        } 
     } 
egbertjan is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-05-2011 , 16:01   Re: Player model changes.
Reply With Quote #7

cs_set_user_model(id, "ASSASSINCT") -> AssassinT

"models/player/MyModel/MyModel.mdl ; cs_set_user_model needs MyModel.
__________________
Arkshine is offline
egbertjan
Senior Member
Join Date: Mar 2007
Location: The Netherlands
Old 04-05-2011 , 16:09   Re: Player model changes.
Reply With Quote #8

Sorry I didn't quite understand the last sentance, Right now I got the following:

PHP Code:
new AssassinT[]  = "models/player/AssassinT/AssassinT.mdl"
new AssassinCT[]  = "models/player/AssassinCT/AssassinCT.mdl"


    
precache_model(AssassinCT)
    
precache_model(AssassinT)

  if(
player_class[id] == Assassin && cs_get_user_team(id) == CS_TEAM_CT
        {
          
cs_set_user_model(id"AssassinCT")
        }

        if(
player_class[id] == Assassin && cs_get_user_team(id) == CS_TEAM_T
        {
          
cs_set_user_model(id"AssassinT")
        } 

I have changed ASSASSIN to Assassin because it looks better, but I think I fixed that through the script now.
egbertjan is offline
egbertjan
Senior Member
Join Date: Mar 2007
Location: The Netherlands
Old 04-06-2011 , 10:50   Re: Player model changes.
Reply With Quote #9

But still I got 1 compile error with the loose identation.

Edit: It does work, but I still have these loose identations, it won't affect the script?

Last edited by egbertjan; 04-06-2011 at 11:12.
egbertjan is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-06-2011 , 11:15   Re: Player model changes.
Reply With Quote #10

No, it won't affect. It means just your code is not indented properly. You can see well that's not well aligned.
__________________
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 19:45.


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