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=101896)

Russiaboy 08-28-2009 09:40

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

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


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

hzqst 08-28-2009 10:07

Re: a script from my sma. !
 
why do you write
PHP Code:

precache_model("models/player/smith/smith.mdl"

2 times?

xPaw 08-28-2009 10:10

Re: a script from my sma. !
 
Here you go

PHP Code:

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init( ) {
    
register_plugin"Model""1.0""xPaw" );
    
    
RegisterHamHam_Spawn"player""FwdHamSpawn_Player");
}

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

public 
FwdHamSpawn_Playerid )
    if( 
is_user_aliveid ) && ( get_user_flagsid ) & ADMIN_CVAR ) )
        
cs_set_user_modelid"smith" ); 


Russiaboy 08-28-2009 10:18

Re: a script from my sma. !
 
i need to add it in my sma. ....

no creat new plugin

Alucard^ 08-28-2009 12:40

Re: a script from my sma. !
 
wtf? he reconstructed your code... you did it wrong... what you means with "my sma"?

Russiaboy 08-28-2009 12:46

Re: a script from my sma. !
 
http://forums.alliedmods.net/showthread.php?t=101902


thats i mean

fezh 08-28-2009 17:43

Re: a script from my sma. !
 
Actually the Zombie Plague Core sets the models in every spawn, there is no need of doing that :/


All times are GMT -4. The time now is 14:59.

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