Raised This Month: $ Target: $400
 0% 

[Help] VIP model BB


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
romi
Member
Join Date: Jul 2014
Location: Far Far AwaY From YoU!
Old 09-28-2015 , 08:25   [Help] VIP model BB
Reply With Quote #1

Hello ,, i found this plugin for admin model and i want to turn it for vip vip acc = H ,, i want that vip has a speciall model when its CT but when its TT it has the normal basebuilder zombie choosen ,, help pls :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
        
register_plugin("AMX Admin Model""1.1.1""whitemike")
        
register_event("ResetHUD""resetModel""b")
        return 
PLUGIN_CONTINUE
}

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

        return 
PLUGIN_CONTINUE
}

public 
resetModel(idlevelcid) {
        if (
get_user_flags(id) & ADMIN_LEVEL_A) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"pgeu_t")
                }
                else if(
userTeam == CS_TEAM_CT) {
                        
cs_set_user_model(id"pgeu_ct")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE

romi is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 09-28-2015 , 14:49   Re: [Help] VIP model BB
Reply With Quote #2

PHP Code:
if (get_user_flags(id) & ADMIN_LEVEL_A


PHP Code:
if (get_user_flags(id) & ADMIN_CFG
https://wiki.alliedmods.net/Adding_Admins_(AMX_Mod_X)
If you can't remember admin flags, Search before you post...

Last edited by redivcram; 09-28-2015 at 14:53.
redivcram is offline
romi
Member
Join Date: Jul 2014
Location: Far Far AwaY From YoU!
Old 09-29-2015 , 09:51   Re: [Help] VIP model BB
Reply With Quote #3

Quote:
Originally Posted by redivcram View Post
PHP Code:
if (get_user_flags(id) & ADMIN_LEVEL_A


PHP Code:
if (get_user_flags(id) & ADMIN_CFG
https://wiki.alliedmods.net/Adding_Admins_(AMX_Mod_X)
If you can't remember admin flags, Search before you post...
I Don't want admin level cause i can change it but i want that when be tt it be the choosen zm model cause it's a tt model !
romi is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 09-29-2015 , 13:39   Re: [Help] VIP model BB
Reply With Quote #4

Quote:
Originally Posted by romi View Post
I Don't want admin level
"Vip level" is Admin Level, any custom permission group must have admin level, you want vip's access flag "h" right? ADMIN_CFG is flag "h"
Unless you wanted ADMIN_LEVEL_H ? then replace it with that...

Quote:
Originally Posted by romi View Post
cause i can change it but i want that when be tt it be the choosen zm model cause it's a tt model !
Please speak English... You make no sense. You say that when you're tt your chosen model is a zombie for tt?

Is that what you wanted to say?

Last edited by redivcram; 09-29-2015 at 13:40.
redivcram is offline
romi
Member
Join Date: Jul 2014
Location: Far Far AwaY From YoU!
Old 10-01-2015 , 06:48   Re: [Help] VIP model BB
Reply With Quote #5

Man ,, i want that when a player is zm (tt) it be the normal zombie / zombie claw and not a tt model / claw model
do you got me now ?
romi is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 10-01-2015 , 09:54   Re: [Help] VIP model BB
Reply With Quote #6

You need to speak English if you want me to understand you
But after trying to figure out what you posted I think I got it...

Are pgeu_ct and pgeu_t default or special models?
redivcram is offline
CodingIsHard
Junior Member
Join Date: Jul 2015
Old 10-01-2015 , 10:32   Re: [Help] VIP model BB
Reply With Quote #7

Quote:
Originally Posted by redivcram View Post
You need to speak English if you want me to understand you
But after trying to figure out what you posted I think I got it...

Are pgeu_ct and pgeu_t default or special models?
I belive those are the "VIP models". Nevertheless hooking to ResetHUD have been over this forum for a long time, read the following thread https://forums.alliedmods.net/showthread.php?t=42159 why it isn't a good idea to hook it without defining when to.

This is what I would use.

PHP Code:

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

new const g_VipModels[][] = {

    
"models/player/pgeu_ct/pgeu_ct.mdl",
    
"models/player/pgeu_t/pgeu_t.mdl"

}

public 
plugin_init() {
    
    
register_plugin("AMX Admin Model""1.1.1""whitemike");
    
RegisterHam(Ham_Spawn"player""fwHamSpawnPlayer"1)  
    
// return PLUGIN_CONTINUE  Why?
}

public 
plugin_precache() {

    for(new 
0sizeof(g_VipModels); i++) {
        
precache_model(g_VipModels[i]);
    }

}

public 
fwHamSpawnPlayer(id) {

    
setVipModel(id);

}

public 
setVipModel(idlevelcid) {

    if(
get_user_flags(id) & ADMIN_LEVEL_A) {
        
        if(
cs_get_user_team(id) == CS_TEAM_CT) {
           
cs_set_user_model(idg_VipModels[0]);
        }
        }
   return 
PLUGIN_HANDLED;

NB! This is not tested, if it works, it works, if not, i might fix it later.
Just don't set the model to T? What you can also do is check which model the current player has, if he/she has a default model, then switch it to whatever you like, if not.. return PLUGIN_HANDLED?

Last edited by CodingIsHard; 10-01-2015 at 10:40. Reason: Reading, understanding.
CodingIsHard is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 10-02-2015 , 12:55   Re: [Help] VIP model BB
Reply With Quote #8

But wait.. Terrors will have their default models?

Last edited by redivcram; 10-02-2015 at 12:55.
redivcram is offline
Reply



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:18.


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