AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Changing models doesn't work (https://forums.alliedmods.net/showthread.php?t=113706)

Backstabnoob 12-29-2009 13:23

Changing models doesn't work
 
Somehow this does nothing, no models changed.
PHP Code:

public pChangeModels() {
    new 
Players[32
    new 
playerCountiid
    get_players
(PlayersplayerCount
    for (
i=0i<playerCounti++) { 
           
id Players[i]
        if(
cs_get_user_team(id) != CS_TEAM_T) return PLUGIN_HANDLED
        cs_set_user_model
(id"JailBreak")
    }
    
set_task(10.0"pChangeModels")


It's called in plugin_init().

shuttle_wave 12-29-2009 18:33

Re: Changing models doesn't work
 
PHP Code:

cs_set_user_model(id"JailBreak"

??? "JailBreak" u need the full location like models/player/jailbreak/guard.mdl

why dont u use the player models plugin but connormcleod

Backstabnoob 12-31-2009 02:56

Re: Changing models doesn't work
 
NO I DON'T.

Why should I use his plugin, if I want mine? I'm adding THIS into my code.

I tried to do it this way on HAM_Spawn, but that threw everyone out with SVC_BAD. I think this will not happen if I use set_user_info(), but I don't know how to use it right when user changes his model (M - Counter terrorist - Gign). If anyone know how to do it this via this method, I'll by happy.

AppStore 12-31-2009 08:44

Re: Changing models doesn't work
 
Not so?
PHP Code:

public pChangeModels() {
    new 
Players[32
    new 
playerCountiid
    get_players
(PlayersplayerCount
    for (
i=0i<playerCounti++) { 
        
id Players[i]
        if(
cs_get_user_team(Players[i]) != CS_TEAM_T) return PLUGIN_HANDLED
        cs_set_user_model
(Players[id], "JailBreak")
    }
    
set_task(10.0"pChangeModels")
    
    return 
PLUGIN_HANDLED



ConnorMcLeod 12-31-2009 08:57

Re: Changing models doesn't work
 
Use this : http://forums.alliedmods.net/showthread.php?p=958925

Arkshine 12-31-2009 10:39

Re: Changing models doesn't work
 
Quote:

Originally Posted by shuttle_wave (Post 1035820)
PHP Code:

cs_set_user_model(id"JailBreak"

??? "JailBreak" u need the full location like models/player/jailbreak/guard.mdl

why dont u use the player models plugin but connormcleod

No. You don't need the full path. You need only the name.


Quote:

Originally Posted by Backstabnoob (Post 1037415)
NO I DON'T.

Why should I use his plugin, if I want mine? I'm adding THIS into my code.

I tried to do it this way on HAM_Spawn, but that threw everyone out with SVC_BAD. I think this will not happen if I use set_user_info(), but I don't know how to use it right when user changes his model (M - Counter terrorist - Gign). If anyone know how to do it this via this method, I'll by happy.

Because cs_set_user_model() is known to generate svc_bad error and so kicks. PlayerModel by Connor uses another method to render the model. If you want to use your own plugin, use at least his method.


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

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