Raised This Month: $ Target: $400
 0% 

Player model Change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asd13
Member
Join Date: Apr 2009
Old 09-29-2009 , 14:02   Player model Change
Reply With Quote #1

Would this code work?

Code:
#include <amxmodx>
#include <cstrike>
#include <amxmisc>

#define PLUGIN_NAME "vipas"
#define PLUGIN_AUTHOR "Kukulis"
#define PLUGIN_VERSION "0.1"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_AUTHOR, PLUGIN_VERSION);

return PLUGIN_CONTINUE

}

public plugin_precache() {
precache_model("models/player/smith/smith.mdl")
precache_model("models/player/smith/smith.mdl")

return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {
if (get_user_flags(id) & ADMIN_CVAR) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "smith")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "smith")
}
else {
cs_reset_user_model(id)
}
}

return PLUGIN_CONTINUE
}
I took this piece of code from
http://forums.alliedmods.net/showthr...light=vip+skin
And deleted not needed stuff what i did not need.
asd13 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-29-2009 , 14:05   Re: Player model Change
Reply With Quote #2

No, it would not.
__________________
Arkshine is offline
asd13
Member
Join Date: Apr 2009
Old 09-29-2009 , 14:08   Re: Player model Change
Reply With Quote #3

Why not? Please can you or someone correct this code then.
asd13 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-29-2009 , 14:10   Re: Player model Change
Reply With Quote #4

resetModel is never called.
__________________
Arkshine is offline
asd13
Member
Join Date: Apr 2009
Old 09-29-2009 , 14:27   Re: Player model Change
Reply With Quote #5

If i would remove
Code:
}
else {
cs_reset_user_model(id)
It would work?
asd13 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-29-2009 , 14:37   Re: Player model Change
Reply With Quote #6

I mean the function resetModel() is not called from any others functions or forward/command etc.
__________________
Arkshine is offline
Old 09-29-2009, 17:14
asd13
This message has been deleted by asd13.
Old 09-29-2009, 17:41
asd13
This message has been deleted by asd13.
asd13
Member
Join Date: Apr 2009
Old 09-30-2009 , 10:45   Re: Player model Change
Reply With Quote #7

Now this changes the model but after round restart
How can can it be so that model is changed instandly without of needing restartround

Code:
#include <amxmodx>
#include <cstrike>
 
enum
{
    TEAM_UNASSIGNED,
    TEAM_T,
    TEAM_CT,
    TEAM_SPECTATOR
};

public plugin_precache() {
    precache_model("models/player/smith/smith.mdl")
    precache_model("models/player/smith/smith.mdl")
}
 
public plugin_init() {
    register_plugin("Vip Model", "1.0", "Author");
    register_event("ResetHUD", "ResetHUD", "be");
}

public ResetHUD(Client) {
    if (!is_user_alive(Client))
            return;

    new CsTeams:Team = cs_get_user_team(Client);

    switch (Team)
    {
        case TEAM_T:
        {
                if (get_user_flags(Client) & ADMIN_BAN) cs_set_user_model(Client, "smith");
                else cs_reset_user_model(Client);
        }
        case TEAM_CT:
        {
                if (get_user_flags(Client) & ADMIN_BAN) cs_set_user_model(Client, "smith");
                else cs_reset_user_model(Client);
        }
    }
}
asd13 is offline
Reply


Thread Tools
Display Modes

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 22:32.


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