AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   vip admin model for T too (https://forums.alliedmods.net/showthread.php?t=85061)

Alucard^ 02-05-2009 01:14

vip admin model for T too
 
hi..

i need this code by connor but with T:

PHP Code:

#include <amxmodx>
#include <fakemeta>

#define CS_CT_VIP                9
#define OFFSET_TEAM                114
#define OFFSET_INTERNALMODEL        126
#define SCOREATTRIB_VIP            (1<<2)

public plugin_init() {
    
register_plugin("Admin VIP""1.0""ConnorMcLeod")

    if ( 
engfunc(EngFunc_FindEntityByString0"classname""info_vip_start") <= )
        
register_message(get_user_msgid("ScoreAttrib"), "Hook_ScoreAttrib")
}

public 
Hook_ScoreAttrib(osef2talifeosef3talifeosef4talife)
{
    new 
id get_msg_arg_int(1)

    if(
get_pdata_int(idOFFSET_TEAM) != 2)
        return 
PLUGIN_CONTINUE

    
new adminflags get_user_flags(id)
    if(!
adminflags || adminflags ADMIN_USER)
        return 
PLUGIN_CONTINUE

    
if(get_msg_arg_int(2))
        return 
PLUGIN_CONTINUE

    set_pdata_int
(idOFFSET_INTERNALMODELCS_CT_VIP)
    
dllfunc(DLLFunc_ClientUserInfoChangedid)

    
set_msg_arg_int(20SCOREATTRIB_VIP)
    
    return 
PLUGIN_CONTINUE


it posible? or need another way?


or..... see this..

PHP Code:

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

#define VIP "models/player/vip/vip.mdl" 
#define FLAG "ADMIN_KICK" 

public plugin_init() { 
        
register_event("ResetHUD""resetModel""b"
        return 
PLUGIN_CONTINUE 


public 
plugin_precache() { 
        
precache_model(VIP

        return 
PLUGIN_CONTINUE 


public 
resetModel(idlevelcid) { 
    if (
get_user_flags(id) & FLAG)  
    { 
        
cs_set_user_model(idVIP
    } 
    else 
    { 
        
cs_reset_user_model(id
    } 
     
    return 
PLUGIN_CONTINUE


Quote:

/home/groups/amxmodx/tmp3/textp6J3WJ.sma(20) : error 033: array must be indexed (variable "-unknown-")

TheRadiance 02-05-2009 01:29

Re: vip admin model for T too
 
I think you can set only VIP model and armour, but scoreboard...

Quote:

PHP Code:
PHP Code:

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

#define VIP "models/player/vip/vip.mdl" 
#define FLAG "ADMIN_KICK" 

public plugin_init() { 
        
register_event("ResetHUD""resetModel""b"
        return 
PLUGIN_CONTINUE 


public 
plugin_precache() { 
        
precache_model(VIP

        return 
PLUGIN_CONTINUE 


public 
resetModel(idlevelcid) { 
    if (
get_user_flags(id) & FLAG)  
    { 
        
cs_set_user_model(idVIP
    } 
    else 
    { 
        
cs_reset_user_model(id
    } 
     
    return 
PLUGIN_CONTINUE



must be:
PHP Code:

public resetModel(id) { 
    if (
get_user_flags(id) & FLAG)  
    { 
        
cs_set_user_model(idVIP
    } 
    else 
    { 
        
cs_reset_user_model(id
    } 
     
    return 
PLUGIN_CONTINUE



IneedHelp 02-05-2009 01:29

Re: vip admin model for T too
 
On connor's code remove this:

PHP Code:

    if(get_pdata_int(idOFFSET_TEAM) != 2)
        return 
PLUGIN_CONTINUE 

But the VIP on the scoreboard for T's isn't possible (I think)

TheRadiance 02-05-2009 01:33

Re: vip admin model for T too
 
Quote:

PHP Code:

On connor's code remove this:

PHP Code:
    if(get_pdata_int(id, OFFSET_TEAM) != 2)
        return PLUGIN_CONTINUE 


I just tested, and it doesn't work.

IneedHelp 02-05-2009 01:47

Re: vip admin model for T too
 
Hm, maybe..

PHP Code:

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

#define VIP_MODEL "models/player/vip/vip.mdl"
#define VIP_ABBR "vip"
#define VIP_FLAG ADMIN_KICK

public plugin_init()
    
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)

public 
plugin_precache()
    
precache_model(VIP_MODEL)

public 
Fwd_PlayerSpawn_Post(id)
{
    if (
is_user_alive(id))
           if (
get_user_flags(id) & VIP_FLAG)
                  
cs_set_user_model(idVIP_ABBR)



TheRadiance 02-05-2009 02:00

Re: vip admin model for T too
 
Quote:

Hm, maybe..

PHP Code:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define VIP_MODEL "models/player/vip/vip.mdl"
#define VIP_ABBR "vip"
#define VIP_FLAG ADMIN_KICK

public plugin_init()
    
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)

public 
plugin_precache()
    
precache_model(VIP_MODEL)

public 
Fwd_PlayerSpawn_Post(id)
{
    if (
is_user_alive(id))
           if (
get_user_flags(id) & VIP_FLAG)
                  
cs_set_user_model(idVIP_ABBR)



Yes, i think it's the better way to do this.

SnoW 02-05-2009 08:16

Re: vip admin model for T too
 
Quote:

Originally Posted by TheRadiance (Post 756003)
Yes, i think it's the better way to do this.

Ofc it's more simple with Cstrike, but there's a lot of servers that don't use Cstrike, cause it's kind of useless(FM can "replace" it). There's nothing that the Cstrike way would be better, it just depends what modules the server uses.

hleV 02-05-2009 09:05

Re: vip admin model for T too
 
Fakemeta is better.

Exolent[jNr] 02-05-2009 15:51

Re: vip admin model for T too
 
Since no one pointed it out:
Quote:

Originally Posted by Alucard^ (Post 755990)
PHP Code:

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

#define VIP "models/player/vip/vip.mdl" 
#define FLAG "ADMIN_KICK" 

public plugin_init() { 
        
register_event("ResetHUD""resetModel""b"
        return 
PLUGIN_CONTINUE 


public 
plugin_precache() { 
        
precache_model(VIP

        return 
PLUGIN_CONTINUE 


public 
resetModel(idlevelcid) { 
    if (
get_user_flags(id) & FLAG)  
    { 
        
cs_set_user_model(idVIP
    } 
    else 
    { 
        
cs_reset_user_model(id
    } 
     
    return 
PLUGIN_CONTINUE



Should be:
PHP Code:

#define FLAG ADMIN_KICK 

without quotes.


All times are GMT -4. The time now is 01:54.

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