AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with one script (https://forums.alliedmods.net/showthread.php?t=196404)

Fr4Nc3Zu 09-20-2012 10:21

Help with one script
 
Hello..i dont know scripting..but i have one friend who made this script:
PHP Code:

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

public plugin_init() {
        
register_plugin("Vip Model""1.0""Schultz")
        
register_event("ResetHUD""resetModel""b")
        return 
PLUGIN_CONTINUE
}

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

        return 
PLUGIN_CONTINUE
}

public 
resetModel(idlevelcid) {
        if (
get_user_flags(id) & ADMIN_LEVEL_H) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"vip_te")
                }
                else if(
userTeam == CS_TEAM_CT) {
                        
cs_set_user_model(id"vip_ct")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE


The script it`s working..but has a small error occasionally:
PHP Code:

[AMXXRun time error 10 (plugin "vip_model.amxx") (native "cs_get_user_team") - debug not enabled

Any clue what`s that about ? It helps if i put the plugin in debug mod ?

gogicaa 09-20-2012 13:45

Re: Help with one script
 
Yes. Enable debug and post output.

claudiuhks 09-20-2012 18:58

Re: Help with one script
 
It's badly coded.

avril-lavigne 09-21-2012 19:31

Re: Help with one script
 
use case CS_TEAM_CT:
check if(is_user_alive(id)) {

Fr4Nc3Zu 09-22-2012 11:10

Re: Help with one script
 
like i said..i dont know scripting..what it`s wrong ?
I`m waiting for exact error..debug on..

quilhos 09-22-2012 11:43

Re: Help with one script
 
PHP Code:

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

new bool:g_bAdmin33 ];

public 
plugin_init( ) {
    
register_plugin"Admin Model""1.2""whitemike" );
    
    
RegisterHamHam_Spawn"player""FwdHamPlayerSpawn");
}

public 
plugin_precache( ) {
    
precache_model"models/player/vip_ct/vip_ct.mdl" );
    
precache_model"models/player/vip_te/vip_te.mdl" );
}

public 
client_authorizedid )
    
g_bAdminid ] = bool:( get_user_flagsid ) & ADMIN_LEVEL_H );

public 
client_disconnectid )
    
g_bAdminid ] = false;

public 
FwdHamPlayerSpawn( const id ) {
    if( 
g_bAdminid ] && is_user_aliveid ) ) {
        switch( 
cs_get_user_teamid ) ) {
            case 
CS_TEAM_Tcs_set_user_modelid"vip_te" );
            case 
CS_TEAM_CTcs_set_user_modelid"vip_ct" );
        }
    }


use that version of the plugin.

Fr4Nc3Zu 09-22-2012 16:18

Re: Help with one script
 
ty..i will try this version

LE: so far so good..no errors


All times are GMT -4. The time now is 08:13.

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