Raised This Month: $ Target: $400
 0% 

cs_set_user_model not working.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pocco299
Member
Join Date: Feb 2007
Old 01-03-2008 , 13:59   cs_set_user_model not working.
Reply With Quote #1

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
    }
}

Last edited by pocco299; 01-03-2008 at 14:02.
pocco299 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-03-2008 , 14:05   Re: cs_set_user_model not working.
Reply With Quote #2

Change

public client_connect(id)

to

public client_putinserver(id)
__________________
Arkshine is offline
pocco299
Member
Join Date: Feb 2007
Old 01-03-2008 , 15:45   Re: cs_set_user_model not working.
Reply With Quote #3

That didnt fix, but the plugin didnt work for any admin, not even the person with spec steamid
pocco299 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-03-2008 , 16:07   Re: cs_set_user_model not working.
Reply With Quote #4

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)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 01-03-2008 , 16:07   Re: cs_set_user_model not working.
Reply With Quote #5

yeah that shuld be it becase the code is case sensetiv.
fxfighter is offline
Send a message via MSN to fxfighter
_Master_
Senior Member
Join Date: Dec 2006
Old 01-03-2008 , 19:49   Re: cs_set_user_model not working.
Reply With Quote #6

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
_Master_ 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 11:00.


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