AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   a script from my sma. ! (https://forums.alliedmods.net/showthread.php?t=101897)

Russiaboy 08-28-2009 09:41

a script from my sma. !
 
where is the problem?

register_event("ResetHUD", "resetModel", "b")




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

Alucard^ 08-28-2009 10:16

Re: a script from my sma. !
 
1: Plz, add [PHP] bbcode in your code, next time.

2: Maybe this:

PHP Code:

#include <amxmodx>
#include <cstrike>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("ResetHUD""resetModel""b")
}

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

public 
resetModel(id)
{
    if (
get_user_flags(id) & ADMIN_CVAR)
    {
        if(
cs_get_user_team(id) == CS_TEAM_T)
            
cs_set_user_model(id"smith")
        else if(
cs_get_user_team(id) == CS_TEAM_CT)
            
cs_set_user_model(id"smith")
        else
            
cs_reset_user_model(id)
    } 




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

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