AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cs_set_user_model not working. (https://forums.alliedmods.net/showthread.php?t=65206)

pocco299 01-03-2008 13:59

cs_set_user_model not working.
 
Ok, so the the plugin compiles and everything but the model does not set. Can anybody find out why? By the model not setting I mean that it does not load at spawn. And it precaches but it wont load.
Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

new Master_admin
new MasteR_ID[33]= "STEAM_0:1:14718661"

public plugin_init() {
    register_plugin("", "", "")
    register_event("ResetHUD", "spawn_event", "be")
}
public plugin_precache()
{
    precache_model("models/player/gign_everyone_else/gign_everyone_else.mdl")
    precache_model("models/player/gsg9_bambi_aka_special/gsg9_bambi_aka_special.mdl")
}

public Spawn_event(id)
{
    if(is_user_admin(id))
    {
        set_task(2.0,"spawned",id)
    }
}
public spawned(id)
{
    if(id == Master_admin)
    {
        cs_set_user_model(id, "gsg9_bambi_aka_special")
        //set your model heer
    }
    else
    {
        cs_set_user_model(id, "gign_everyone_else")
        //Set defult admin model
    }
}
public client_connect(id)
{
    new authid[32]
    get_user_authid(id,authid,31)
    if(equal(MasteR_ID,authid))
    {
        Master_admin= id
    }
}
public client_disconnect(id)
{
    if(id == Master_admin)
    {
        Master_admin= 99999999999
    }
}


Arkshine 01-03-2008 14:05

Re: cs_set_user_model not working.
 
Change

public client_connect(id)

to

public client_putinserver(id)

pocco299 01-03-2008 15:45

Re: cs_set_user_model not working.
 
That didnt fix, but the plugin didnt work for any admin, not even the person with spec steamid

Exolent[jNr] 01-03-2008 16:07

Re: cs_set_user_model not working.
 
your problem is that the hooked function doesn't match the function in the plugin

change
Code:

public Spawn_event(id)
to
Code:

public spawn_event(id)

fxfighter 01-03-2008 16:07

Re: cs_set_user_model not working.
 
yeah that shuld be it becase the code is case sensetiv.

_Master_ 01-03-2008 19:49

Re: cs_set_user_model not working.
 
get_user_authid() returns valid info on client_authorized(). Also the length of this info is 35 chars not 32.
Try not to use ResetHUD for spawn events. Take a look here


All times are GMT -4. The time now is 11:00.

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